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

None is not a valid swagger2.0 file: module 'jsonschema._validators' has no attribute #23

Closed
bukowa opened this issue Jan 1, 2020 · 1 comment

Comments

@bukowa
Copy link

bukowa commented Jan 1, 2020

None is not a valid swagger2.0 file: module 'jsonschema._validators' has no attribute 'properties_draft4'

        If you get schema validation errors from a yaml Swagger spec that passes validation on other
        validators, it may be because of single apostrophe's (') used in some descriptions. The
        parser used does not like it at all.

Using this file: https://raw.githubusercontent.com/watchdogpolska/small_eod/master/docs/swagger.yaml

@bukowa
Copy link
Author

bukowa commented Jan 1, 2020

The solution was upgrading swagger-spec-validator to latest version 2.4.3.
Now there's another problem:

/app/local/d.json is not a valid swagger2.0 file: ('\'components\', \'openapi\' do not match any of the regexes: \'^x-\'\n\nFailed validating \'additionalProperties\' in schema:\n    {\'$schema\': \'http://json-schema.org/draft-04/schema#\',\n     \'additionalProperties\': False,\n     \'definitions\': {\'apiKeySecurity\': {\'additionalProperties\': False,\n                                        \'patternProperties\': {\'^x-\': {\'$ref\': \'#/definitions/vendorExtension\'}},\n                                        \'properties\': {\'description\': {\'type\': \'string\'},\n                                                       \'in\': {\'enum\': [\'header\',\n                                                                       \'query\'],\n                                                              \'type\': \'string\'},\n                                                       \'name\': {\'type\': \'string\'},\n                                                       \'type\': {\'enum\': [\'apiKey\'],\n                                                                \'type\': \'string\'}},\n                                        \'required\': [\'type\', \'name\', \'in\'],\n                                        \'type\': \'object\'},\n                     \'basicAuthenticationSecurity\': {\'additionalProperties\': False,\n                                                     \'patternProperties\': {\'^x-\': {\'$ref\': \'#/definitions/vendorExtension\'}},\n                                                     \'properties\': {\'description\': {\'type\': \'string\'},\n                                                                    \'type\': {\'enum\': [\'basic\'],\n                                                                             \'type\': \'string\'}},\n                                                     \'required\': [\'type\'],\n                                                     \'type\': \'object\'},\n                     \'bodyParameter\': {\'additionalProperties\': False,\n                                       \'patternProperties\': {\'^x-\': {\'$ref\': \'#/definitions/vendorExtension\'}},\n                                       \'properties\': {\'description\': {\'description\': \'A \'\n                                                                                     \'brief \'\n                                                                                     \'description \'\n                                                                                     \'of \'\n                                                                                     \'the \'\n                                                                                     \'parameter. \'\n                                                                                     \'This \'\n                                                                                     \'could \'\n                                                                                     \'contain \'\n                                                                                     \'examples \'\n                                                                                     \'of \'\n                                                                                     \'use.  \'\n                                                                                     \'GitHub \'\n                                                                                     \'Flavored \'\n                                                                                     \'Markdown \'\n                                                                                     \'is \'\n                                                                                     \'allowed.\',\n                                                                      \'type\': \'string\'},\n                                                      \'in\': {\'description\': \'Determines \'\n                                                                            \'the \'\n                                                                            \'location \'\n                                                                            \'of \'\n                                                                            \'the \'\n                                                                            \'parameter.\',\n                                                             \'enum\': [\'body\'],\n                                                             \'type\': \'string\'},\n                                                      \'name\': {\'description\': \'The \'\n                                                                              \'name \'\n                                                                              \'of \'\n                                                                              \'the \'\n                                                                              \'parameter.\',\n                                                               \'type\': \'string\'},\n                                                      \'required\': {\'default\': False,\n                                                                   \'description\': \'Determines \'\n                                                                                  \'whether \'\n                                                                                  \'or \'\n                                                                                  \'not \'\n                                                                                  \'this \'\n                                                                                  \'parameter \'\n                                                                                  \'is \'\n                                                                                  \'required \'\n                                                                                  \'or \'\n                                                                                  \'optional.\',\n                                                                   \'type\': \'boolean\'},\n                                                      \'schema\': {\'$ref\': \'#/definitions/schema\'}},\n                                       \'required\': [\'name\', \'in\', \'schema\'],\n                                       \'type\': \'object\'},\n                     \'collectionFormat\': {\'default\': \'csv\',\n                                          \'enum\': [\'csv\',\n                                                   \'ssv\',\n                                                   \'tsv\',\n                                                   \'pipes\'],\n                                          \'type\': \'string\'},\n                     \'collectionFormatWithMulti\': {\'default\': \'csv\',\n                                                   \'enum\': [\'csv\',\n                                                            \'ssv\',\n                                                            \'tsv\',\n                                                            \'pipes\',\n                                                            \'multi\'],\n                                                   \'type\': \'string\'},\n                     \'contact\': {\'additionalProperties\': False,\n                                 \'description\': \'Contact information for \'\n                                                \'the owners of the API.\',\n                                 \'patternProperties\': {\'^x-\': {\'$ref\': \'#/definitions/vendorExtension\'}},\n                                 \'properties\': {\'email\': {\'description\': \'The \'\n                                                                         \'email \'\n                                                                         \'address \'\n                                                                         \'of \'\n                                                                         \'the \'\n                                                                         \'contact \'\n                                                                         \'person/organization.\',\n                                                          \'format\': \'email\',\n                                                          \'type\': \'string\'},\n                                                \'name\': {\'description\': \'The \'\n                                                                        \'identifying \'\n                                                                        \'name \'\n                                                                        \'of \'\n                                                                        \'the \'\n                                                              

@bukowa bukowa closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
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