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

fix: added fix to validate for top-level type in parameter schemas while using oneOf in request-validator plugin. #215

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Prashansa-K
Copy link
Contributor

@Prashansa-K Prashansa-K commented Oct 23, 2024

As of now, deck file openapi2kong command was not
checking for multiple types used while creating parameter schemas with oneOf, which is not supported by Kong request- validator plugin. Thus, we are forcing for defining a top-level type property and erroring out in case it is not present.

Fixes: #206

@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 68.57143% with 22 lines in your changes missing coverage. Please review.

Project coverage is 68.98%. Comparing base (b9e8b45) to head (4230025).

Files with missing lines Patch % Lines
openapi2kong/validator.go 71.42% 15 Missing and 3 partials ⚠️
openapi2kong/openapi2kong.go 25.00% 2 Missing and 1 partial ⚠️
openapi2kong/jsonschema.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #215      +/-   ##
==========================================
- Coverage   69.08%   68.98%   -0.10%     
==========================================
  Files          24       24              
  Lines        3290     3344      +54     
==========================================
+ Hits         2273     2307      +34     
- Misses        848      864      +16     
- Partials      169      173       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

openapi2kong/jsonschema.go Outdated Show resolved Hide resolved
openapi2kong/validator.go Outdated Show resolved Hide resolved
openapi2kong/validator.go Outdated Show resolved Hide resolved
schemas while using oneOf in request-validator plugin.

As of now, deck file openapi2kong command was not
checking for multiple types used while creating parameter
schemas with oneOf, which is not supported by Kong request-
validator plugin. Thus, we are forcing for defining
a top-level type property and erroring out in case
it is not present.
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.

oneOf support in openapi2kong parameter schemas
3 participants