Skip to content

Commit

Permalink
Add default content type for request and response (#48)
Browse files Browse the repository at this point in the history
We don't specify what we produce at all ('application/json') or what we
consume at a root level. This allows us to have this specified for our
entire API.

I came across this when testing an OpenAPI mock server that takes an
OpenAPI spec and starts a mock server. When using it, it would never
correctly return anything because it didn't know what to produce.
With this commit, it will now return mock responses.

Signed-off-by: J.R. Garcia <[email protected]>
  • Loading branch information
J.R. Garcia authored and sreeshas committed Jul 30, 2019
1 parent 386c2aa commit 047a6f4
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 @@ -751,6 +751,8 @@ def process_output(path_dict, type_dict, output_dir, output_filename):
'basic_auth': {'type': 'basic'},
'api_key': {'type': 'apiKey', 'name': 'vmware-api-session-id', 'in': 'header'}},
"security": [{"api_key": []}],
'consumes': ['application/json'],
'produces': ['application/json'],
'basePath': '/rest', 'tags': [],
'schemes': ['https', 'http'],
'paths': collections.OrderedDict(sorted(path_dict.items())),
Expand Down

0 comments on commit 047a6f4

Please sign in to comment.