-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gen] accept OpenAPI "open" types like "any" & "anyObject" #3199
Comments
No, Using Scala's /bounty $125 |
💎 $125 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio-http! Add a bounty • Share on socials
|
@jdegoes I agree that any "serious" use case should use Json. But this requires to manually add a dependency in the build for the Json AST. IMO, code generation tools should not generate code that requires extra dependencies to compile, unless user explicitly opt in for it. Yes,
|
@hochgi zio-json is a dependency of zio-http. I think Json is okay |
/attempt #3199
|
💡 @hochgi submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
defining "Any" in OpenAPI according to the docs: https://swagger.io/docs/specification/v3_0/data-models/data-types/
These won't work in zio-http-gen.
Expectation:
should be rendered as:
Also, support "free form objects:
e.g:
should be rendered as:
Also, since
Any
is not really nice to use, and a more common use case would be to generate with Json:or:
instead of
Any
/Map[String, Any]
…we should add an ability to configure this.
Obviously we need to provide a way to generate a zio-json compatible code,
but perhaps other Json ASTs could be supported (like circe/playjson/etc'…)?
This controls both the code, and the required imports.
default should be
Any
/Map[String, Any]
, since it would be surprising to generate code that would fail to compile unless you add a 3rd party dependency.The text was updated successfully, but these errors were encountered: