Skip to content

Repsonse generate should handle responses of type objects #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bladecoates opened this issue Aug 4, 2020 · 1 comment
Closed

Repsonse generate should handle responses of type objects #125

bladecoates opened this issue Aug 4, 2020 · 1 comment
Labels
🐞bug Something isn't working
Milestone

Comments

@bladecoates
Copy link

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.

@bladecoates bladecoates added the 🐞bug Something isn't working label Aug 4, 2020
@dbanty dbanty added this to the 0.7.0 milestone Aug 18, 2020
@dbanty
Copy link
Collaborator

dbanty commented Sep 26, 2020

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.

@dbanty dbanty closed this as completed Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants