Skip to content

EnumMemberSizeCap Limit

Alexey Valikov edited this page Sep 4, 2015 · 1 revision

EnumMemberSizeCap Limit

If you compile a schema which has a simple type with many enumerations, you'll get the following warning:

[WARNING] Simple type "myEnumType" was not mapped to Enum due to EnumMemberSizeCap limit. Facets count: 512, current limit: 256. You can use customization attribute "typesafeEnumMaxMembers" to extend the limit.

To correct this, use the customization attribute typesafeEnumMaxMembers just as the warning points out.

Define the following in your bindings.xjb file:

<?xml version="1.0" ?>
<jaxb:bindings version="1.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" schemaLocation="mySchema.xsd">
        <jaxb:bindings>
            <jaxb:globalBindings typesafeEnumMaxMembers="1024"/>
        </jaxb:bindings>
</jaxb:bindings>

Use the bindings file when compiling the schema:

$ java -jar jsonix-schema-compiler-full.jar mySchema.xsd -b bindings.xjb

See the following issue for more information.

Many thanks to @coderextreme for pointing this out.

Clone this wiki locally