Skip to content

Simple support for OR filters in OpenAPI #571 - #980

Open
jonasborn wants to merge 2 commits into
mevdschee:mainfrom
jonasborn:main
Open

jonasborn wants to merge 2 commits into
mevdschee:mainfrom
jonasborn:main

Conversation

@jonasborn

Copy link
Copy Markdown

Fix for #571

@jonasborn jonasborn changed the title Simple support for filters in OpenAPI #571 Simple support for OR filters in OpenAPI #571 Jul 16, 2023
@jonasborn

Copy link
Copy Markdown
Author

It might be better to add the new filter params to the end of the definition, as it breaks compatibility:

grafik

This was referenced Aug 26, 2026
pull Bot pushed a commit to mattdanielbrown/simple-minimal-single-file-php-crud-api that referenced this pull request Aug 28, 2026
Only the plain "filter" parameter was in the document, so a generated client had
no way to express an "or" and no idea what the operators were.

The numbered and lettered variants can be repeated any number of times, but
OpenAPI has no way to say that, every parameter has to be named. How many of
them are described is therefore a setting: "openApiFilterCount" is the number of
"filter1" to "filterN" parameters and defaults to 3, "openApiSubFilterCount" is
the number of lettered ones per numbered one and defaults to 0, as the full grid
of them is a lot of parameters for something that few APIs need. The ones that
are not described still work. They are appended after the other parameters, as a
client generated from the document may pass them by position, which is what the
review of mevdschee#980 pointed out.

The description of "filter" now lists the operators, the "n" prefix that negates
them, the spatial operators and the path syntax that filters on a related table.
The numbered and lettered ones say how they combine.

The parameters of a list operation moved into OpenApiRecordParameters, which is
where the components they refer to are written, so the records builder and the
geojson builder cannot disagree about them.

Closes mevdschee#571
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.

1 participant