Closed FaFre closed 7 months ago
Hi @FaFre , thanks for raising issue. Will take a look into it soon!
I also have this issue. However, I don't get any error. The generation is successful, but the generated code has InvalidType
.
I also have this issue. I am getting a similar error.
[SEVERE] json_serializable on lib/src/generated/api/backend_api.swagger.dart:
Could not generate `fromJson` code for `type`.
To support the type `InvalidType` you can:
* Use `JsonConverter`
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonConverter-class.html
* Use `JsonKey` fields `fromJson` and `toJson`
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/fromJson.html
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/toJson.html
package:ideal/src/generated/api/backend_api.swagger.dart:7523:64
╷
7523 │ final enums.PairingList$Item$Paired$UserAttachments$ItemType type;
│ ^^^^
╵
If you need, here's also my specification, so you can compare. This may be a similar issue. https://api.develop.maxi-ideal.com/api-yaml
I also tried it with version 2.12.2 as it seems to have fixed previously reported type errors but it leads to the same result unfortunately.
Hi @FaFre , @JaccMirac !
I've tried to fix your issue, but your swagger is too complex. We're not gonna support it. Feel free to contribute.
Your swagger contains "Statement" model in multiple places. Also your swagger use allOf inside of allOf inside of allOf. Our generator is not created for such over-linked allOf swagger files, sorry :(
@Vovanella95 Do you have any tips on how to simplify the swagger file?
Hi @FaFre , you can put all schemas from responses
to schemas
and try to regenerate. Also you can try to rid of allOf
@FaFre I can support with this if you will have difficulties
Describe the bug Generator produces
InvalidType
and fails with:Swagger specification link https://doc.wikimedia.org/Wikibase/master/js/rest-api/openapi.json
Library version used: 2.14.2