-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add support for ajv-keywords #61
Conversation
6ac03fb
to
286059b
Compare
@wesleytodd PTAL |
Hey! Can you describe a bit what this does? I am not familiar with the lib so I would like to understand a bit more what this helps folks do before taking on the additional dep. |
I am going to mark this as approved since it requires it to run CI for first time contributors, but I still would like to hear more about what this provides functionality wise, and maybe even ask that we write slightly more docs on it since that package doesn't even have a good description in it's readme. |
Lets say you have a following json schema definition: {
type: 'object',
properties: {
name: {
type: 'string',
pattern: '^[a-zA-Z]$'
}
}
} But json schema does not support flags such as i, g, etc. With ajv-keywords, you can use custom keyword like {
type: 'object',
properties: {
name: {
type: 'string',
regexp: {
pattern: '^[a-z]$',
flags: 'i'
}
}
}
} |
Ah, interesting and for sure useful. Does this then also hook into the validation so that works correctly? Sorry for the niave questions here, but I think that this would be great to add to your docs if that is something you could do. Also, I think now that I have approved, if you push again it should re-triger the CI. |
It does participate in the validation I have added an example as well with |
I apologise that your approval got dismissed as I forced pushed to my branch. Added more test to show that query param can be validated with ajv-keywords |
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.
New approval, but I think maybe the GH feature here is broken because what use is it if a new push doesn't start triggering the ci? So if this doesn't work I might go ahead and change the setting on the repo.
I updated the CI, I think if you rebase your PR it might fix the fact that it wont run for you as a new contributor. |
All checks are passed Thanks for updating the CI. Please approve once again. |
published as 1.1.0 |
Useful to add custom validations.
I am using it in sequelize-to-openapi