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

Exception "TypeError: 'NoneType' object is not iterable" if type with allOf does not has any additional properties #8

Open
turtletramp opened this issue Oct 15, 2018 · 0 comments

Comments

@turtletramp
Copy link

When using a type that derives from a base type that does not have any additional properties compared to the base type an exception happens.
Swagger definition that can trigger the issue (where OrderLineBase is of course a valid type):

    "OrderLineModify": {
      "allOf": [
        {
          "$ref": "#/definitions/OrderLineBase"
        },
        {
          "type": "object",
          "additionalProperties": false
        }
      ]

This is the exception

Traceback (most recent call last):
  File "/usr/local/bin/swg2rst", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/swg2rst/swagger2rst.py", line 51, in main
    swagger_doc = doc_module.SwaggerObject(doc, examples=examples)
  File "/usr/local/lib/python3.6/site-packages/swg2rst/swagger/base_swagger_object.py", line 71, in __init__
    self._fill_schemas_from_definitions(obj)
  File "/usr/local/lib/python3.6/site-packages/swg2rst/swagger/base_swagger_object.py", line 125, in _fill_schemas_from_definitions
    definition, name, SchemaTypes.DEFINITION, root=self)
  File "/usr/local/lib/python3.6/site-packages/swg2rst/swagger/schema_objects.py", line 28, in create_schema
    schema = Schema(obj, schema_type, storage=cls, name=name, root=root)
  File "/usr/local/lib/python3.6/site-packages/swg2rst/swagger/schema.py", line 52, in __init__
    self._parse_all_of_property(obj)
  File "/usr/local/lib/python3.6/site-packages/swg2rst/swagger/schema.py", line 114, in _parse_all_of_property
    schema if schema else self.storage.get(_id)
  File "/usr/local/lib/python3.6/site-packages/swg2rst/swagger/schema_objects.py", line 90, in merge_schemas
    for _prop in _schema.properties:
TypeError: 'NoneType' object is not iterable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant