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

generate facets and annotations with mappings

Open amarant opened this issue 9 years ago • 4 comments

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.

amarant avatar Feb 19 '16 10:02 amarant

Which ones do you need, specifically? I think many are already exported, which ones are you missing?

highsource avatar Feb 19 '16 10:02 highsource

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

amarant avatar Feb 19 '16 13:02 amarant

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!

gmoyanollc avatar Feb 09 '17 00:02 gmoyanollc

Yes, i do see several similar other issue threads on missing facets minLength, maxLength, pattern. And i am also missing this!

mvlare avatar Jul 21 '20 19:07 mvlare