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

[develop 2.0] support inline schemas #189

Closed
fehguy opened this issue Dec 29, 2014 · 12 comments
Closed

[develop 2.0] support inline schemas #189

fehguy opened this issue Dec 29, 2014 · 12 comments
Milestone

Comments

@fehguy
Copy link
Contributor

fehguy commented Dec 29, 2014

It's legal to support schemas directly in-line, which is not currently supported in the js client.

@calfzhou
Copy link

calfzhou commented Feb 3, 2015

Does responses support inline schemas? I'm using swagger-ui v2.1-M1, inline schema inside responses cannot be shown correctly.


My swagger json code:
image

But the schema is not shown in swagger ui.

@fehguy
Copy link
Contributor Author

fehguy commented Feb 3, 2015

This is planned for 2.1-M2, which is in development. Currently it is not supported in 2.1-M1

@calfzhou
Copy link

calfzhou commented Feb 3, 2015

That would be great! Thanks!

@hamx0r
Copy link
Contributor

hamx0r commented Mar 13, 2015

FYI this is visible in the petstore example:
http://petstore.swagger.io/#!/user/loginUser

Per the respective JSON, we should be seeing a "200" response defined in addition to the (visible) "400" response:

"responses":{  
               "200":{  
                  "description":"successful operation",
                  "schema":{  
                     "type":"string"
                  },
                  "headers":{  
                     "X-Rate-Limit":{  
                        "type":"integer",
                        "format":"int32",
                        "description":"calls per hour allowed by the user"
                     },
                     "X-Expires-After":{  
                        "type":"string",
                        "format":"date-time",
                        "description":"date in UTC when toekn expires"
                     }
                  }
               },
               "400":{  
                  "description":"Invalid username/password supplied"
               }

image

@webron
Copy link
Contributor

webron commented Mar 13, 2015

@hamx0r - that's actually something different. You can see the 200 response at top, just below the path of the operation.

@hamx0r
Copy link
Contributor

hamx0r commented Mar 13, 2015

@webron - I see that. I assumed the Response Messages section contained an exhaustive list of response types per the "responses" section of the swagger spec for the operation. Is it expected behavior to split up the location where response types are presented on Swagger UI? I'd expect the "200" "description" (successful operation) to show up somewhere.

Also, the Response Content Type dropdown isn't clear to me - it appears to be an input for selecting how the server responds, but there's nothing in the swagger spec I see to control response content type. Perhaps these issues will be addressed in 2.1-M2.

@webron
Copy link
Contributor

webron commented Mar 13, 2015

Regarding the display - swagger-api/swagger-ui#674.

Regarding the response content type drop down, that's what the produces is for.

@whitlockjc
Copy link
Contributor

This has been fixed in recent commits.

@hamx0r
Copy link
Contributor

hamx0r commented Mar 26, 2015

Question: If i'm using Swagger UI (master) and would like to update it's
underlying swagger-js with a swagger-js develop_2.0 branch, what files
ought I to replace? I assumed just replace the UI's
dist/lib/swagger-client.js (or swagger-client.min.js) with files from from:
https://github.com/swagger-api/swagger-js/tree/develop_2.0/browser.

Doing so throws a JS error, so i'm likely doing something wrong. It looks
like most fixes in Swagger UI are from Swagger JS fixes, so I'd like to
know how to stay on the bleeding edge most effectively.

On Wed, Mar 25, 2015 at 10:27 PM, Jeremy Whitlock notifications@github.com
wrote:

This has been fixed in recent commits.

Reply to this email directly or view it on GitHub
#189 (comment)
.

@whitlockjc
Copy link
Contributor

The build process for swagger-ui has changed recently. It use to be as simple as replacing a JavaScript library but now I will need to defer to @mohsen1 for this one.

@mohsen1
Copy link
Contributor

mohsen1 commented Mar 26, 2015

if you use the develop_2.0 branch it's using npm to fetch directly from current SwaggerJS#develop_2.0.

@hamx0r
Copy link
Contributor

hamx0r commented Mar 26, 2015

Thanks - i'd checked the timestamps of recent checkins, and swagger-ui looked about 10 hrs behind swagger-js, so i wouldn't have guessed.

All the same, i'm seeing the same JS error when using what's pulled from swagger-ui develop_2.0:
swagger-ui.js:1670 Uncaught TypeError: Cannot read property 'replace' of undefined

image

bug report opened #322

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

No branches or pull requests

6 participants