Coder Social home page Coder Social logo

iodocs's People

Contributors

adamkaplan avatar aleksi avatar alexadkins avatar goliatone avatar hillct avatar jedwood avatar jplock avatar kamalgill avatar kevinpeterson avatar kmiyashiro avatar krisrak avatar lornajane avatar mansilladev avatar marceloemmerich avatar martintajur avatar mtougeron avatar nathanwdavis avatar nortron avatar phairow avatar precision avatar rmax avatar rowanhill avatar sco11morgan avatar silentdth avatar sqmk avatar stackus avatar switzer avatar synedra avatar vky avatar zhendershot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iodocs's Issues

Two-legged authentication

Hello,

Although it's mentioned briefly in the documentation I can't seem to find much information regarding two-legged authentication support within IO Docs.

am I missing something quite obvious?

Thanks,
Matt.

Cannot read property 'Content-Length' of undefined

TypeError: Cannot read property 'Content-Length' of undefined
at unsecuredCall (/Projects/iodocs/app.js:519:29)
at processRequest (
/Projects/iodocs/app.js:462:9)
at callbacks (/Projects/iodocs/node_modules/express/lib/router/index.js:272:11)
at oauth (
/Projects/iodocs/app.js:185:9)
at callbacks (/Projects/iodocs/node_modules/express/lib/router/index.js:272:11)
at param (
/Projects/iodocs/node_modules/express/lib/router/index.js:246:11)
at pass (/Projects/iodocs/node_modules/express/lib/router/index.js:253:5)
at Router._dispatch (
/Projects/iodocs/node_modules/express/lib/router/index.js:280:5)
at Object.middleware as handle
at next (~/Projects/iodocs/node_modules/express/node_modules/connect/lib/http.js:204:15)
127.0.0.1 - - [Mon, 29 Oct 2012 13:03:59 GMT] "POST /processReq HTTP/1.1" 500 - "http://localhost:3000/osstudio" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4"

Express 3 compatibility

I just made the necessary changes in my local modified version. If nobody else is already working on this, I'd be glad to submit a pull request.

Support for nested parameter names

Hello,

It seems that iodocs uses "querystring", which decided to not support nested parameter keys (i.e. deep objects) in 0.3:
https://github.com/joyent/node/wiki/Migrating-from-v0.2-to-v0.3

This means that Rails-style parameter names are no longer supported. i.e.:

In iodocs, that would be configured something like this:


A fix is to require('qs') instead of require('querystring'), which re-introduces support for deep objects. The "node-querystring" project can be found here:
https://github.com/visionmedia/node-querystring

If others would also find this valuable, perhaps support for nested objects could be introduced in iodocs.

Thanks!
Adam

Documentation is missing desciption of custom header usage

I am evaluating iodocs as a REST documentation tool and I found it quite nice how fast I got a first example running. Unfortunately now I'm struggling with a thing that I couldn't find in any of the readme files: we use certain request headers with our services that I'd like to be present in iodocs. My first idea was to put a section called "headers" in the json description files and insert the required entries, but that only changed the html page to show an expandable headers section with no prefilled entry.

Is there a way to define custom headers and if so: how is the exact syntax in the json file?

I found an example on http://developer.mashery.com/iodocs# that had this feature by setting a "fixed" parameter (Aetna Retail Rx Pricing API).

Break Out Parameter Types?

My company's API has multiple parameter types. We have required (already a flag for that in IODocs) as well as optional, filter, group, etc. parameters.

I've been just adding the parameter type in the description, but it's still hard to see the different groupings. Is there a way to break out the different types of parameters to make it easier to digest?

Johnny

replacing URI placeholders

I see the code is replacing placeholders marked with a colon preceding the parameter name, like :paramName . But there's something that I think is not right - placeholders for parameters (even optional ones) with no supplied value (which ==="") are not replaced. I'm going to get that fixed (because I need it ;-) ) but thought to post this in case someone's got good arguments against.

Cheers

json/xml request bodies

Currently working with some REST based services. Was pointed at IODocs as a documentation mechanism for them (and think it is a fabulous tool)

Ran into issues trying to:

support the use of multiple request headers for content negotiation
handle xml or json as the service request body.

After exploring and borrowing liberally from the options presented here, tried out the following changes locally to support simple xml or json, and the setting of (at least) Accept and Content-Type headers.

Would welcome suggestions for doing this better.

patch with local changes

https://gist.github.com/3925249

Add support for configurable method URIs

I have a scenario where I'd like to have the last part of my method URIs be enterable in the form just like the query parameters are. Does anyone else need this sort of thing? The reason is that the last part of the URI is an ID value that would vary for each end user.
I was wondering if there has been any discussion of using a special syntax for part of the URI so that it would automatically be added to the form and before the request is submitted the value entered in the form will be added to the actual URI of the request.

Running iodocs behind an http proxy

We are trying to setup iodocs on our internal network behind an http proxy and call our web apis in the cloud over https.
We could not find a way to get around this, even by using Charles, MacProxy.
Is there any support planned in iodocs for proxy settings? or some wiki help to setup a proxy that will work with iodocs?

Thanks,
Florin

Clarification of baseURL and publicPath settings in apiconfig.json

Does the baseURL require a host name rather than a URL prefix?

Downloaded I/O Docs on August 10, 2011 from GitHub and noticed the apiconfig.json settings for baseURL expects a host name (e.g. example.com) rather than a URL prefix (e.g. http://example.com/api), with the publicPath expected to be the full relative path to the api (eg. /sampleAPI/v1) rather than a simple version identifier.

To clarify, if the API URL is at 'http://example.com/sampleAPI/v1', the baseURL appears to expect 'example.com' while the the publicPath should be '/sampleAPI/v1'.

Avoid absolute links to resources

All links to /images, /javascripts, /stylesheets, and api requests (at least processReq) are currently started with / symbol which prevents to locate iodocs service under subfolder.

Thus http://*****.com/iodoc with the following nginx snippet doesn't work due to this limitation

 location /iodoc {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        rewrite /iodoc/(.*) /$1 break;
        proxy_pass http://localhost:3000/;
        proxy_redirect off;
   }

non-query string parameters

Hi guys, I like the support for placement of parameters within the URI but before the query string, like so: "/api/test/get/:param1". Thanks for that as well!

The only issue I find with this is that if :param1 is defined as an optional parameter then the resulting URI will still contain the text ":param1" when the value for :param1 is empty. If :param1 is set to a value before the request is made, the URI is updated correctly to send that value; it's only when empty that the expected behavior or ":param1" being removed from the URI doesn't happen.

This request requires HTTP authentication

When i send a get request in my own application its showing 401 error . Response body is like below :

<title>Apache Tomcat/6.0.16 - Error report</title> <style> </style>

HTTP Status 401 -


type Status report

message

description This request requires HTTP authentication ().


Apache Tomcat/6.0.16

Update jQuery to 1.9.x

jQuery is a bit out of date with this implementation. Suggesting that we update to 1.9.x, and update the UI to make use of any new stuff.

Node.js init script

About the Node.js library init script for iodocs? correct me if i am wrong but I think that relative paths on the app.js will bring problems when we make init scripts. I am actually using https://gist.github.com/715255 but it fails because of the path in app.js

Password Protect the iodocs page

Hi Guys,

is there a way to add basic authorization to iodocs app? So it asks for pre-defined login and password before opening the list of APIs?

thanks,
Dmitry

OAuth Three-legged with multiple API

If I add more than one API to apiconfig.json with the same type of auth (oauth three-legged) I only can log in in one API because the other one appears like I am already logged in.

Is it a known issue or I am doing some wrong?

HTTP POST/PUT params

Is there any way parameters can be passed in the request body rather than the url for POST/PUT methods? Currently all params are sent via the url, even for POST/PUT.

installing iodocs with node v0.8.2

(disclaimer: I'm quite a newbie at node, my experience is in other scripting languages)

I am trying to install iodocs on my ubuntu machine. Running npm install makes express give errors about my node version:

npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: [email protected]
npm ERR! Required: {"node":">= 0.4.1 < 0.7.0"}
npm ERR! Actual: {"npm":"1.1.16","node":"0.8.2"}
npm ERR!
npm ERR! System Linux 3.0.0-21-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /home/lorna/svndir/iodocs/lornajane
npm ERR! node -v v0.8.2
npm ERR! npm -v 1.1.16
npm ERR! code ENOTSUP
npm ERR! message Unsupported
npm ERR! errno {}

I installed the current express version, but that's v3.0.0rc4 and that made things worse. I found this stackoverflow question helpful: http://stackoverflow.com/questions/9577988/install-iodocs-on-linux but I'm not any further forward.

What versions of node/express can I use? RTFM links and other pointers are all gratefully received - I have a REST API that I think would be a great use of iodocs if I could only get this going :)

Setting different database on Redis

Hi everyone,
I've encountered some difficulties on trying to set a different db on Redis (we're using Redis on our project, so we wanted to avoid to use the same db for different things.

I thought that the database configuration in config.json would work but that's not true (that parameter is not used) so I explored the code and setted manually (after a bit of research).

So, if you want the database in config.json to work you've to add this (line 99) during the creation of the redis-store:

store:  new RedisStore({
            'host':   config.redis.host,
            'port':   config.redis.port,
            'pass':   config.redis.password,
            'db':     config.redis.database,
            'maxAge': 1209600000
        })

I don't know if this is an issue but maybe is going to save time to someone else. : )

Support to handle different content type in Payload (Text,JSON etc.) according to “Content-Type” header

Hi,

I get error when I run “POST” request with “Content-Type”: “application/json”, as payload always goes as text. There must be check to handle different content-type, below is code which I changed to get it working.

Line number 341 in app.js
From:
if (['POST','DELETE','PUT'].indexOf(httpMethod) !== -1) {
var requestBody = query.stringify(params);
}

To:
if (['POST','DELETE','PUT'].indexOf(httpMethod) !== -1) {
var requestBody = JSON.stringify(params);
}

Thanks,
Shailesh

OAuth 2.0 support

Is there any current plan to implement support for OAuth 2.0, I'm looking forward to using IO Docs on some of my future projects.

Deprecation warnings in Webkit browsers

The following deprecation warnings are visible in the console for Chrome, Safari, etc. The message sounds a bit on the urgent side.

event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.

OAuth Post - parameters not in the body

Some I just started messing around with this and was able to get my OAuth 1.0a testing going pretty easily. GET requests gave me zero problems, however when I started trying to do POST requests, I found that it was sending a POST, but it had the parameters in the URL.

OAuth Type: Three-legged
OAuth Module - version 0.9.8

In app.js, I found that for 3-legged, it is still using "getProtectedResource" from the Oauth module, which is listed as deprecated. Would it simply need to make a call similar to the two-legged method of using the switch-case to call the individual methods?

Thanks

support non-standard http verbs

It might be an odd choice, but some REST APIS might use other verbs than post/put/get/delete. It would be nice if these were supported in the generated docs/forms

Add support for file upload

Since some APIs use file uploads and IO docs will output a text box it would be nice to have support to upload a file through IO docs to test the API.

How to run GET,POST,PUT and DELETE service

Hello. I am not able to run any service in iodocs.when i run post service, i am getting following error

HTTP Status 400 - org.codehaus.jackson.JsonParseException: Unexpected character ('a' (code 97)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: org.apache.catalina.connector.CoyoteInputStream@2802690b; line: 1, column: 2]

Kindly suggest the solution

Enumerated Paramater as Header

With adding "Location":"header" we can add now a parameter to the header of a request.

That is very cool feature, but unfortunately it does not work ifthe parameter is of type:"enumerated".

eg:

"parameters":[{
                     "Name":"Accept",
                     "Required":"Y",
                     "Default":"application/json",
                     "Type":"enumerated",
                     "EnumeratedList": [
                        "application/json",
                        "application/xml"
                        ],
                     "Description":"DD",
                     "Location":"header"

                  }]

In this case, the parameter will be still added to the URI

multipart boundary supprt

I am trying to get iodocs to POST a message to my REST service that expects a "multipart/form-data" content-type. How do I persuade iodocs to put in bundaries on POST? When I snoop the message being sent I can see there are no boundaries and I get the following error on the server side:

java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: Couldn't find MIME boundary: --myboundary

My iodocs config is:

"OSSUI": {
"name": "Personal Storage",
"protocol": "http",
"baseURL": "jrbuild1srv:28080",
"publicPath": "/ossui-examples/services/rest/ossui/preferences",
"headers" : {"Content-Type": "multipart/form-data; boundary=myboundary"},
"auth": "",
"keyParam": ""
}

{
"endpoints":[
{
"name":"Save Methods",
"methods":[
{
"MethodName":"Save preferences",
"Synopsis":"This method allows you to save a string in personal storage",
"HTTPMethod":"POST",
"URI":"/set",
"RequiresOAuth":"N",
"parameters":[
{
"Name":"name",
"Required":"Y",
"Default":"Test",
"Type":"string",
"Description":"Authorized user name"
},
{
"Name":"value",
"Required":"Y",
"Default":"",
"Type":"string",
"Description":"Value to store"
}
]
}
]
},
{
"name":"Fetch Methods",
"methods":[
{
"MethodName":"Fetch preferences",
"Synopsis":"This method allows you to fetch a string from personal storage",
"HTTPMethod":"GET",
"URI":"/get",
"RequiresOAuth":"N",
"parameters":[
{
"Name":"name",
"Required":"Y",
"Default":"Test",
"Type":"string",
"Description":"Authorized user name"
}
]
}
]
}
]
}

File input support

Hi all,

Just wanted to say great job on this so far, support for file inputs would be quite helpful!

Can a user select whether or not to pass variables?

When using IODocs as an API explorer, I would like to decide whether or not to pass a variable at all. For example, if I want to have an endpoint that lists users, I would like to be able to have a querystring variable that, if present, either filters users that are active or inactive. So, the following URL's would return the following:

http://api.example.com/v1/users - return a list of all users
http://api.example.com/v1/users?active=true - return a list of active users only
http://api.example.com/v1/users?active=false - return a list of inactive users only

Is there a way to define my API in IODocs so that I can use the API to construct all three URL's (including the first one which I cannot find a way to do if I create an 'active' querystring variable).

Perhaps one UI technique would be to have an 'x' all the way right which appears on mouseover, and if you click the 'x', the box is grey'ed out.

Thanks!

NPM install issue

npm install
npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url']
npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: [email protected]
npm ERR! Required: {"node":"0.4.x","teleport":">=0.2.0"}
npm ERR! Actual: {"npm":"1.0.106","node":"0.6.5"}
npm ERR!
npm ERR! System Darwin 11.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /iodocs
npm ERR! node -v v0.6.5
npm ERR! npm -v 1.0.106
npm ERR! code ENOTSUP
npm ERR!


Should I downgrade?

Send data json encoded format

hi,
i want send tha data by post method. but i want send data in json encoded format how can i send the data.

Thanks

Introspection of REST URL

I think I/O Docs is fantastic. I was wondering if anybody has considered a REST URL introspector that would generate a barebones .json config file.
Thanks for the great work on I/O Docs!

https?

Howdy, my api is running on https, I pass this in as the protocol and nada: broken. I go into the code and as far as a I can tell you're only including 'http' with no condition on the protocol to include 'https'. I add this and it works great, but I wonder if I'm missing something as I am not a node.js expert by an means. Thanks!

config.address is not used ?

hi, imho there is a problem with the app.listen at the end of app.js : the config.address is not used !?

app.listen(port);

But if I write this :

app.listen( port , config.address );

then there is an error with the console.log :

TypeError: Cannot read property 'port' of null

( If I comment out the console.log line , the server starts well on the specified address )

Content-Length not updated between request

It seems the Content Length for requests are set to the same value between requests. This makes requests fail when sending subsequent requests with more data if the server respects the Content-Length since the input will be truncated.

Example

First request

POST / HTTP/1.1
Content-Length: 12
Content-Type: application/x-www-form-urlencoded
Host: localhost:3001
Connection: keep-alive

param=short

Second request

POST / HTTP/1.1
Content-Length: 12        <=== Still 12! Should be 14 since param is now longer
Content-Type: application/x-www-form-urlencoded
Host: localhost:3001
Connection: keep-alive

param=longer

Add support for enumerated values from a URL

Hi! I am really liking iodocs - thanks for opening it to everyone.

I like the 'enumerated' data type for lists of values - however, this list goes stale if the values are a dictionary that is constantly updated. For example, I would like to be able to provide a dictionary value as follows:

"parameters":[
  {
    "Name":"timezone",
    "Required":"Y",
    "Default":"America/New_York",
    "Type":"enumerated",
    "EnumeratedURL":"http://api.jirafe.com/timezones"
    "Description":"The time zone that this site uses for order dates"
  }
]

The URL passed in can be a list of values separated by a CR by default (the URL in my example works).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.