Skip to content
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

Generated type for an enum in a schema with single quote does not escape properly #1132

Open
esfox opened this issue Oct 9, 2024 · 1 comment
Labels
bug 🔥 Something isn't working prioritized 🚚 This issue has been prioritized and will be worked on soon
Milestone

Comments

@esfox
Copy link

esfox commented Oct 9, 2024

Description

Single quotes in an enum in a schema do not escape properly so it breaks the generated type.

Expected

export type SomeRequest = {
  category: 'Category A' | 'Category B' | 'Category C';
  withSingleQuote: 'Yes' | 'No' | "Don't Know";
}

Actual

export type SomeRequest = {
  category: 'Category A' | 'Category B' | 'Category C';
  withSingleQuote: 'Yes' | 'No' | 'Don't Know';
}

Reproducible example or configuration

No response

OpenAPI specification (optional)

components:
  schemas:
    ...
      SomeRequest:
        type: object
        properties:
          category:
            type: string
            enum:
              - Category A
              - Category B
              - Category C
          withSingleQuote:
            type: string
            enum:
              - Yes
              - No
              - Don't Know

System information (optional)

No response

@esfox esfox added the bug 🔥 Something isn't working label Oct 9, 2024
@mrlubos mrlubos added the prioritized 🚚 This issue has been prioritized and will be worked on soon label Oct 9, 2024
@mrlubos mrlubos added this to the Parser milestone Oct 20, 2024
@mrlubos
Copy link
Member

mrlubos commented Oct 20, 2024

This will be fixed as part of the parser release – thank you for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working prioritized 🚚 This issue has been prioritized and will be worked on soon
Projects
None yet
Development

No branches or pull requests

2 participants