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

APIv3: Support filter paramters passed via filter_parameters array #8253

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

bniels707
Copy link

This contains two commits:

The first adds support for accepting filter parameters via the filter_parameters query argument. This makes it possible to actually pass filter parameters as described in the Swagger definition. The old behavior of passing filter parameters via arguments not explicitly named in the Swagger definition is preserved.

e.g. filter_parameters=date$gt%3D1491719030000 == date$gt=1491719030000

The second commit makes it explicit in the Swagger definition that filter_parameters is an array of string arguments. The JSON definition was generated from the YAML definition (java -jar openapi-generator-cli-7.4.0.jar generate -i cgm-remote-monitor/lib/api3/swagger.yaml -g openapi --skip-validate-spec).

If someone knows of a way to generate the JSON that results in less churn (other than modifying it by hand...) I would gladly redo that commit.

This assumes #8252 has been merged.

The API version should probably be incremented after accepting #8252, this, or both.

Filter parameters can now be passed as a space separated array via the
filter_parameters query argument. They are then treated the same as
unlabeled filter parameters.

e.g. filter_parameters=date$gt%3D1491719030000 == date$gt=1491719030000

This is closer to matching the Swagger API definition.

Tests are added to verify the new behavior.
This updates the Swagger definition to reflect the fact
filter_parameters can now be passed as a space delimited string array.

The JSON file was generated using openapi-generator:

java -jar openapi-generator-cli-7.4.0.jar generate -i cgm-remote-monitor/lib/api3/swagger.yaml -g openapi --skip-validate-spec

It is possible there are other changes than just those made to
filter_parameters, but since the Swagger definition appears to only be
used for the API docs / "Try It Out" feature there shouldn't be any
risk to accepting the updated definition.
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.

None yet

1 participant