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

fix: escape single quote when building error message for required property #716

Merged
merged 5 commits into from
May 6, 2024

Conversation

tomastauer
Copy link
Contributor

closes #715

Checklist

@tomastauer
Copy link
Contributor Author

@ivan-tymoshenko could you please try to restart the CI? Seems the fail is not related to the changes in this PR

@Uzlopak Uzlopak changed the title 715: escape single quote when building error message for required property fix: escape single quote when building error message for required property Apr 26, 2024
@gurgunday
Copy link
Member

Seems like there is an issue on node 14?

This is the 4th run

@mcollina
Copy link
Member

Yes. macos-latest gha env is now arm based. There is no Node v14 for arm. It's failing everywhere.

Either we test on older Mac envs or we just ignore that combo.

@Uzlopak
Copy link
Contributor

Uzlopak commented Apr 28, 2024

Lets ignore it.

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure, can you please add another test for double quote as well:

const stringify = build({
    type: 'object',
    properties: {
      '"': { type: 'string' }
    },
    required: [
      '"'
    ]
  })

@tomastauer tomastauer requested a review from gurgunday May 6, 2024 11:48
Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah lgtm, that regex seems necessary

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit ed8ed70 into fastify:master May 6, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON schema with single quote in property name fails to be processed when the property is required
4 participants