Skip to content

Support object schemas in responses #162

Closed
@pawamoy

Description

@pawamoy

I am not sure what is happening here, so opening this as a question.

I have this response defined in my spec file:

      responses:
        '200':
          description: Some description
          content:
            application/json:
              schema:
                type: object
                properties:
                  Message:
                    description: Success message or informations in case of failure
                    type: string
                  Status:
                    description: Indicates if the insertion was a success or a failure
                    type: string

It gives me the following warning when generating a client (I removed all the None fields and indented properly):

ERROR parsing POST /api/v1/my-api/versions/{versionID}/reference-file within default. Endpoint will not be generated.
cannot parse response of endpoint my_endpoint
Response(
  description='Some description',
  content={
    'application/json': MediaType(
      media_type_schema=Schema(
        type='object',
        properties={
          'Message': Schema(
            type='string', 
            description='Success message or informations in case of failure'
          ),
          'Status': Schema(
            type='string',
            description='Indicates if the insertion was a success or a failure'
          )
        }
      )
    )
  }
)

Do you have an idea why this cannot be parsed or transformed as code? What am I doing wrong in my spec 🙂 ?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions