-
Notifications
You must be signed in to change notification settings - Fork 59
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
JacksonModule bug? #491
Comments
Hi @rdykiel, A complete example would help in debugging – including your JSON Schema Generator configuration. What does the getter look like? |
I'll ask my manager about how much code I can communicate, or will work on a repro.
The DeploymentType class is parsed from YAML and generates YAML correctly ('_import' being renamed 'import' by the effect of the JsonProperty annotation), with the standard Jackson libraries. Here is the code of the schema generation:
The class 'YamlRoot' is a simple class that only has 1 field, 'DeploymentType deployment'. This is how we generate the desired YAML and parse it. |
I want to restate that when not using the JacksonModule, I get the '_import' section in the output JSON schema correctly (of course the JsonProperty renaming doesn't occur) |
Hi @rdykiel I suspect changing the getter name to |
I created 'get_import' and 'get__import' and this didn't change the behavior (I kept the existing getImport() for compatibility with other code). I'll continue investigating. |
Hi @rdykiel, As you were asking for the place to debug: Lines 297 to 298 in 89128e8
By default, Jackson will pick up the A workaround would probably be through the |
Thanks for your analysis. I need to divert myself to an emergency so won't be able to work on this project for several days. And we have even some more time after that before this becomes a blocking issue for us. |
I've made the required fix. |
Wonderful! Yes there is no rush. LMK when the new release is available? Thanks for the quick turnaround. |
Release v4.37.0 has just been published containing the aforementioned fix. |
I have a Java object model structured as follows:
Using plain jsonschema I can generate a JSON schema where the 'deployment' object has the '_import' field. Note that the JsonProperty renaming the field to 'import' is ignored.
I then tried to use a JacksonModule in order to interpret Jackson annotations like JsonProperty and JsonPropertyDescription. The resulting JSON schemas are all missing the '_import' field. All the other fields are properly included, even the other one that is renamed via a JsonProperty. I verified that the JsonProperty and JsonPropertyDescription were properly rendered.
I don't know what it is with that '_import' property and after trying all the workarounds I could think of (including renaming '_import' to 'importers') I am opening this ticket.
Pending a resolution I would welcome any advice on how to debug this since I have downloaded the code. Thanks.
The text was updated successfully, but these errors were encountered: