Skip to content

Properties with special character in the name (#, /, etc) cause IllegalArgumentException 'Path not present' when using 1.1.2 #1402

Closed

Description

@Solksjaer

After updating to version org.jsonschema2pojo:jsonschema2pojo-gradle-plugin 1.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#

{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$ref": "#/definitions/BusinessData",
  "definitions": {
    "BusinessData": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "VERSV#": {
          "type": "string"
        },
        "HEADER": {
          "$ref": "#/definitions/Header"
        }
      },
      "title": "BusinessData"
    }
}

Activity

  1. joelittlejohn commented on May 9, 2022

    @joelittlejohn
    Owner

    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.

  2. Solksjaer commented on May 9, 2022

    @Solksjaer
    Author

    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

  3. added a commit that references this issue on May 10, 2022
    e4e1678
  4. machineidiot commented on Jan 19, 2023

    @machineidiot

    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.

  5. joelittlejohn commented on Jan 19, 2023

    @joelittlejohn
    Owner

    @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.

  6. unkish commented on Jan 19, 2023

    @unkish
    Collaborator

    Slight OT: should we close #1407 as duplicate of #1402 ?

  7. machineidiot commented on Jan 19, 2023

    @machineidiot

    @joelittlejohn That is very excellent news, thank you for the quick response.

  8. added 3 commits that reference this issue on Jan 21, 2023
    22dde3f
    fc0327e
    d219e36
  9. changed the title [-]Schema Attributes with #[/-] [+]Properties with special character in the name (#, /, etc) cause IllegalArgumentException from FragmentResolver [/+] on Jan 21, 2023
  10. 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
  11. 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
  12. 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
  13. added 2 commits that reference this issue on Jan 22, 2023
    ef96d5a
    cd20d19
  14. added a commit that references this issue on Jan 25, 2023
    9315b7b
  15. added this to the 1.1.3 milestone on Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions