Open oravecz opened 3 years ago
code is failing at https://github.com/hpoul/openapi_dart/blob/f1970e6cf9fbac0c9cb55933ba146e3c12194f6d/packages/openapi_code_builder/lib/src/openapi_code_builder.dart#L1231
final dynamic tmp = loadYaml(source);
final content = json.encode(tmp)); // error
this should be fixed in yaml package itself! , or this lib should support json file inputs so that user can use service like https://onlineyamltools.com/convert-yaml-to-json , to convert to json and then use it as input.
sorry for the late response.. but imho that yaml schema is not valid..
The keys (status codes) of responses
must be strings.. because in JSON all keys must be strings. This is probably the reason why json.encode
jokes at this point.
Although to be honest, I've developed the generator to generate a simple server/client pair, not necessary generate the client for existing complicated schemas.. but i'll see if I can get it to work.. still interesting.. But I think the best use case is using it for client AND server.. (there are a lot of client side dart generators already out there)
The sample yaml in the README file works fine, but when I run the code generator against the rather large YAML file found as part of the Open Banking API, it crashes.
The YAML file I am using can be found at this URL: https://raw.githubusercontent.com/OpenBankingUK/read-write-api-specs/master/dist/openapi/account-info-openapi.yaml