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

Support for OpenAPI version 3.1 #156

Open
vbabuEM opened this issue May 31, 2024 · 0 comments
Open

Support for OpenAPI version 3.1 #156

vbabuEM opened this issue May 31, 2024 · 0 comments
Assignees

Comments

@vbabuEM
Copy link
Contributor

vbabuEM commented May 31, 2024

Currently we use a library called express-openapi-validator for validating requests against the core or layer 2 config. The version of the library we use works upto OpenAPI v 3.0. This version of OpenAPI and corresponding json-schema bound to it are over five years old. There have been significant progress in json-schema, particularly with conditional(if then else) support. These constructs help in writing layer 2 configuration rules.

So we want to now support OpenAPI 3.1 in the protocol server. However the express-openapi-validator library does not still support OpenAPI 3.1. It seems like its very close to releasing support. We have two approaches that we can adopt.

  1. Use the almost-to-be-merged branch of the library. (https://github.com/SF97/express-openapi-validator/tree/feat/openapi-3.1-support)
  2. Write middleware using different library (e.g. https://www.npmjs.com/package/@hyperjump/json-schema)

I prefer the former, but it might be a good idea to also try one implementation with latter (We can compare performance of the two and see if the latter is better performant - the field has been complaining that the former is slow)

As part of this ticket, try both the approaches.

For test cases

  1. Ensure all our sandbox specs and samples pass
  2. Write new conditional rules using if-then-else run both positive and negative test cases and log the outputs.
  3. Do some simple performance measures and log the metrics.
@rahul-eminds rahul-eminds self-assigned this Oct 7, 2024
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

No branches or pull requests

2 participants