Open mseele opened 7 months ago
Do you know what version of cargo progenitor
you have installed? cargo install-update --list cargo-progenitor
The good news is that in the main branch, we're not blowing the stack. The bad news is that we're running into this error: UnexpectedFormat("unexpected content type: application/graphql")
. It looks like the right thing to do is just serialize it as though that's application/json
:
If we patch that, we see another unhandled mime type: */*
. I think we can make that text/plain
.
Then we have an issue of multiple response types:
thread 'main' panicked at progenitor-impl/src/method.rs:1261:9:
assertion failed: response_types.len() <= 1
It looks like like each error actually uses the same type, but with a wrapper to indicate the meaning of the response code (a bit useless, but whatever). That will require a fix for #344.
Thank you for looking into it so fast. I've used github, so the version is the latest commit 15 hours ago.
That's very odd as I think I'm running the same version. What OS are you on? What's your default stack size?
I'm running mac os on a macbook pro m1. I have no idea what the default stack size is. sorry.
Do you have a record of the stack when it overflowed? Thanks
Sorry for answering so late...how to record the stack on macos?
I believe the proximate stack overflow has been addressed. You can cargo uninstall cargo-progenitor
and cargo install --git https://github.com/oxidecomputer/progenitor cargo-progenitor
. It will, however, still fail on the errors noted above.
For future reference, the way I examine stacks on crashes on macOS is to hit the "report" button when the "your program crashed" dialog pops up. The stack is in the subsequent dialog box.
@ahl Thanks, the stack overflow is gone and it's now failing with the following error (as you mentioned):
cargo progenitor -i openapi.yaml -o ct_prog -n ct_prog -v 0.0.1
gen fail: UnexpectedFormat("unexpected content type: application/graphql")
Error: generation experienced errors
I want to generate a commercetools OpenAPI client and tried to process the OpenAPI spec from commercetools:
https://github.com/commercetools/commercetools-api-reference/blob/main/oas/api/openapi.yaml
Unfortunalty then generation failed pretty quickly: