IntelliJ plugin XSD to JSON Schema

This should cover W3C XML Schema, Relax NG and DTD related problems.
mikahase
Posts: 2
Joined: Fri May 05, 2023 2:55 pm

IntelliJ plugin XSD to JSON Schema

Post by mikahase »

Hi!
I'm trying to convert a large XSD and hit an error saying I'm running into EnumMemberSizeCap limit. It's suggesting I use customization attribute "typesafeEnumMaxMembers" to extend the limit.
How is this done? I'm on M1 MacBook and OS X 13 and IntelliJ 2023.1
Cheers,
Mikael
florin_nica
Posts: 32
Joined: Wed Sep 09, 2020 3:17 pm

Re: IntelliJ plugin XSD to JSON Schema

Post by florin_nica »

Hello,

Thank you for the feedback. Most likely, your XSD file contains a large enumeration that exceeds the default limit of 256 elements. You can use the customization attribute typesafeEnumMaxMembers to extend this limit. For example, if you want to extend it to 1000, you need to add inside the XSD file some JAXB specific bindings, that look like this:

Code: Select all

<xs:annotation>
	<xs:appinfo>
		<jaxb:globalBindings typesafeEnumMaxMembers="1000" />
	</xs:appinfo>
</xs:annotation>
You also need to add the attributes "xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1" to the <schema> element, so that the jaxb prefix is recognized.

Regards,
Florin
mikahase
Posts: 2
Joined: Fri May 05, 2023 2:55 pm

Re: IntelliJ plugin XSD to JSON Schema

Post by mikahase »

Thank you! This solved my issue
Post Reply