Skip to content

Fix empty query parameter schema validation - #1224

Open
rootsec1 wants to merge 1 commit into
python-openapi:masterfrom
rootsec1:fix/empty-query-schema-validation
Open

Fix empty query parameter schema validation#1224
rootsec1 wants to merge 1 commit into
python-openapi:masterfrom
rootsec1:fix/empty-query-schema-validation

Conversation

@rootsec1

Copy link
Copy Markdown

An empty query value is rejected before schema validation whenever allowEmptyValue is omitted. This prevents schemas that explicitly allow an empty string, including enum values, from taking effect.

The empty-value error is now raised only when allowEmptyValue is explicitly false. When the deprecated field is absent, the schema decides whether the empty string is valid; explicit false behavior and warnings remain unchanged.

Tests cover validation and unmarshalling across OpenAPI 3.0, 3.1, and 3.2, including schema-allowed and rejected empty strings, explicit false, and omitted optional parameters.

Closes #1210

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.

[Bug]: Query parameter validation fails to match empty string when listed as a valid enum value

1 participant