Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-41906

Quickstarts API spec fails validation

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • Unset
    • None
    • Plat-Ex Services Sprint 45

      The OpenAPI spec for the Quickstarts API fails validation. This prevents us from fixing the current API tests because they depend on a generated client. 

      Steps to reproduce:

      pip install openapi-spec-validator openapi.json

      Failure Output:

      iqe_quickstarts/data/api.quickstarts.quickstarts.spec.json: Validation Error: {'Account': {'description': 'Account number', 'in': 'query', 'name': 'account', 'required': True, 'schema': {'type': 'string'}}, 'Application': {'description': 'If set, content is associated with a specific CRC application', 'explode': True, 'in': 'query', 'name': 'application', 'required': False, 'schema': {'type': 'string'}, 'style': 'form'}, 'Bundle': {'description': 'If set, content is associated with a specific CRC bundle', 'explode': True, 'in': 'query', 'name': 'bundle', 'required': False, 'schema': {'type': 'string'}, 'style': 'form'}, 'Content': {'description': 'If set, content is associated with a specific CRC content', 'explode': True, 'in': 'query', 'name': 'content', 'required': False, 'schema': {'type': 'string'}, 'style': 'form'}, 'Id': {'description': 'identifier', 'in': 'path', 'name': 'id', 'required': True, 'schema': {'type': 'integer'}}, 'Limit': {'description': 'Pagination limit', 'explode': True, 'in': 'query', 'name': 'limit', 'required': False, 'schema': {'type': 'integer'}, 'style': 'form'}, 'Name': {'description': 'Search content by name', 'explode': True, 'in': 'query', 'name': 'name', 'required': False, 'schema': {'type': 'string'}, 'style': 'form'}, 'Offset': {'description': 'Pagination offset', 'explode': True, 'in': 'query', 'name': 'offset', 'required': False, 'schema': {'type': 'integer'}, 'style': 'form'}, 'ProductFamilies': {'description': 'If set, content is associated with a specific CRC product families', 'explode': True, 'in': 'query', 'name': 'product-families', 'required': False, 'schema': {'type': 'string'}, 'style': 'form'}, 'TopicName': {'description': 'identifier', 'in': 'path', 'name': 'topicname', 'required': True, 'schema': {'type': 'string'}}, 'UseCase': {'description': 'If set, content is associated with a specific CRC use case', 'explode': True, 'in': 'query', 'name': 'use-case', 'required': False, 'schema': {'type': 'string'}, 'style': 'form'}} is not valid under any of the given schemasFailed validating 'oneOf' in schema['properties']['components']['properties']['schemas']['patternProperties']['^[a-zA-Z0-9\\.\\-_]+$']:
          {'oneOf': [{'$ref': '#/definitions/Schema'},
                     {'$ref': '#/definitions/Reference'}]}On instance['components']['schemas']['queryParams']:
          {'Account': {'description': 'Account number',
                       'in': 'query',
                       'name': 'account',
                       'required': True,
                       'schema': {'type': 'string'}},
           'Application': {'description': 'If set, content is associated with a '
                                          'specific CRC application',
                           'explode': True,
                           'in': 'query',
                           'name': 'application',
                           'required': False,
                           'schema': {'type': 'string'},
                           'style': 'form'},
           'Bundle': {'description': 'If set, content is associated with a '
                                     'specific CRC bundle',
                      'explode': True,
                      'in': 'query',
                      'name': 'bundle',
                      'required': False,
                      'schema': {'type': 'string'},
                      'style': 'form'},
           'Content': {'description': 'If set, content is associated with a '
                                      'specific CRC content',
                       'explode': True,
                       'in': 'query',
                       'name': 'content',
                       'required': False,
                       'schema': {'type': 'string'},
                       'style': 'form'},
           'Id': {'description': 'identifier',
                  'in': 'path',
                  'name': 'id',
                  'required': True,
                  'schema': {'type': 'integer'}},
           'Limit': {'description': 'Pagination limit',
                     'explode': True,
                     'in': 'query',
                     'name': 'limit',
                     'required': False,
                     'schema': {'type': 'integer'},
                     'style': 'form'},
           'Name': {'description': 'Search content by name',
                    'explode': True,
                    'in': 'query',
                    'name': 'name',
                    'required': False,
                    'schema': {'type': 'string'},
                    'style': 'form'},
           'Offset': {'description': 'Pagination offset',
                      'explode': True,
                      'in': 'query',
                      'name': 'offset',
                      'required': False,
                      'schema': {'type': 'integer'},
                      'style': 'form'},
           'ProductFamilies': {'description': 'If set, content is associated '
                                              'with a specific CRC product '
                                              'families',
                               'explode': True,
                               'in': 'query',
                               'name': 'product-families',
                               'required': False,
                               'schema': {'type': 'string'},
                               'style': 'form'},
           'TopicName': {'description': 'identifier',
                         'in': 'path',
                         'name': 'topicname',
                         'required': True,
                         'schema': {'type': 'string'}},
           'UseCase': {'description': 'If set, content is associated with a '
                                      'specific CRC use case',
                       'explode': True,
                       'in': 'query',
                       'name': 'use-case',
                       'required': False,
                       'schema': {'type': 'string'},
                       'style': 'form'}}
      # Probably due to this subschema error## 'Account', 'Application', 'Bundle', 'Content', 'Id', 'Limit', 'Name', 'Offset', 'ProductFamilies', 'TopicName', 'UseCase' do not match any of the regexes: '^x-'Failed validating 'additionalProperties' in schema[0]:
          {'type': 'object',
           'properties': {'title': {'type': 'string'},
                          'multipleOf': {'type': 'number',
                                         'minimum': 0,
                                         'exclusiveMinimum': True},
                          'maximum': {'type': 'number'},
                          'exclusiveMaximum': {'type': 'boolean',
                                               'default': False},
                          'minimum': {'type': 'number'},
                          'exclusiveMinimum': {'type': 'boolean',
                                               'default': False},
                          'maxLength': {'type': 'integer', 'minimum': 0},
                          'minLength': {'type': 'integer',
                                        'minimum': 0,
                                        'default': 0},
                          'pattern': {'type': 'string', 'format': 'regex'},
                          'maxItems': {'type': 'integer', 'minimum': 0},
                          'minItems': {'type': 'integer',
                                       'minimum': 0,
                                       'default': 0},
                          'uniqueItems': {'type': 'boolean', 'default': False},
                          'maxProperties': {'type': 'integer', 'minimum': 0},
                          'minProperties': {'type': 'integer',
                                            'minimum': 0,
                                            'default': 0},
                          'required': {'type': 'array',
                                       'items': {'type': 'string'},
                                       'minItems': 1,
                                       'uniqueItems': True},
                          'enum': {'type': 'array',
                                   'items': {},
                                   'minItems': 1,
                                   'uniqueItems': False},
                          'type': {'type': 'string',
                                   'enum': ['array',
                                            'boolean',
                                            'integer',
                                            'number',
                                            'object',
                                            'string']},
                          'not': {'oneOf': [{'$ref': '#/definitions/Schema'},
                                            {'$ref': '#/definitions/Reference'}]},
                          'allOf': {'type': 'array',
                                    'items': {'oneOf': [{'$ref': '#/definitions/Schema'},
                                                        {'$ref': '#/definitions/Reference'}]}},
                          'oneOf': {'type': 'array',
                                    'items': {'oneOf': [{'$ref': '#/definitions/Schema'},
                                                        {'$ref': '#/definitions/Reference'}]}},
                          'anyOf': {'type': 'array',
                                    'items': {'oneOf': [{'$ref': '#/definitions/Schema'},
                                                        {'$ref': '#/definitions/Reference'}]}},
                          'items': {'oneOf': [{'$ref': '#/definitions/Schema'},
                                              {'$ref': '#/definitions/Reference'}]},
                          'properties': {'type': 'object',
                                         'additionalProperties': {'oneOf': [{'$ref': '#/definitions/Schema'},
                                                                            {'$ref': '#/definitions/Reference'}]}},
                          'additionalProperties': {'oneOf': [{'$ref': '#/definitions/Schema'},
                                                             {'$ref': '#/definitions/Reference'},
                                                             {'type': 'boolean'}],
                                                   'default': True},
                          'description': {'type': 'string'},
                          'format': {'type': 'string'},
                          'default': {},
                          'nullable': {'type': 'boolean', 'default': False},
                          'discriminator': {'$ref': '#/definitions/Discriminator'},
                          'readOnly': {'type': 'boolean', 'default': False},
                          'writeOnly': {'type': 'boolean', 'default': False},
                          'example': {},
                          'externalDocs': {'$ref': '#/definitions/ExternalDocumentation'},
                          'deprecated': {'type': 'boolean', 'default': False},
                          'xml': {'$ref': '#/definitions/XML'}},
           'patternProperties': {'^x-': {}},
           'additionalProperties': False}On instance:
          {'Account': {'description': 'Account number',
                       'in': 'query',
                       'name': 'account',
                       'required': True,
                       'schema': {'type': 'string'}},
           'Application': {'description': 'If set, content is associated with a '
                                          'specific CRC application',
                           'explode': True,
                           'in': 'query',
                           'name': 'application',
                           'required': False,
                           'schema': {'type': 'string'},
                           'style': 'form'},
           'Bundle': {'description': 'If set, content is associated with a '
                                     'specific CRC bundle',
                      'explode': True,
                      'in': 'query',
                      'name': 'bundle',
                      'required': False,
                      'schema': {'type': 'string'},
                      'style': 'form'},
           'Content': {'description': 'If set, content is associated with a '
                                      'specific CRC content',
                       'explode': True,
                       'in': 'query',
                       'name': 'content',
                       'required': False,
                       'schema': {'type': 'string'},
                       'style': 'form'},
           'Id': {'description': 'identifier',
                  'in': 'path',
                  'name': 'id',
                  'required': True,
                  'schema': {'type': 'integer'}},
           'Limit': {'description': 'Pagination limit',
                     'explode': True,
                     'in': 'query',
                     'name': 'limit',
                     'required': False,
                     'schema': {'type': 'integer'},
                     'style': 'form'},
           'Name': {'description': 'Search content by name',
                    'explode': True,
                    'in': 'query',
                    'name': 'name',
                    'required': False,
                    'schema': {'type': 'string'},
                    'style': 'form'},
           'Offset': {'description': 'Pagination offset',
                      'explode': True,
                      'in': 'query',
                      'name': 'offset',
                      'required': False,
                      'schema': {'type': 'integer'},
                      'style': 'form'},
           'ProductFamilies': {'description': 'If set, content is associated '
                                              'with a specific CRC product '
                                              'families',
                               'explode': True,
                               'in': 'query',
                               'name': 'product-families',
                               'required': False,
                               'schema': {'type': 'string'},
                               'style': 'form'},
           'TopicName': {'description': 'identifier',
                         'in': 'path',
                         'name': 'topicname',
                         'required': True,
                         'schema': {'type': 'string'}},
           'UseCase': {'description': 'If set, content is associated with a '
                                      'specific CRC use case',
                       'explode': True,
                       'in': 'query',
                       'name': 'use-case',
                       'required': False,
                       'schema': {'type': 'string'},
                       'style': 'form'}}(1 more subschemas errors, use --errors=all to see them.)
       

       

              mmarosi123 Martin Marosi
              btweed@redhat.com Brandon Tweed
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: