webapi icon indicating copy to clipboard operation
webapi copied to clipboard

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

Open kahlil29 opened this issue 5 years ago • 1 comments

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 avatar Apr 01 '19 13:04 kahlil29

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 avatar Apr 04 '19 18:04 kahlil29