Open doctorpangloss opened 9 months ago
generateAliasAsModel: true
can you try setting it to false instead?
This causes other errors:
....
[main] INFO o.o.codegen.DefaultGenerator - Model Prompt not generated since it's a free-form object
[main] INFO o.o.codegen.DefaultGenerator - Model Outputs not generated since it's a free-form object
[main] INFO o.o.codegen.DefaultGenerator - Model upload_image_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
[main] WARN o.o.c.l.AbstractPythonCodegen - Failed to lookup model in createImportMapOfSet Dict[str, PromptNode]
[main] WARN o.o.c.l.AbstractPythonCodegen - Failed to lookup model in createImportMapOfSet Dict[str, Output]
[main] WARN o.o.c.l.AbstractPythonCodegen - Failed to lookup model in createImportMapOfSet Dict[str, PromptNode]
[main] WARN o.o.c.l.AbstractPythonCodegen - Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any.
[main] WARN o.o.c.l.AbstractPythonCodegen - Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any.
[main] WARN o.o.c.l.AbstractPythonCodegen - Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any.
...
No... these are maps with typed values. This must be a bug. See the updated colab here: https://github.com/OpenAPITools/openapi-generator/issues/17755#issuecomment-1920919909
Bug Report Checklist
Description
A schema of
type: array
with aoneOf
initems
produces snippets of broken Python code like:openapi-generator version
7.2.0 (regression compared to 6.x)
OpenAPI declaration file content or url
https://github.com/hiddenswitch/ComfyUI/blob/wip/api/comfy/api/openapi.yaml
Logs on 7.3.0 (master):
Generation Details
openapi_python_config.yaml:
Steps to reproduce
See Collab notebook here https://colab.research.google.com/drive/18sXET4mnQLMrsxru2vumN7iuk1fVJEVr?usp=sharing
Observe
queue_tuple
has content likewhich is not valid Python and indicates a bug.
Related issues/PRs
Related to https://github.com/OpenAPITools/openapi-generator/issues/17745
Suggest a fix
Not sure what the underlying issue is, are
Array
schemas unexpected? this works in 6.x.