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: fixed req-validator config generation when both body and param schema are empty. #244

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ paths:
# there is nothing to validate here, so no plugin should be created
summary: Get help
operationId: getHelp
parameters:
# This would not be added to the req-validator plugin config
# as cookie type is not supported yet.
# A warning would be logged and this parameter would be ignored.
- in: cookie
name: cookieid
schema:
type: integer
required: true
responses:
'200':
description: This is a success.
Expand Down
2 changes: 1 addition & 1 deletion openapi2kong/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func generateValidatorPlugin(operationConfigJSON []byte, operation *v3.Operation
if err != nil {
return nil, err
}
if parameterSchema != nil {
if len(parameterSchema) != 0 {
config["parameter_schema"] = parameterSchema
config["version"] = JSONSchemaVersion
}
Expand Down
Loading