Search code examples
jsonix

jsonix properties - ogc-schemas .js aren't same


The manual on jsonix properties at https://github.com/highsource/jsonix/wiki/Properties shows properties as being something like:

name: 'MyModule',
    typeInfos: [{
        type: 'classInfo',
        localName: 'InputType',
        propertyInfos: [{
            type: 'attribute',
            typeInfo: 'Boolean',
            name: 'checked'
        }]
    }],

But then (after npm install ogc-schemas) what I am seeing is:

    ln: 'TimeClockPropertyType',
    ps: [{
        n: 'timeClock',
        rq: true,
        en: 'TimeClock',
        ti: '.TimeClockType'
      },

With the abbreviated names.

Which should it be and why doesn't it matter if it doesn't?


Solution

  • Disclaimer: I'm the author of jsonix.

    This is what's called compact naming. This is an option of the Jsonix Schema Compiler which generates shorter names in mappings, like n instead of name or dens instead of defaultElementNamespaceURI. The goal is clearly to make mappings smaller and since ogc-schemas are pretty large, they are compiled with compact naming by default.

    If you want standard naming, fork and remove

    <arg>-Xjsonix-compact</arg>
    

    from all the pom.xmls.

    Both compact and standard names work in runtime, I think standard names have higher priority.