Skip to content

Failed validating 'oneOf' in schema #113

Closed
@manchenkoff

Description

@manchenkoff

Hi, after updating to the latest release I had a strange error with schemas.

Swagger example

/couriers/{courierIdentifier}:
        get:
            description: 'description text'
            tags:
                - Couriers
            parameters:
                -   $ref: '#/components/parameters/courierIdentifierInPath'
            responses:
                200:
                    description: 'successful response'
                    content:
                        application/json:
                            schema:
                                $ref: 'definitions/couriers/get.yml#/responses/GetResponse'
                400:
                    $ref: '#/components/responses/CommonSuccessfulResponse'
                500:
                    $ref: '#/components/responses/CommonSuccessfulResponse'

Validation error

{'description': 'successful response', 'content': {'application/json': {'schema': {'$ref': 'definitions/couriers/get.yml#/responses/GetResponse', 'x-scope': ['file:///data/swagger.yml']}}}} is not valid under any of the given schemas

Failed validating 'oneOf' in schema['properties']['paths']['patternProperties']['^\\/']['patternProperties']['^(get|put|post|delete|options|head|patch|trace)$']['properties']['responses']['patternProperties']['^[1-5](?:\\d{2}|XX)$']:
    {'oneOf': [{'$ref': '#/definitions/Response'},
               {'$ref': '#/definitions/Reference'}]}

On instance['paths']['/couriers/{courierIdentifier}']['get']['responses']['200']:
    {'content': {'application/json': {'schema': {'$ref': 'definitions/couriers/get.yml#/responses/GetResponse',
                                                 'x-scope': ['file:///data/swagger.yml']}}},
     'description': 'successful response'}

But if I remove $ref parameter in schema description or change it to type: string it works fine.

Do you know any solutions? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions