You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Properties with special character in the name (#, /, etc) cause IllegalArgumentException 'Path not present' when using 1.1.2 #1402
After updating to version org.jsonschema2pojo:jsonschema2pojo-gradle-plugin1.1.2 of the plugin, we are no longer able to generate classes when the attributes contain #
This was possible on version 1.1.1
For example VERSV#
Interesting. I assume in the past you got a java property named like versv_? Not sure what has caused this but this isn't an expected change. We have any test using this kind of name so we should add one.
actually, the property is named just versv (although we could potentially rename it, if the code generation prefers other kind of nomenclature).
The biggest issue would be the input data, because we don´t have control over it and the # properties appear in different places.
Thanks for taking a look at it
Is there any roadmap for when a version containing the fix for this will be released? This issue breaks code generation from redfish schemas (example property name: "#Chassis.Reset") and in our case, this has unfortunately had a huge side effect of blocking Java EE to Jakarta migration as we are unable to uplift jsonschema2pojo so we can generate jakarta-annotated classes.
If there is no new jsonschema2pojo release on the near horizon, is there any way for us to work around this? I guess we could patch FragmentResolver and SchemaStore ourselves in-house or use jsonschema2pojo built from the latest source but we would like to avoid that if possible as both alternatives would have impact on our processes and CI. Using an unreleased version might potentially not even be an option at all. We also have no control over the input, so schema changes are not an option either.
@prndrsn I revisited this fix over last weekend. I had to rethink the solution to be more complete. I will try to get out a new version that includes this fix this week, as we have quite a few unreleased changed now.
changed the title [-]Schema Attributes with #[/-][+]Properties with special character in the name (#, /, etc) cause IllegalArgumentException from FragmentResolver [/+]on Jan 21, 2023
changed the title [-]Properties with special character in the name (#, /, etc) cause IllegalArgumentException from FragmentResolver [/-][+]Properties with special character in the name (#, /, etc) cause IllegalArgumentException from FragmentResolver when using 1.1.2[/+]on Jan 21, 2023
changed the title [-]Properties with special character in the name (#, /, etc) cause IllegalArgumentException from FragmentResolver when using 1.1.2[/-][+]Properties with special character in the name (#, /, etc) cause IllegalArgumentException 'Path not present' from FragmentResolver when using 1.1.2[/+]on Jan 21, 2023
changed the title [-]Properties with special character in the name (#, /, etc) cause IllegalArgumentException 'Path not present' from FragmentResolver when using 1.1.2[/-][+]Properties with special character in the name (#, /, etc) cause IllegalArgumentException 'Path not present' when using 1.1.2[/+]on Jan 21, 2023
Activity
joelittlejohn commentedon May 9, 2022
Interesting. I assume in the past you got a java property named like
versv_? Not sure what has caused this but this isn't an expected change. We have any test using this kind of name so we should add one.Solksjaer commentedon May 9, 2022
actually, the property is named just
versv(although we could potentially rename it, if the code generation prefers other kind of nomenclature).The biggest issue would be the input data, because we don´t have control over it and the
#properties appear in different places.Thanks for taking a look at it
Allow JSON properties that contain a '#' character
machineidiot commentedon Jan 19, 2023
Is there any roadmap for when a version containing the fix for this will be released? This issue breaks code generation from redfish schemas (example property name: "#Chassis.Reset") and in our case, this has unfortunately had a huge side effect of blocking Java EE to Jakarta migration as we are unable to uplift jsonschema2pojo so we can generate jakarta-annotated classes.
If there is no new jsonschema2pojo release on the near horizon, is there any way for us to work around this? I guess we could patch FragmentResolver and SchemaStore ourselves in-house or use jsonschema2pojo built from the latest source but we would like to avoid that if possible as both alternatives would have impact on our processes and CI. Using an unreleased version might potentially not even be an option at all. We also have no control over the input, so schema changes are not an option either.
joelittlejohn commentedon Jan 19, 2023
@prndrsn I revisited this fix over last weekend. I had to rethink the solution to be more complete. I will try to get out a new version that includes this fix this week, as we have quite a few unreleased changed now.
unkish commentedon Jan 19, 2023
Slight OT: should we close #1407 as duplicate of #1402 ?
machineidiot commentedon Jan 19, 2023
@joelittlejohn That is very excellent news, thank you for the quick response.
Encode property names are escaped when building ref to property
Encode property names when building path to property
Encode property names when building path to property
[-]Schema Attributes with #[/-][+]Properties with special character in the name (#, /, etc) cause IllegalArgumentException from FragmentResolver [/+][-]Properties with special character in the name (#, /, etc) cause IllegalArgumentException from FragmentResolver [/-][+]Properties with special character in the name (#, /, etc) cause IllegalArgumentException from FragmentResolver when using 1.1.2[/+][-]Properties with special character in the name (#, /, etc) cause IllegalArgumentException from FragmentResolver when using 1.1.2[/-][+]Properties with special character in the name (#, /, etc) cause IllegalArgumentException 'Path not present' from FragmentResolver when using 1.1.2[/+][-]Properties with special character in the name (#, /, etc) cause IllegalArgumentException 'Path not present' from FragmentResolver when using 1.1.2[/-][+]Properties with special character in the name (#, /, etc) cause IllegalArgumentException 'Path not present' when using 1.1.2[/+]Encode property names when building path to property
Encode property names when building path to property
Encode property names when building path to property (#1465)