Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELETE service returning 204 breaks ioDocs #209

Open
sanderhouttekier opened this issue Sep 26, 2014 · 3 comments
Open

DELETE service returning 204 breaks ioDocs #209

sanderhouttekier opened this issue Sep 26, 2014 · 3 comments

Comments

@sanderhouttekier
Copy link

when using a rest API, which returns status 204 no content after a succesful DELETE statement. The javascript of ioDoc fails as it is trying to get result.signin while result itself is undefined.

the node library node-restful is one that gives us this behavior at the moment:
https://github.com/baugarten/node-restful

error in the frontend of ioDoc after calling one of the above delete statements:

Uncaught TypeError: Cannot read property 'signin' of undefined docs.js:273

I might take a deeper look into the code later this weekend and hopefully come up with some sort of a solution. not sure if i'm ready to fork and make a pull request but i'm definately going to try :)

@DavidBiesack
Copy link

I see the same thing; the UI shows pink and does not show the 204 HTTP status code

io docs delete 204

stdout log (with debug option on) shows

in processRequest
{ httpMethod: 'delete',
  oauth: '',
  methodUri: '/microUrls/{mId}',
  accessToken: '',
  json: '{"mId":"1i8av34q4a4un"}',
  locations: '{"mId":"path","MicroUrl":"body","MicroUrls":"body"}',
  values: [ '1i8av34q4a4un' ],
  apiKey: '',
  apiSecret: '',
  apiName: 'microurl' }
json:  { mId: '1i8av34q4a4un' }
locations:  { mId: 'path', MicroUrl: 'body', MicroUrls: 'body' }
Unsecured Call
{ headers: {},
  host: 'djb.na.sas.com',
  port: '',
  method: 'delete',
  path: '/mu/rest/microUrls/1i8av34q4a4un' }
Protocol: HTTP
HEADERS: {"server":"Apache-Coyote/1.1","date":"Wed, 08 Oct 2014 14:27:22 GMT"}
STATUS CODE: 204
10.23.16.105 - - [Wed, 08 Oct 2014 14:27:22 GMT] "POST /processReq HTTP/1.1" 204 - "http://djb.na.sas.com:3000/microurl" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"

@phairow
Copy link
Contributor

phairow commented Oct 8, 2014

looks like we need to change 'public/javascripts/docs.js' lines: 160, 166, 273

from:
if (result.signin) {
to:
if (result && result.signin) {

@chouchou900822
Copy link

I try it (result && result.signin), still not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants