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

Enum value with single quote causes syntax error #256

Closed
strothj opened this issue May 19, 2020 · 1 comment · Fixed by #365
Closed

Enum value with single quote causes syntax error #256

strothj opened this issue May 19, 2020 · 1 comment · Fixed by #365
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@strothj
Copy link

strothj commented May 19, 2020

Hello,

I've encountered a bug where if an enum value contains a single quote, a syntax error is thrown.

            "enum": [
              "",
              "Cash",
              "Insurance",
              "Insurance Out of Network",
              "Auto Accident",
              "Worker's Comp"
            ],

https://app.drchrono.com/openapi-schema has a download link for the schema which contains this issue.

Loading spec from .\openapi-schema.json…
SyntaxError: ')' expected. (1796:123)
  1794 |   * One of `""`, `"Cash"`, `"Insurance"`, `"Insurance Out of Network"`, `"Auto Accident"` or `"Worker's Comp"`.<br>**Note:** Patient must already have either `primary_insurance` or `secondary_insurance` or new `primary_insurance` or `secondary_insurance` is passed in request if `Insurance`, `Auto Accident` or `Worker's Comp` payment profiles are chosen.
  1795 |   */
> 1796 | "patient_payment_profile"?: ('') | ('Cash') | ('Insurance') | ('Insurance Out of Network') | ('Auto Accident') | ('Worker's Comp');
@drwpow drwpow added good first issue Good for newcomers help wanted Extra attention is needed labels Aug 8, 2020
@drwpow
Copy link
Owner

drwpow commented Aug 8, 2020

Thanks for adding! Yes this is a bug that should be fixed—that should be being escaped properly. Would love a PR from anyone able to contribute.

As a workaround for now, you may find using a curly apostrophe can get you through: .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
2 participants