Skip to content

Commit

Permalink
Change 'opaque' response type to 'object' (#52)
Browse files Browse the repository at this point in the history
An API response that returned an 'opaque' had caused some issues as that
is not a response type understood by the Swagger v2 spec. This now
responds with an "object" type in place of "opaque".

It isn't entirely accurate as the opaque type could return any type, but
the Swagger v2+ spec does not allow this. See
[here](OAI/OpenAPI-Specification#270)
for more information on this. The ability to have multiple response
types for a single response code has been added as a feature in
OpenAPI v3+, but this currently uses the Swagger v2 specification.

Signed-off-by: J.R. Garcia <[email protected]>
  • Loading branch information
J.R. Garcia authored and sreeshas committed Jan 27, 2020
1 parent 047a6f4 commit 512bb8b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vmsgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ def metamodel_to_swagger_type_converter(input_type):
return 'string', 'password'
if input_type == 'any_error':
return 'string', None
if input_type == 'opaque':
return 'object', None
if input_type == 'dynamic_structure':
return 'object', None
if input_type == 'uri':
Expand Down

0 comments on commit 512bb8b

Please sign in to comment.