jsonix-schema-compiler
jsonix-schema-compiler copied to clipboard
generate facets and annotations with mappings
Hi, it would be great if the mappings could transport the xsd facets : minLength, pattern (even if they are not fully compatible with JS regex), ..., like it does with minLength/maxLength; and the annotations. I use the mappings to introspect a schema set, and it is far easier to use than the xsd mapped in json with jsonix. It could be optional to not add weight to the mappings. Thanks.
Which ones do you need, specifically? I think many are already exported, which ones are you missing?
Currently there is no facets on the data type I though : https://www.w3.org/TR/xmlschema-2/#rf-facets
- length
- minLength
- maxLength
- pattern
- enumeration
- whiteSpace
- maxInclusive
- maxExclusive
- minExclusive
- minInclusive
- totalDigits
- fractionDigits
There is only element restriction, like minOccurs and maxOccurs : https://www.w3.org/TR/2001/REC-xmlschema-0-20010502/#ref6
Is JAXB the reason why xs:annotation and simple type facets, e.g., as xs:pattern, xs:length, xs:enumeration, are missing?
- https://jaxb.java.net/guide/Generating_Schema_that_you_want.html
- https://java.net/jira/browse/JAXB-917 Maybe this simple extension to JAXB RI may help:
- https://github.com/whummer/jaxb-facets)
It seems the Java community is hurting and JAXB may be another casualty as JavaScript is taking in droves of developers!
Yes, i do see several similar other issue threads on missing facets minLength, maxLength, pattern. And i am also missing this!