Bug Report Checklist
Description
The haskell-http-client generator doesn't handle the use of anyOf in an OpenAPI v3 spec properly. Trying to use anyOf will lead to malformed code which uses type name that don't exist, and will fail to compile.
openapi-generator version
Found on latest master: 2239ca36fdcedd865a3d9ccd3381f5031cdf8dbe.
OpenAPI declaration file content or url
Gist here: https://gist.github.com/ivanbakel/cbf8a00b30cbe71ca0fe86a5c9c44a18
Generation Details
I ran
generate -i ... -o ... -g haskell-http-client
with the above file (in the gist).
Steps to reproduce
- Generate the Haskell HTTP client code from the above file.
- Try to compile it.
- Get an error that
AnyOfFooBar is not a type
Related issues/PRs
May be related to #2968, which is a similar issue where a Haskell-based code generator produces malformed type names when using anyOf.
Suggest a fix
It looks like AnyOf simply isn't supported in the haskell-http-client schema at the moment. That would be very hard to fix, but ideally the above case, where there's an anyOf with a single child, could be simplified to just use that child type. So AnyOfFooBar in the above generated code would become just FooBar, since that's the only type in the anyOf.
Bug Report Checklist
Description
The
haskell-http-clientgenerator doesn't handle the use ofanyOfin an OpenAPI v3 spec properly. Trying to useanyOfwill lead to malformed code which uses type name that don't exist, and will fail to compile.openapi-generator version
Found on latest master:
2239ca36fdcedd865a3d9ccd3381f5031cdf8dbe.OpenAPI declaration file content or url
Gist here: https://gist.github.com/ivanbakel/cbf8a00b30cbe71ca0fe86a5c9c44a18
Generation Details
I ran
with the above file (in the gist).
Steps to reproduce
AnyOfFooBaris not a typeRelated issues/PRs
May be related to #2968, which is a similar issue where a Haskell-based code generator produces malformed type names when using
anyOf.Suggest a fix
It looks like
AnyOfsimply isn't supported in thehaskell-http-clientschema at the moment. That would be very hard to fix, but ideally the above case, where there's ananyOfwith a single child, could be simplified to just use that child type. SoAnyOfFooBarin the above generated code would become justFooBar, since that's the only type in theanyOf.