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

Merged
merged 7 commits into from
Nov 6, 2024

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.11594% with 22 lines in your changes missing coverage. Please review.

Project coverage is 68.97%. Comparing base (b9e8b45) to head (d2f7800).

Files with missing lines Patch % Lines
openapi2kong/validator.go 70.96% 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.97%   -0.11%     
==========================================
  Files          24       24              
  Lines        3290     3343      +53     
==========================================
+ Hits         2273     2306      +33     
- 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.
Copy link
Member

@Tieske Tieske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we're at a tie, let's get this done 😄

@Prashansa-K Prashansa-K merged commit a214fdd into main Nov 6, 2024
3 checks passed
@Prashansa-K Prashansa-K deleted the fix/oneof-schemas branch November 6, 2024 06:05
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