openapi-spec-validator icon indicating copy to clipboard operation
openapi-spec-validator copied to clipboard

Failed validating 'oneOf'

Open spaceone opened this issue 6 years ago • 1 comments

Hello, I don't understand the following validation error:

{'{$response.header.Location}': {'get': {'requestBody': {}, 'responses': {'301': {'x-scope': ['', '#/components/callbacks/moveProgress'], '$ref': '#/components/responses/MoveProgress'}, '303': {'x-scope': ['', '#/components/callbacks/moveProgress'], '$ref': '#/components/responses/MoveSuccess'}}}}} is not valid under any of the given schemas

Failed validating 'oneOf' in schema['properties']['paths']['patternProperties']['^/']['properties']['put']['properties']['callbacks']['additionalProperties']:
    {'oneOf': [{'$ref': '#/definitions/callback'},
               {'$ref': '#/definitions/reference'}]}

On instance['paths']['/users/user/{dn}']['put']['callbacks']['move-progress']:
    {'{$response.header.Location}': {'get': {'requestBody': {},
                                             'responses': {'301': {'$ref': '#/components/responses/MoveProgress',
                                                                   'x-scope': ['',
                                                                               '#/components/callbacks/moveProgress']},
                                                           '303': {'$ref': '#/components/responses/MoveSuccess',
                                                                   'x-scope': ['',
                                                                               '#/components/callbacks/moveProgress']}}}}}

The x-scope was not added by myself. I don't have any oneOf defined. Maybe someone can point me to the error?

spaceone avatar Sep 04 '19 15:09 spaceone

Adding "content": {} to requestBody helped.

spaceone avatar Sep 04 '19 17:09 spaceone