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

Add example key in response for json example #44

Open
singh-sukhdeep opened this issue Mar 26, 2019 · 0 comments
Open

Add example key in response for json example #44

singh-sukhdeep opened this issue Mar 26, 2019 · 0 comments

Comments

@singh-sukhdeep
Copy link

Suppose i want to add example response for code 200.Currently i am not able to do that.I have to pass model,what if i you could add example key in response which will contain json and that will interpret as it is .
Example

responses: { 200: { description: "Success", type: SwaggerDefinitionConstant.Response.Type.OBJECT, example:{ "data": [{ "type": "articles", "id": "1", "attributes": { "title": "JSON:API paints my bikeshed!", "body": "The shortest article. Ever.", "created": "2015-05-22T14:56:29.000Z", "updated": "2015-05-22T14:56:28.000Z" }, "relationships": { "author": { "data": {"id": "42", "type": "people"} } } }], "included": [ { "type": "people", "id": "42", "attributes": { "name": "John", "age": 80, "gender": "male" } } ] } } },

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

1 participant