Describe the filter parameters - #1084
Merged
Merged
Conversation
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 #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 #571
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.
Phase 4 of #1078, which closes #571 and replaces #980.
Only the plain
filterparameter was in the document. A generated client had no way to express an "or" and no idea what the operators were, and the parameter that is there said nothing beyondid,eq,1.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:
openApiFilterCountis the number offilter1tofilterNparameters and defaults to 3,openApiSubFilterCountis the number of lettered ones per numbered one and defaults to 0, since the full grid is a lot of parameters for something few APIs need. The ones that are not described still work, they are just not in the document.They are appended after the other parameters of the operation rather than inserted next to
filter, so the positions of the parameters that were already there do not shift. That is the objection the author of #980 raised against his own change.The description of
filternow lists the eleven operators, thenprefix that negates them, the eleven spatial operators (with the three that take no value marked as such) and the path syntax that filters on a related table. The numbered and lettered ones say how they combine into the condition tree.The parameters of a list operation moved into
OpenApiRecordParameters, which is where the components they refer to are written. The records builder and the geojson builder each had their own copy of the array plus the same text search append, so they could disagree about it.The expected document grew from 131 KB to 136 KB, on sqlite from 122 KB to 126 KB.
Added
tests/functional/001_records/108_filter_on_nested_or.log, which pins the semantics that the new descriptions claim. There was no test for the letter suffixed depth at all.filter1=category_id,eq,1&filter1a=id,eq,1&filter1b=id,eq,5answers with two records where a flat reading of the letters would answer with ten.Checked the parameter list of the record and geojson list operations with the two settings at 0, at their defaults and past the letter range.