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

P26 ajv #233

Merged
merged 3 commits into from
Oct 4, 2024
Merged

P26 ajv #233

merged 3 commits into from
Oct 4, 2024

Conversation

rahul-eminds
Copy link
Contributor

@rahul-eminds rahul-eminds commented Oct 1, 2024

This PR introduces modifications to the validation layer of the protocol server to enhance its OpenAPI validation capabilities, specifically targeting OpenAPI 3.1.0 specifications. Key changes include:

Package Update:

Added ajv version 8.17.1 to package.json. This library was chosen as an alternative to express-openapi-validator due to its limitations in handling certain validation keywords, such as contains, if, then, else, etc introduced in OpenAPI 3.1.0.
Migration to agv:

The validation middleware has been partially refactored to replace express-openapi-validator, which could not fully support OpenAPI 3.1.0 schemas, even with the latest alpha releases. For OAS 3.1.0, validation will be through agv and other older OAS version, existing express-openapi-validator would be used like before.

To increase the performance of validation, some of the spec file is compiled and cached during app load itself and stored in in-memory. For any request if it is precompiled, then it is compiled at that moment and stored in the cache for faster response from next request onwards.

Linked Issue #202

@rahul-eminds rahul-eminds changed the base branch from master to develop October 3, 2024 07:17
@em-abee em-abee merged commit 29c702b into develop Oct 4, 2024
1 check 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.

2 participants