REST: Fix schema of data-access object in REST spec#16594
Open
adutra wants to merge 1 commit into
Open
Conversation
The current spec defines this object as a single enum constant, not a comma-separated list of enum constants. To achieve that, the schema must instead be of type `array`, and its elements must be enum constants. Then, the actual wire format (comma-separated) is achieved by setting the style to `simple` and `explode` to false (as is today). The error has never been caught, likely because: - We don't generate Python code for this specific object (only for requests and responses) - CI only validates that the schema is structurally well-formed (which it is – only not what we wanted it to be). The example was wrong, but it wasn't being validated either. - Most clients out there simply do not parse or validate the header value at all. Note: the example was left as is (serialized string in wire format), not transformed into an array (internal representation). The OpenAPI spec is unclear about how such examples should be included: - On one side, it states that "example ... SHOULD match the specified schema and encoding properties if present." (note the SHOULD) - On the other side, the Style Examples table shows the serialized, comma-separated string as the canonical example of an array of strings when the style is `simple`.
Contributor
Author
Also worth noting: according to this thread: OAI/OpenAPI-Specification#4622 Serialized examples are rejected by most linters today. |
Contributor
Author
|
@nastra do you mind taking a look? |
sfc-gh-prsingh
added a commit
to singhpk234/iceberg
that referenced
this pull request
May 30, 2026
The schema was defined as a single enum constant rather than a comma-separated list of enum constants. Following the same fix as apache#16594 for data-access, declare it as an array of enums so the example value (a comma-separated string) actually matches the wire format produced by style: simple, explode: false.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current spec defines this object as a single enum constant, not a comma-separated list of enum constants.
To achieve that, the schema must instead be of type
array, and its elements must be enum constants. Then, the actual wire format (comma-separated) is achieved by setting the style tosimpleandexplodeto false (as is today).The error has never been caught, likely because:
Note: the example was left as is (serialized string in wire format), not transformed into an array (internal representation). The OpenAPI spec is unclear about how such examples should be included:
simple.