Skip to content

Repsonse generate should handle responses of type objects #125

Closed

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.

Activity

  1. added this to the 0.7.0 milestone on Aug 18, 2020
  2. dbanty commented on Sep 26, 2020

    @dbanty
    Collaborator

    I believe the combination of #124 and #162 will together solve this issue, so I'm going to close this in an attempt to deduplicate some issues. If there's something more at play here that I'm missing, please reopen and let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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