Contributions
Re: Required list has not defined properties: ['type']
hugomario yes, this is the file: https://github.com/opentripmodel/opentripmodel/blob/master/api/swagger.yaml It turned out the file has errors which are not detected by a lot of validators. I found an OpenAPI validator from IBM which does see them and gives line numbers to fix them: https://github.com/IBM/openapi-validator2.9KViews0likes2CommentsRequired list has not defined properties: ['type']
Hi, Generating a python-flask server stub for OpenTripModel (using OAS 3) works but when trying to run the server gives the following error: Traceback (most recent call last): File "c:\python37\Lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\python37\Lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Julian\Downloads\server\openapi_server\__main__.py", line 18, in <module> main() File "C:\Users\Julian\Downloads\server\openapi_server\__main__.py", line 13, in main pythonic_params=True) File "C:\Users\Julian\.virtualenvs\server-Cq-s3KBS\lib\site-packages\connexion\apps\flask_app.py", line 54, in add_api api = super(FlaskApp, self).add_api(specification, **kwargs) File "C:\Users\Julian\.virtualenvs\server-Cq-s3KBS\lib\site-packages\connexion\apps\abstract.py", line 155, in add_api options=api_options.as_dict()) File "C:\Users\Julian\.virtualenvs\server-Cq-s3KBS\lib\site-packages\connexion\apis\abstract.py", line 73, in __init__ self.specification = Specification.load(specification, arguments=arguments) File "C:\Users\Julian\.virtualenvs\server-Cq-s3KBS\lib\site-packages\connexion\spec.py", line 151, in load return cls.from_file(spec, arguments=arguments) File "C:\Users\Julian\.virtualenvs\server-Cq-s3KBS\lib\site-packages\connexion\spec.py", line 108, in from_file return cls.from_dict(spec) File "C:\Users\Julian\.virtualenvs\server-Cq-s3KBS\lib\site-packages\connexion\spec.py", line 146, in from_dict return OpenAPISpecification(spec) File "C:\Users\Julian\.virtualenvs\server-Cq-s3KBS\lib\site-packages\connexion\spec.py", line 39, in __init__ self._validate_spec(raw_spec) File "C:\Users\Julian\.virtualenvs\server-Cq-s3KBS\lib\site-packages\connexion\spec.py", line 232, in _validate_spec raise InvalidSpecification.create_from(e) connexion.exceptions.InvalidSpecification: Required list has not defined properties: ['type'] There is no indication to where this error occurs in the swagger.yaml file so I have no idea how to fix this. Swagger Editor and SwaggerHub both say the spec is valid, however running openapi-spec-validator returns the same error regarding Required list has not defined properties: ['type'], but does not give a location for that error either. Is there any way to find this out?2.9KViews0likes4Comments