-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
feat: unsafe string format #686
Conversation
Did you know about #685 |
Sorry saw on my phone, I see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Nice job 👍
'code': { | ||
type: 'string', | ||
format 'unsafe' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'code': { | |
type: 'string', | |
format 'unsafe' | |
} | |
'code': { | |
type: 'string', | |
format 'unsafe' | |
} |
This PR add the 'unsafe' string format. By default,
fast-json-stringify
escapes all strings. With the 'unsafe' format, the string isn't escaped. This has a potentially dangerous security issue. You can use it only if you are sure that your data doesn't need escaping. The advantage is a significant performance improvement.Usage into the JSON schema
benchmark (safe VS unsafe):
side note: this PR is the continuation of the #685 (cesco69 is my other account). #685 will be closed and I'll continue here
Checklist
npm run test
andnpm run benchmark
and the Code of conduct