v1/discovery not swagger compliant?

8 views
Skip to first unread message

pohigaf

unread,
Mar 6, 2024, 10:34:47 AM3/6/24
to quay-sig
/api/v1/discovery returns something like:

...
/api/v1/superuser/{build_uuid}/status:
    x-name: endpoints.api.superuser.SuperUserRepositoryBuildStatus
    x-path: /api/v1/superuser/{build_uuid}/status
    x-tag: superuser
    parameters:
      - name: build_uuid
        in: path
        required: true
        description: The UUID of the build
        type: string
      - name: repository
        in: path
        required: true
        description: The full path of the repository. e.g. namespace/name
        type: string
...

https://editor.swagger.io/ complains about multiple items. The one related to the above excerpt is:
Semantic error at paths./api/v1/superuser/{build_uuid}/status.parameters.1.name
Path parameter "repository" must have the corresponding {repository} segment in the "/api/v1/superuser/{build_uuid}/status" path

Is that a local misconfiguration or expected bevhaviour?

pohigaf

unread,
Mar 7, 2024, 2:31:00 AM3/7/24
to quay-sig
Also prance emits errors:

prance compile discovery.json

Processing "discovery.json"...
 -> Resolving external references.
ERROR in "discovery.json" [ValidationError]: ("{'name': 'body', 'in': 'body', 'required': True, 'description': 'Request body contents.', 'schema': {'id': 'CreateMessage', 'type': 'object', 'description': 'Create a new message', 'properties': {'message': {'type': 'object', 'description': 'A single message', 'required': ['content', 'media_type', 'severity'], 'properties': {'content': {'type': 'string', 'description': 'The actual message'}, 'media_type': {'type': 'string', 'description': 'The media type of the message', 'enum': ['text/plain', 'text/markdown']}, 'severity': {'type': 'string', 'description': 'The severity of the message', 'enum': ['info', 'warning', 'error']}}}}}} is not valid under any of the given schemas", 'oneOf', deque(['paths', '/api/v1/messages', 'post', 'parameters', 0]), None, [<ValidationError: "{'name': 'body', 'in': 'body', 'required': True, 'description': 'Request body contents.', 'schema': {'id': 'CreateMessage', 'type': 'object', 'description': 'Create a new message', 'properties': {'message': {'type': 'object', 'description': 'A single message', 'required': ['content', 'media_type', 'severity'], 'properties': {'content': {'type': 'string', 'description': 'The actual message'}, 'media_type': {'type': 'string', 'description': 'The media type of the message', 'enum': ['text/plain', 'text/markdown']}, 'severity': {'type': 'string', 'description': 'The severity of the message', 'enum': ['info', 'warning', 'error']}}}}}} is not valid under any of the given schemas">, <ValidationError: "'$ref' is a required property">, <ValidationError: "Additional properties are not allowed ('description', 'in', 'name', 'required', 'schema' were unexpected)">], [{'$ref': '#/definitions/parameter'}, {'$ref': '#/definitions/jsonReference'}], {'name': 'body', 'in': 'body', 'required': True, 'description': 'Request body contents.', 'schema': {'id': 'CreateMessage', 'type': 'object', 'description': 'Create a new message', 'properties': {'message': {'type': 'object', 'description': 'A single message', 'required': ['content', 'media_type', 'severity'], 'properties': {'content': {'type': 'string', 'description': 'The actual message'}, 'media_type': {'type': 'string', 'description': 'The media type of the message', 'enum': ['text/plain', 'text/markdown']}, 'severity': {'type': 'string', 'description': 'The severity of the message', 'enum': ['info', 'warning', 'error']}}}}}}, {'oneOf': [{'$ref': '#/definitions/parameter'}, {'$ref': '#/definitions/jsonReference'}]}, deque(['properties', 'paths', 'patternProperties', '^/', 'properties', 'post', 'properties', 'parameters', 'items', 'oneOf']), None)
Reply all
Reply to author
Forward
0 new messages