Skip to content

fix: support httpmock generation for array types#1261

Open
danieleades wants to merge 5 commits intooxidecomputer:mainfrom
danieleades:mock-vecs
Open

fix: support httpmock generation for array types#1261
danieleades wants to merge 5 commits intooxidecomputer:mainfrom
danieleades:mock-vecs

Conversation

@danieleades
Copy link

@danieleades danieleades commented Dec 19, 2025

closes #1260

Http mock generation fails for me at compile time because it assumes that all types implement Display. This doesn't hold for vectors.

Summary

  • Fix httpmock query-parameter generation for non-Display types by reusing QueryParam serialization and matching on decoded (key, value) pairs.
  • Add query_param_pairs in progenitor-client to mirror QueryParam rules (scalars, arrays with repeated keys, objects/maps), and use it throughout generated httpmock matchers.
  • Add compile-only coverage plus a minimal OpenAPI spec for array query parameters.

Notes

  • The matcher helper applies decoded pairs, which is why this shows up in many places (not just arrays).
  • Serialization failures now expect because these are non-recoverable errors in generated mocks/tests.

@danieleades danieleades marked this pull request as ready for review December 27, 2025 13:03
@danieleades
Copy link
Author

this now works against my openAPI spec.

note the need to convert &str to String to satisfy the trait bounds of httpmock json_body_obj. That bound appears however to be a bug- have opened a PR upstream - httpmock/httpmock#206

@danieleades
Copy link
Author

marking as a draft until the upstream issue in httpmock is resolved

@danieleades danieleades marked this pull request as draft January 6, 2026 18:15
@danieleades
Copy link
Author

upstream fix has been merged, just need a new release of httpmock

@danieleades
Copy link
Author

@ahl - would it be possible to trigger CI for this one?

this issue is a blocker for me adopting progenitor

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.

httpmock generation fails for query params with array types (e.g., Vec<T>)

1 participant

Comments