We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Alias schema for format: date-time causes compilation error in generated java code.
format: date-time
0.31.7
fernapi/fern-java-spring 0.9.0
OpenAPI specification required to reproduce the bug:
openapi: 3.1.0 info: version: 1.0.0 title: Example servers: - url: http://api.example.xyz/v1 paths: components: schemas: Timestamp: type: string format: date-time description: ISO representation of a Timestamp example: 20-10-2020T23:59:59
The buggy SDK that is produced:
/** * This file was auto-generated by Fern from our API Definition. */ package types; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.lang.Object; import java.lang.String; import java.time.OffsetDateTime; public final class Timestamp { private final OffsetDateTime value; private Timestamp(OffsetDateTime value) { this.value = value; } ... @JsonCreator( mode = JsonCreator.Mode.DELEGATING ) public static Timestamp of(OffsetDateTime value) { return new Timestamp(value); } public static Timestamp valueOf(String value) { return of(value); } }
Notice the method valueOf calling of(...) with a string argument.
valueOf
of(...)
The expected SDK
... public static Timestamp valueOf(String value) { return of(OffsetDateTime.parse(value)); } }
I think this bug comes from here:
fern/generators/java/generator-utils/src/main/java/com/fern/java/generators/AliasGenerator.java
Line 168 in d8575c9
The text was updated successfully, but these errors were encountered:
dsinghvi
No branches or pull requests
Describe the Bug
Alias schema for
format: date-time
causes compilation error in generated java code.Information to Reproduce
CLI Version
0.31.7
Generator Version
fernapi/fern-java-spring
0.9.0
API Definition
OpenAPI specification required to reproduce the bug:
Actual SDK
The buggy SDK that is produced:
Notice the method
valueOf
callingof(...)
with a string argument.Expected SDK
The expected SDK
I think this bug comes from here:
fern/generators/java/generator-utils/src/main/java/com/fern/java/generators/AliasGenerator.java
Line 168 in d8575c9
The text was updated successfully, but these errors were encountered: