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

Webapi-Swagger : Ensure generation of (Referenced) Response types correctly #28

Open
kahlil29 opened this issue Apr 1, 2019 · 1 comment
Assignees
Labels
Webapi-Swagger All issues related to Webapi-swagger (generation of Webapi contracts from Swagger Docs)

Comments

@kahlil29
Copy link
Contributor

kahlil29 commented Apr 1, 2019

As per the Swagger 2.0 spec,
Responses (Reusing Responses sub-section)

can be defined as Inline (already currently handled) or Referenced.
If Referenced, they can be referencing either defined types in Definitions or (Global) Responses section.
We need to make sure the latter is also handled properly and that if any response headers are defined , their types are generated and the Contract reflects the same.

@kahlil29 kahlil29 self-assigned this Apr 1, 2019
@kahlil29 kahlil29 added the Webapi-Swagger All issues related to Webapi-swagger (generation of Webapi contracts from Swagger Docs) label Apr 1, 2019
@kahlil29
Copy link
Contributor Author

kahlil29 commented Apr 4, 2019

The code to be implemented for this ticket to be closed would be :
A : Read the global Response section and generate types in the Types.GlobalDefinitions.ResponseDefinitions module.

B : When any response (in a path/operation) is a referenced response, we need to check if it's in the global Response or Definition list and accordingly set the level info so that the type generated in the Contract has the correct qualification.

kahlil29 added a commit that referenced this issue Apr 4, 2019
- Also abstract parsing of inline schema into a common function that can be reused by the global schema parsers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Webapi-Swagger All issues related to Webapi-swagger (generation of Webapi contracts from Swagger Docs)
Projects
None yet
Development

No branches or pull requests

1 participant