Skip to content

Conversation

@jeremy-carbonne
Copy link
Contributor

This PR allow to use schema of type object, array, number and string (file not supported)

https://swagger.io/docs/specification/2-0/describing-responses/

The schema keyword is used to describe the response body. A schema can define:
object or array – typically used with JSON and XML APIs,
a primitive such as a number or string – used for plain text responses,
file (see below).

related #2

schema": {
   "type": "string",
    "format": "url"
},

The previous code was trying to make a `JSON.parse` on a string
@jeremy-carbonne jeremy-carbonne changed the title fixed an error when schema was type string fixed an error when the schema type is string May 23, 2018
@Place1
Copy link
Owner

Place1 commented May 24, 2018

@jeremy-carbonne thanks for the contribution! i've just added a few minor changes on top of your fix. If you're happy with it then i'm keen to merge this in.

@jeremy-carbonne
Copy link
Contributor Author

I tested with the last changes, it works.
You can merge 👍

@Place1 Place1 merged commit bca9722 into Place1:master May 24, 2018
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

Successfully merging this pull request may close these issues.

2 participants