Open tamalsaha opened 6 years ago
There's a missing "definitions" support on behalf of the OpenCore API package. It is being fixed, but not yet available.... Without "definitions" in your schema API you wont be seeing any model structures with proper names, only the "models" used by the API functions (and anonymously named InlineResponse20000...)
@rubimazaki, is there an issue or pr I can follow? Is there any timeline on when this will be available?
@rubimazaki Thank you for your reply. Is there a workaround that comes in mind? @tamalsaha What did you end up doing?
I have not done anything. I am still waiting for this project to do something or give us an update on it.
From what I understand: swagger should be written from swagger definitions -> server generated code -> then client generated code will work (other way being: employing swagger classes in your server -> generate swagger defs out of these). The swagger definitions generated this way are hard to make consistent. Generated client code is buggy, and documentation is (very) hard to maintain. Finally, our dev team solution was ... to write a python script to process the API typescript + the swagger schema JSON, and rename the model files + fixing the names of the TypeScript client. In my understanding if the schema would be written first, with the definitions of the structures written FOR the functions (and not the other way round), things would have been easier to us (both server/client teams). In addition: for the server team to supply well formatted docs, some special mustached parameters had to be injected into the definition of the function parameters, a thing that rendered the auto generated TypeScript API functions un-compile-able.
From what I understand: swagger should be written from swagger definitions -> server generated code -> then client generated code will work (other way being: employing swagger classes in your server -> generate swagger defs out of these).
Yes. Like Google protocol buffer and grpc. I will we could all just settle on that as the standard. Swagger has been just a awful experience with generators that can't do basic stuff.
Is there any solution to this?
+1 same problem importMappings seems to have no effect for python
It seems that type-mappings and import-mappings are not supported for python code generator. How can I skip code generation for some models in swagger.json and point them to an external import path in my generated python client ?