We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
required()
Calling required() twice on same prop duplicates key in required schema array required:[<prop>,<prop>] generating an invalid schema.
required
required:[<prop>,<prop>]
Steps to reproduce the behavior:
const S = require('fluent-json-schema') const schema = S.object() .prop('email', S.string()).required().required() console.log(JSON.stringify(schema.valueOf(), undefined, 2))
causes invalid schema with duplicate prop in required array
prop
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "email": { "type": "string" } }, "required": [ "email", "email" ] }
https://replit.com/@boyander/duplicatedrequiredprop
Either throw an error if using require() twice or generate the required:[] array using a Set
require()
required:[]
Also, congrats for this awesome package. We use it a lot at @core-school
The text was updated successfully, but these errors were encountered:
We are glad you like it!
Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Sorry, something went wrong.
Sure! Will work on it this weekend ☀️
Successfully merging a pull request may close this issue.
🐛 Bug Report
Calling
required()
twice on same prop duplicates key inrequired
schema arrayrequired:[<prop>,<prop>]
generating an invalid schema.To Reproduce
Steps to reproduce the behavior:
causes invalid schema with duplicate
prop
inrequired
arrayhttps://replit.com/@boyander/duplicatedrequiredprop
Expected behavior
Either throw an error if using
require()
twice or generate therequired:[]
array using a SetYour Environment
Also, congrats for this awesome package. We use it a lot at @core-school
The text was updated successfully, but these errors were encountered: