-
Notifications
You must be signed in to change notification settings - Fork 117
Description
Sorry for not putting together something to reproduce the issue:
I'm using the builder-style interface; an OpenAPI spec that I don't control has been updated to specify its query parameters as an object.
I'm hitting a panic here:
progenitor/progenitor-impl/src/method.rs
Lines 1576 to 1588 in 9d88d24
| // For builder-capable bodies we offer a `body()` | |
| // method that sets the full body (by constructing | |
| // a builder **from** the body type). We also offer | |
| // a `body_map()` method that operates on the | |
| // builder itself. | |
| (Some(builder_name), false) => { | |
| assert_eq!(param.name, "body"); | |
| let typ = ty.ident(); | |
| let err_msg = format!( | |
| "conversion to `{}` for {} failed: {{}}", | |
| ty.name(), | |
| param.name, | |
| ); |
Message: assertion `left == right` failed
left: "my_object"
right: "body"
I've tried patching the code generation locally to parameterize the codegen in this branch + remove the assertion - but I haven't had the time to understand the surrounding code yet (and if there's a reason for the assertion beyond "we don't expect any builders that aren't for the body").
Is this just a case of not having implemented #1017 at the time the assertion was written?
The fix appears to be relatively straightforward but I'm struggling to get the time to think it through/follow it through - I just wanted to make sure that I wasn't missing something obvious.