Skip to content

Repsonse generate should handle responses of type objects #125

@bladecoates

Description

@bladecoates

Describe the bug
If I fix the function to allow int or string for the status code (related #124 ) and my response schema type is object. Responses will not generate even if the status code is a valid status code of 200

Expected behavior
If response is an object, it the response code should generate to reference the mode of the object to validate the data in the response.

OpenAPI Spec File

      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LinkResponse"
        default:
          description: Unknown error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

    LinkResponse:
      type: object
      description: The response f
      properties:
        data:
          type: object
          description: The container object for a
          properties:
            account-id:
              type: string
              format: uuid
              description: unique identifier for the account
            provider-id:
              type: string
              description: provider id.

    Error:
      type: object
      properties:
        code:
          type: integer
          description: An HTTP status code
          example: 500
        message:
          type: string
          description: A message describing why the error was thrown.
          example: The server has exploded.

Desktop (please complete the following information):

  • OS: [e.g. macOS 10.15.1]
  • Python Version: [e.g. 3.8.0]
  • openapi-python-client version [e.g. 0.1.0]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions