Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON-Schema generated from XSD does not use maxLength #68

Open
Madoc opened this issue Jun 17, 2016 · 1 comment
Open

JSON-Schema generated from XSD does not use maxLength #68

Madoc opened this issue Jun 17, 2016 · 1 comment

Comments

@Madoc
Copy link

Madoc commented Jun 17, 2016

After using the Maven plugin for generating a JSON-Schema from an XSD (which is included in a WSDL), I notice that the maximum length restrictions are not reflected in the JSON-Schema.

Here is a simplified and cut version of my XSD:

<schema targetNamespace="http://www.somecompany.com/wsdl/Test.wsdl"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:tns="http://www.somecompany.com/wsdl/Test.wsdl">
  <element name="SomeElement">
    <complexType>
      <sequence>
        <element name="someElementId" type="long" minOccurs="1" maxOccurs="1"/>
        <element name="limitedString" type="tns:LimitedString" minOccurs="1" maxOccurs="1"/>
      </sequence>
    </complexType>
  </element>
  <simpleType name="LimitedString">
    <restriction base="string">
      <maxLength value="50"/>
    </restriction>
  </simpleType>
</schema>

The maxLength is not represented in the generated JSON-Schema. This is unfortunate, as I want to pass on the JSON-Schema to other parties as a technical documentation, and tell them that if their JSON validates with the schema, it's good for me to accept.

Is there any good way how I can have the JSON-Schema generated with maxLength?

@marcinrog
Copy link

marcinrog commented Jun 27, 2019

Any news on that issue? I would be really helpful for me too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants