Uploaded image for project: 'Johnzon'
  1. Johnzon
  2. JOHNZON-307

POJO's field or method name containing the $ character is not serialized

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Abandoned
    • 1.1.12, 1.2.3
    • 1.2.6
    • Mapper
    • None
    • Important

    Description

      We are building an Open API 3.0 generator based on io.swagger.core.v3:swagger-models:2.1.1. The features coming from the version 3.0 are mandatory for us, specially the ability to make references.
      However references use the $ref (Structuring a complex JSON schema) keyword in the JSON key.
      example:

      "schema": {
       "$ref": "#/components/schemas/user" 
      }

      Since the commit bcf51d2e5b1267dcf317816b7db759460cb3c715 (more global exclude rules for fields and methods), every field or method name containing the $ is ignore and not serialized.

       

      Currently, we extended the classes:
      com.onwbp.org.apache.johnzon.mapper.access.FieldAccessMode
      com.onwbp.org.apache.johnzon.mapper.access.MethodAccessMode

      to override this behavior.
      Unfortunatly, the class com.onwbp.org.apache.johnzon.mapper.access.FieldAndMethodAccessMode and every classes making direct references to them have to be forked to use our extensions.

      Since the isIgnored method is protected we though that the behavior could be easily overriden.

      Can the ignore filter be fixed to allow, at least, the $ref keyword ?
      In absence of fix, can you provide us the best way to override the ignore filter algorithm ?

      Note: since $id and $schema are specified as well in the JSON Schema, they should not be filtered when present in POJO's field or method name.

      Attachments

        Activity

          People

            Unassigned Unassigned
            BenoitP Benoit Prudhomme
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: