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

Allow for extensions #188

Open
bartoszm opened this issue Sep 26, 2023 · 1 comment · May be fixed by #189
Open

Allow for extensions #188

bartoszm opened this issue Sep 26, 2023 · 1 comment · May be fixed by #189

Comments

@bartoszm
Copy link
Contributor

I think it would be useful to enable codebase for extensions e.g., to be able to provide own ajv validator or an instance of determiner.
To my understanding determiner logic is responsible for augmenting the source schema and example extraction.
Thus having the ability to provision augmentation logic and / or ajv instance could help to realize some more complex jet bespoke use cases like: handling noAdditional properties for complex schemas (using unevaluated Properties), support for readOnly/writeOnly etc.

bartoszm added a commit to bartoszm/openapi-examples-validator that referenced this issue Sep 27, 2023
@bartoszm bartoszm linked a pull request Sep 27, 2023 that will close this issue
@codekie
Copy link
Owner

codekie commented Sep 28, 2023

The validator-factory is to initialise the JSONSchema-Validator (which then will be used to validate the OpenAPI-definitions). It can be used to augment the OpenAPI-definition. However, it was never intended to make extensive adaptions/augmentations as the main task of the validation should be done by the JSONSchema-validator (Ajv, in this case). Any modification of the original OpenAPI-definition, just to handle or cover shortcomings of the JSONSchema-validator, may lead to unwanted or unforeseen side-effects and in the worst case may lead to wrong validation-results. That is why I try to keep it at an absolute minimum.

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 a pull request may close this issue.

2 participants