jsonix-schema-compiler icon indicating copy to clipboard operation
jsonix-schema-compiler copied to clipboard

Extraneous lines?

Open pdesmarets opened this issue 10 years ago • 3 comments
trafficstars

Couldn't this output from the compiler:

    "allOf":[
        {
            "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string"
        }
    ]
...

just as simply be written as:

"type":"string"

Same thing for boolean?

pdesmarets avatar Sep 03 '15 10:09 pdesmarets

In principle, yes, but I'd prefer referencing an XML Schema type. There are also ints and integers and they have to be used form XMLSchema.jsonschema as they have constraints imposed by the XML Schema specs.

So that would be a bit weird to have "type":"string" in one place and references to XMLSchema.jsonschema on other. I'd prefer homogeneous type referencing. What do you think?

highsource avatar Sep 03 '15 10:09 highsource

I'm no specialist. Personally, I think that the reference, if it doesn't add value, makes the file less legible. So I did a find/replace for the 70+ cases in my file. Maybe an option could leave the choice to the operator. Same thing when all the namespaceURI are all identical. Some people like verbose outputs, others like succinct...

pdesmarets avatar Sep 03 '15 11:09 pdesmarets

Yes, makes sense. But I won't leave it to the user.

highsource avatar Sep 03 '15 12:09 highsource