-
Notifications
You must be signed in to change notification settings - Fork 47
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
oneOf is translated to Object when one of the options is a simple type. #444
Closed
Tracked by
#1247
Comments
fjtirado
added a commit
to fjtirado/sdk-java
that referenced
this issue
Oct 28, 2024
fjtirado
added a commit
to fjtirado/sdk-java
that referenced
this issue
Oct 28, 2024
fjtirado
pushed a commit
to fjtirado/sdk-java
that referenced
this issue
Oct 28, 2024
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.5.10 to 1.5.11. - [Commits](qos-ch/logback@v_1.5.10...v_1.5.11) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> [Fix serverlessworkflow#444] Handling multiple strings
fjtirado
pushed a commit
to fjtirado/sdk-java
that referenced
this issue
Oct 28, 2024
Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
fjtirado
pushed a commit
to fjtirado/sdk-java
that referenced
this issue
Oct 28, 2024
Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
fjtirado
pushed a commit
to fjtirado/sdk-java
that referenced
this issue
Oct 28, 2024
Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
This was referenced Oct 28, 2024
fjtirado
added a commit
that referenced
this issue
Oct 28, 2024
[Fix #444] Wrapper class for anyOf containing strings
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lets take an example to illustrate the issue
This portion of the schema
is translated to
Alhought an Endpoint class is generated, when using this definition
A LinkedHasHMap rather than an Endpoint (a class that is generated, but never used) instance is assigned to endpooint filed, which forces the user of the SDK to write (even incorreclty assuming the uri field is used, which is not necessarily true) this ugly code
String uri = ((Map) httpArgs.getEndpoint()).get("uri").toString();
A custom deserializer wont be enough, because although it will allow to use this somehow "better" form
((Endpoint) httpArgs.getEndpoint()).getUri()
still have obvious problems: Besides being prompt to ClassCastExcpetion, it forces the user to somehow know that
endpoint
field might hold anEndpoint
objectTherefore, we need to make a breaking backward compatibility change (which is one of the advantages of being in alpha state ;), and rather than an Object field for endpoint, generate a new Union class with getters for all possible value types, as current happen when all possible types are generated classes, for example
Call
The text was updated successfully, but these errors were encountered: