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

Basic support for vector query parameters. #872

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pvandommelen
Copy link
Contributor

Includes a small refactor which changes generated variable names in the output.

This currently assumes explode=true, and therefore only partially resolves #692. I'm looking for some guidance on how to best improve this. The openapiv3 crate exposes explode in its ParameterData so the necessary configuration is available, but it's unclear to me if this value is best passed separately as part of the current OperationParameter, or within OperationParameterKind::Query.

While I have manually tested this with an endpoint another issue is the lack of a test. The oxidecomputer/dropshot server used in tests doesn't yet support non-scalar query parameters. Another option is to include an openapi document and verify its output, but that feels rather heavy.

This avoids having to duplicate code between the required and optional branches.
Reuses the variable name inside the `let Some(..)` assignment, which has an impact on the existing output.
This assumes style=form and explode=true, which is the default.
Partially resolves oxidecomputer#692
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.

Query param of type: array with items.type: string leads to to_string() and unsatisfied trait on &&Vec<String>
1 participant