Skip to content

Allow boolean values in enum #785

Description

@harrystuart

Describe the bug

Error(s) encountered while generating, client was not created

Failed to parse OpenAPI document

4 validation errors for OpenAPI
components -> schemas -> ErrorResponse -> $ref
  field required (type=value_error.missing)
components -> schemas -> ErrorResponse -> properties -> error -> $ref
  field required (type=value_error.missing)
components -> schemas -> ErrorResponse -> properties -> error -> enum -> 0
  value is not a valid integer (type=type_error.integer)
components -> schemas -> ErrorResponse -> properties -> error -> enum -> 0
  str type expected (type=type_error.str)

To Reproduce
Steps to reproduce the behavior:
openapi-python-client generate --url https://topaz.grv.org.au/docs/swagger.json

Expected behavior
API Client generation.

OpenAPI Spec File
A link to your openapi.json which produces this issue.
I tried converting this to OpenAPI3.0 with the same issue.

Desktop (please complete the following information):

  • OS: Windows 11
  • Python Version: 3.11
  • openapi-python-client version 0.15.0

Additional context
Is this an issue with the spec file?

Activity

  1. dbanty commented on Aug 12, 2023

    @dbanty
    Collaborator

    Looks like the thing it's mad about is using enum with boolean for ErrorResponse—only string and integer enums are supported right now. You could get this spec working for now, as a workaround, by removing enum: [true] from that section.

    I'll convert this issue into a request to support booleans in enums as is allowed by json schema

  2. added and removed
    🐞bugSomething isn't working
    on Aug 12, 2023
  3. changed the title [-]Error(s) encountered while generating, client was not created[/-] [+]Allow boolean values in enum[/+] on Aug 12, 2023
  4. added and removed on Aug 12, 2023
  5. locked and limited conversation to collaborators on Aug 12, 2023
  6. converted this issue into a discussion #796 on Aug 12, 2023
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions