Merge pull request #13 from pbasista/bugfix/default-values

Use appropriate default values for OpenAPI object fields
This commit is contained in:
A 2018-02-28 15:02:59 +00:00 committed by GitHub
commit 3cc1101288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -24,10 +24,10 @@ class ComponentsFactory(object):
def create(self, components_spec):
components_deref = self.dereferencer.dereference(components_spec)
schemas_spec = components_deref.get('schemas', [])
responses_spec = components_deref.get('responses', [])
parameters_spec = components_deref.get('parameters', [])
request_bodies_spec = components_deref.get('request_bodies', [])
schemas_spec = components_deref.get('schemas', {})
responses_spec = components_deref.get('responses', {})
parameters_spec = components_deref.get('parameters', {})
request_bodies_spec = components_deref.get('request_bodies', {})
schemas = self.schemas_generator.generate(schemas_spec)
responses = self._generate_response(responses_spec)

View file

@ -77,10 +77,10 @@ class SpecFactory(object):
spec_dict_deref = self.dereferencer.dereference(spec_dict)
info_spec = spec_dict_deref.get('info', [])
info_spec = spec_dict_deref.get('info', {})
servers_spec = spec_dict_deref.get('servers', [])
paths = spec_dict_deref.get('paths', [])
components_spec = spec_dict_deref.get('components', [])
paths = spec_dict_deref.get('paths', {})
components_spec = spec_dict_deref.get('components', {})
info = self.info_factory.create(info_spec)
servers = self.servers_generator.generate(servers_spec)