-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Method (getter/setter) name not produce as javaName when reference definitions #678
Comments
Any thoughts on this issue? I think I'm running into the same problem. Rough example (hand edited, so may not be 100% accurate):
Generated Java:
I find it odd that it only appears to affect gradle. Doesn't seem to be an issue with the maven plugin. |
Actually, I just spotted my issue in your example. I had the |
In my case I use Employee getEmployee() { ... } and
|
Hi @X3STeNLiTE. When you use a $ref, the entire node is replaced by the ref contents. No values are kept from the properties that reside alongside the ref. This is how JSON Schema is specified:
In this case we could make a special case for |
Thank you for you're explanation, looking forward for the next build : ) |
That actually explains the other part of my issue too. Thanks! |
Hey @joelittlejohn, your last explanation makes sense, BUT the tool is generating the field name correct, e.g. respecting the javaName directive, so is it a bug? |
Resurrecting from the grave, I am currently also experiencing this issue. I am using a "foo": {
"$ref": "other.json",
"javaName": "foobar"
} Generates: @JsonProperty("foo")
@JsonPropertyDescription("...")
private FooBar foobar;
@JsonProperty("foo")
public FooBar getFoo() {
return foobar;
} When it would have conceptually made more sense to have |
I'm using jsonschema2pojo gradle's plugin v0.4.29 and here's configure, schema, output java
build.gradle Configure
JSON Schema
Generated Java
The text was updated successfully, but these errors were encountered: