Repository navigation
fix: support httpmock generation for array types - #1261
danieleades wants to merge 9 commits into
Conversation
16c7571 to
e4f70cd
Compare
|
this now works against my openAPI spec. note the need to convert &str to String to satisfy the trait bounds of httpmock |
|
marking as a draft until the upstream issue in httpmock is resolved |
|
upstream fix has been merged, just need a new release of |
6316c26 to
6b29797
Compare
6b29797 to
f410fa5
Compare
b67549d to
02de846
Compare
|
@ahl - would it be possible to trigger CI for this one? this issue is a blocker for me adopting |
02de846 to
3590ce5
Compare
- only emit the query param helper when an operation has query params, avoiding a dead_code warning in generated mocks - require an absent parameter when the client would send no pairs (e.g. an empty array) - match each pair with exact (escaped, anchored) counts so extra, missing, or duplicated values no longer match - replace the compile-only test with MockServer tests
|
@ahl - any movement on this one? |
|
Rather than generating the helper function, should we have a helper crate akin to |
Makes sense, i think. Were you thinking a sibling crate, something like |
I'm unsure. Perhaps it would be better to have helpers in progenitor-client with a httpmock feature flag. What do you think? |
let me know what you think of this approach |
Closes #1260.
Generated httpmock query setters now use the same Serde serializer as the generated client. The matcher lives in
progenitor-clientbehind an opt-inhttpmockfeature. The mock generator declares that feature when it emits a query setter.Scalar setters continue to require the expected key/value pair and allow other values for the same key. Array setters check the exact values and their multiplicities in any order. An empty array requires the key to be absent.
The regression tests send a generated-client request to a mock server and exercise reordered, duplicate, extra, missing, empty, and regex-sensitive values. A separate assertion checks the feature metadata on generated mocks and SDKs.
The standalone generated-output fixture uses httpmock 0.8 and reqwest 0.13. Its mock modules compile. Checking the entire fixture still hits the two existing Buildomat CLI parser errors tracked in #1170.