Stack overflow while generating client from large schema
Hi, I tried to generate a client for the vSphere Web Services API and I got a stack overflow error:
❯ libninja gen -l rust -g sportfloh/vsphere -o vsphere vsphere ../vi_json_openapi_specification_v8_0_1_0.yaml
...
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1] 240 abort libninja gen -l rust -g sportfloh/vsphere -o vsphere vsphere
vSphere Web Services API OpenAPI Schema
Cheers
Thank you! Can you share the exact link to the yaml? The link points to a huge documentation site, and I can't find the YAML document therein.
Sorry, yes ofcorse: https://vdc-download.vmware.com/vmwb-repository/dcr-public/f6932c47-5212-4866-b3e7-e29d81a68e51/9b5473f2-3c7f-4ab8-b374-827c8c89388e/vi_json_openapi_spec_v8_0_1_0.zip
Realistically not sure when I'll have time to prioritize this. Happy to answer Qs if you investigate the problem.
I got this when the the schema was potentially recursive, e.g with a parameter like
struct Item{
name: String
related_item: Option<Item>
}
And it was when generating the example that it overflowed (you can kinda see why ;)
Anyway I have a PR with a fix that WorksForMe(tm) or you might find that disabling examples does it for you