jsonschema2pojo:generate
Full name:
org.jsonschema2pojo:jsonschema2pojo-maven-plugin:1.3.3:generate
Description:
When invoked, this goal reads one or more JSON Schema documents and generates DTO style Java classes for data binding.
See also: Mojo API Specification
Attributes:
- Requires a Maven project to be executed.
- Requires dependency resolution of artifacts in scope:
compile. - The goal is thread-safe and supports parallel builds.
- Binds by default to the lifecycle phase:
generate-sources.
Optional Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<addCompileSourceRoot> |
boolean |
0.1.9 |
Add the output directory to the project as a source root, so that the generated java types are compiled and included in the project artifact. Default: trueUser Property: jsonschema2pojo.addCompileSourceRoot |
<annotationStyle> |
String |
0.3.1 |
The style of annotations to use in the generated Java types.
Supported values:
Default: jackson2User Property: jsonschema2pojo.annotationStyle |
<classNamePrefix> |
String |
0.4.6 |
Whether to add a prefix to generated classes. User Property: jsonschema2pojo.classNamePrefix |
<classNameSuffix> |
String |
0.4.6 |
Whether to add a suffix to generated classes. User Property: jsonschema2pojo.classNameSuffix |
<constructorsRequiredPropertiesOnly> |
boolean |
0.4.8 |
The 'constructorsRequiredPropertiesOnly' configuration option. This is a legacy configuration option used to turn on isIncludeRequiredPropertiesConstructor() and off the isIncludeAllPropertiesConstructor() configuration options. It is specifically tied to the isIncludeConstructors() property, and will do nothing if that property is not enabledDefault: falseUser Property: jsonschema2pojo.constructorsRequiredPropertiesOnly |
<customAnnotator> |
String |
0.3.6 |
A fully qualified class name, referring to a custom annotator class that implements org.jsonschema2pojo.Annotator and will be used in addition to the one chosen by annotationStyle.
If you want to use the custom annotator alone, set Default: org.jsonschema2pojo.NoopAnnotatorUser Property: jsonschema2pojo.customAnnotator |
<customDatePattern> |
String |
0.4.33 |
A custom pattern to use when formatting date fields during serialization. Requires support from your JSON binding library. User Property: jsonschema2pojo.customDatePattern |
<customDateTimePattern> |
String |
0.4.33 |
A custom pattern to use when formatting date-time fields during serialization. Requires support from your JSON binding library. User Property: jsonschema2pojo.customDatePattern |
<customRuleFactory> |
String |
0.4.5 |
A fully qualified class name, referring to an class that extends org.jsonschema2pojo.rules.RuleFactory and will be used to create instances of Rules used for code generation.Default: org.jsonschema2pojo.rules.RuleFactoryUser Property: jsonschema2pojo.customRuleFactory |
<customTimePattern> |
String |
0.4.36 |
A custom pattern to use when formatting time fields during serialization. Requires support from your JSON binding library. User Property: jsonschema2pojo.customTimePattern |
<dateTimeType> |
String |
0.4.22 |
What type to use instead of string when adding string type fields of format date-time to generated Java types. User Property: jsonschema2pojo.dateTimeType |
<dateType> |
String |
0.4.22 |
What type to use instead of string when adding string type fields of format date (not date-time) to generated Java types. User Property: jsonschema2pojo.dateType |
<excludes> |
String[] |
0.4.3 |
List of file patterns to exclude. This only applies to the initial scan of the file system and will not prevent inclusion through a "$ref" in one of the schemas. |
<fileExtensions> |
String[] |
0.4.23 |
The strings (no preceeding dot) that should be considered as file name extensions, and therefore ignored, when creating Java class names. User Property: jsonschema2pojo.fileExtensions |
<formatDateTimes> |
boolean |
0.4.29 |
Whether the fields of type `date` are formatted during serialization with a default pattern of yyyy-MM-dd'T'HH:mm:ss.SSSZ. Default: falseUser Property: jsonschema2pojo.formatDateTimes |
<formatDates> |
boolean |
0.4.33 |
Whether the fields of type `date` are formatted during serialization with a default pattern of yyyy-MM-dd. Default: falseUser Property: jsonschema2pojo.formatDates |
<formatTimes> |
boolean |
0.4.36 |
Whether the fields of type `time` are formatted during serialization with a default pattern of HH:mm:ss.SSS. Default: falseUser Property: jsonschema2pojo.formatTimes |
<formatTypeMapping> |
Map<String,String> |
1.0.0 |
No description. User Property: jsonschema2pojo.formatTypeMapping |
<generateBuilders> |
boolean |
0.1.2 |
Whether to generate builder-style methods of the form withXxx(value) (that return this), alongside the standard, void-return setters.Default: falseUser Property: jsonschema2pojo.generateBuilders |
<includeAdditionalProperties> |
boolean |
0.4.14 |
Whether to allow 'additional properties' support in objects. Setting this to false will disable additional properties support, regardless of the input schema(s). Default: trueUser Property: jsonschema2pojo.includeAdditionalProperties |
<includeAllPropertiesConstructor> |
boolean |
1.0.3 |
The 'includeAllPropertiesConstructor' configuration option. This property works in collaboration with the isIncludeConstructors() configuration option and is incompatible with isConstructorsRequiredPropertiesOnly(), and will have no effect if isIncludeConstructors() is not set to true. If isIncludeConstructors() is set to true then this configuration determines whether the resulting object should include a constructor with all listed properties as parameters.Default: trueUser Property: jsonschema2pojo.includeAllPropertiesConstructor |
<includeConstructorPropertiesAnnotation> |
boolean |
1.0.2 |
No description. Default: falseUser Property: jsonschema2pojo.includeConstructorPropertiesAnnotation |
<includeConstructors> |
boolean |
0.4.8 |
Whether to generate constructors or not Default: falseUser Property: jsonschema2pojo.includeConstructors |
<includeCopyConstructor> |
boolean |
1.0.3 |
The 'includeCopyConstructor' configuration option. This property works in collaboration with the isIncludeConstructors() configuration option and is incompatible with isConstructorsRequiredPropertiesOnly(), and will have no effect if isIncludeConstructors() is not set to true. If isIncludeConstructors() is set to true then this configuration determines whether the resulting object should include a constructor the class itself as a parameter, with the expectation that all properties from the originating class will assigned to the new class.Default: falseUser Property: jsonschema2pojo.includeCopyConstructor |
<includeDynamicAccessors> |
boolean |
0.4.17 |
Whether to include dynamic getters, setters, and builders or to omit these methods. User Property: jsonschema2pojo.includeDynamicAccessors |
<includeDynamicBuilders> |
boolean |
- |
Whether to include dynamic builders or to omit these methods. Default: falseUser Property: jsonschema2pojo.includeDynamicBuilders |
<includeDynamicGetters> |
boolean |
- |
Whether to include dynamic getters or to omit these methods. Default: falseUser Property: jsonschema2pojo.includeDynamicGetters |
<includeDynamicSetters> |
boolean |
- |
Whether to include dynamic setters or to omit these methods. Default: falseUser Property: jsonschema2pojo.includeDynamicSetters |
<includeGeneratedAnnotation> |
boolean |
- |
Whether to include a javax.annotation.Generated (Java 8 and lower) or javax.annotation.processing.Generated (Java 9+) in on generated types. See also: targetVersion. Default: trueUser Property: jsonschema2pojo.includeGeneratedAnnotation |
<includeGetters> |
boolean |
- |
Whether to include getters or to omit this accessor method and create public fields instead Default: trueUser Property: jsonschema2pojo.includeGetters |
<includeHashcodeAndEquals> |
boolean |
0.3.1 |
Whether to include hashCode and equals methods in generated Java types.Default: trueUser Property: jsonschema2pojo.includeHashcodeAndEquals |
<includeJsr303Annotations> |
boolean |
0.3.2 |
Whether to include JSR-303/349 annotations (for schema rules like minimum, maximum, etc) in generated Java types.
Schema rules and the annotation they produce:
Default: falseUser Property: jsonschema2pojo.includeJsr303Annotations |
<includeJsr305Annotations> |
boolean |
0.4.8 |
Whether to include JSR-305 annotations (for schema rules like Nullable, NonNull, etc) in generated Java types. Default: falseUser Property: jsonschema2pojo.includeJsr305Annotations |
<includeRequiredPropertiesConstructor> |
boolean |
1.0.3 |
The 'includeRequiredPropertiesConstructor' configuration option. This property works in collaboration with the isIncludeConstructors() configuration option and is incompatible with isConstructorsRequiredPropertiesOnly(), and will have no effect if isIncludeConstructors() is not set to true. If isIncludeConstructors() is set to true then this configuration determines whether the resulting object should include a constructor with only the required properties as parameters.Default: falseUser Property: jsonschema2pojo.includeRequiredPropertiesConstructor |
<includeSetters> |
boolean |
- |
Whether to include setters or to omit this accessor method and create public fields instead Default: trueUser Property: jsonschema2pojo.includeSetters |
<includeToString> |
boolean |
0.3.1 |
Whether to include a toString method in generated Java types.Default: trueUser Property: jsonschema2pojo.includeToString |
<includeTypeInfo> |
boolean |
1.0.2 |
Whether to include json type information; often required to support polymorphic type handling.
By default the type information is stored in the @class property, this can be overridden in the deserializationClassProperty of the schema. Default: falseUser Property: jsonschema2pojo.includeTypeInfo |
<includes> |
String[] |
0.4.3 |
List of file patterns to include. |
<inclusionLevel> |
String |
- |
The Level of inclusion to set in the generated Java types for Jackson serializers.
Supported values
Default: NON_NULLUser Property: jsonschema2pojo.inclusionLevel |
<initializeCollections> |
boolean |
No version given |
Whether to initialize Set and List fields as empty collections, or leave them as null.Default: trueUser Property: jsonschema2pojo.initializeCollections |
<outputDirectory> |
File |
0.1.0 |
Target directory for generated Java source files. Default: ${project.build.directory}/generated-sources/jsonschema2pojoUser Property: jsonschema2pojo.outputDirectory |
<outputEncoding> |
String |
0.4.0 |
The character encoding that should be used when writing the generated Java source files. Default: UTF-8User Property: jsonschema2pojo.outputEncoding |
<parcelable> |
boolean |
0.4.11 |
Whether to make the generated types 'parcelable' (for Android development). Default: falseUser Property: jsonschema2pojo.parcelable |
<propertyWordDelimiters> |
String |
0.2.2 |
The characters that should be considered as word delimiters when creating Java Bean property names from JSON property names. If blank or not set, JSON properties will be considered to contain a single word when creating Java Bean property names. Default: - _User Property: jsonschema2pojo.propertyWordDelimiters |
<refFragmentPathDelimiters> |
String |
0.4.31 |
A string containing any characters that should act as path delimiters when resolving $ref fragments. By default, #, / and . are used in an attempt to support JSON Pointer and JSON Path. Default: #/.User Property: jsonschema2pojo.refFragmentPathDelimiters |
<removeOldOutput> |
boolean |
0.3.7 |
Whether to empty the target directory before generation occurs, to clear out all source files that have been generated previously.
Be warned, when activated this option will cause jsonschema2pojo to indiscriminately delete the entire contents of the target directory (all files and folders) before it begins generating sources. Default: falseUser Property: jsonschema2pojo.removeOldOutput |
<serializable> |
boolean |
0.4.23 |
Whether to make the generated types 'serializable'. Default: falseUser Property: jsonschema2pojo.serializable |
<skip> |
boolean |
0.2.1 |
Skip plugin execution (don't read/validate any schema files, don't generate any java types). Default: falseUser Property: jsonschema2pojo.skip |
<sourceDirectory> |
String |
0.1.0 |
Location of the JSON Schema file(s). Note: this may refer to a single file or a directory of files. User Property: jsonschema2pojo.sourceDirectory |
<sourcePaths> |
String[] |
0.3.1 |
An array of locations of the JSON Schema file(s). Note: each item may refer to a single file or a directory of files. User Property: jsonschema2pojo.sourcePaths |
<sourceSortOrder> |
String |
0.4.34 |
The sort order to be applied when recursively processing the source files. By default the OS can influence the processing order. Supported values:
Default: OSUser Property: jsonschema2pojo.sourceSortOrder |
<sourceType> |
String |
0.3.3 |
The type of input documents that will be read
Supported values:
Default: jsonschemaUser Property: jsonschema2pojo.sourceType |
<targetPackage> |
String |
0.1.0 |
Package name used for generated Java classes (for types where a fully qualified name has not been supplied in the schema using the 'javaType' property). User Property: jsonschema2pojo.targetPackage |
<targetVersion> |
String |
- |
The target version for generated source files, used whenever decisions are made about generating source code that may be incompatible with older JVMs. Acceptable values include e.g. 1.6, 1.8, 8, 9, 10, 11.
If not set, the value of targetVersion is auto-detected. For auto-detection, the first value found in the following list will be used:
User Property: jsonschema2pojo.targetVersion |
<timeType> |
String |
0.4.22 |
What type to use instead of string when adding string type fields of format time (not date-time) to generated Java types. User Property: jsonschema2pojo.timeType |
<toStringExcludes> |
String[] |
0.4.35 |
The fields to be excluded from toString generation User Property: jsonschema2pojo.toStringExcludes |
<useBigDecimals> |
boolean |
0.4.22 |
Whether to use the java type java.math.BigDecimal instead of float (or Float) when representing the JSON Schema type 'number'. Note that this configuration overrides isUseDoubleNumbers().Default: falseUser Property: jsonschema2pojo.useBigDecimals |
<useBigIntegers> |
boolean |
0.4.25 |
Whether to use the java type java.math.BigInteger instead of int (or Integer) when representing the JSON Schema type 'integer'. Note that this configuration overrides isUseLongIntegers().Default: falseUser Property: jsonschema2pojo.useBigIntegers |
<useDoubleNumbers> |
boolean |
0.4.0 |
Whether to use the java type double (or Double) instead of float (or Float) when representing the JSON Schema type 'number'.Default: trueUser Property: jsonschema2pojo.useDoubleNumbers |
<useInnerClassBuilders> |
boolean |
1.0.0 |
If set to true, then the gang of four builder pattern will be used to generate builders on generated classes. Note: This property works in collaboration with the isGenerateBuilders() method. If the isGenerateBuilders() is false, then this property will not do anything.Default: falseUser Property: jsonschema2pojo.useInnerClassBuilders |
<useJakartaValidation> |
boolean |
- |
Whether to use annotations from jakarta.validation package instead of javax.validation package when adding JSR-303 annotations to generated Java types. This property works in collaboration with the isIncludeJsr303Annotations() configuration option. If the isIncludeJsr303Annotations() returns false, then this configuration option will not affect anything.Default: falseUser Property: jsonschema2pojo.useJakartaValidation |
<useJodaDates> |
boolean |
0.4.0 |
Whether to use org.joda.time.DateTime instead of java.util.Date when adding date type fields to generated Java types.Default: falseUser Property: jsonschema2pojo.useJodaDates |
<useJodaLocalDates> |
boolean |
0.4.9 |
Whether to use org.joda.time.LocalDate instead of string when adding string type fields of format date (not date-time) to generated Java types.Default: falseUser Property: jsonschema2pojo.useJodaLocalDates |
<useJodaLocalTimes> |
boolean |
0.4.9 |
Whether to use org.joda.time.LocalTime instead of string when adding string type fields of format time (not date-time) to generated Java types.Default: falseUser Property: jsonschema2pojo.useJodaLocalTimes |
<useLongIntegers> |
boolean |
0.2.2 |
Whether to use the java type long (or Long) instead of int (or Integer) when representing the JSON Schema type 'integer'.Default: falseUser Property: jsonschema2pojo.useLongIntegers |
<useOptionalForGetters> |
boolean |
- |
Whether to use java.util.Optional as return type for getters of non-required fields.Default: falseUser Property: jsonschema2pojo.useOptionalForGetters |
<usePrimitives> |
boolean |
0.2.0 |
Whether to use primitives (long, double, boolean) instead of wrapper types where possible when generating bean properties (has the side-effect of making those properties non-null).Default: falseUser Property: jsonschema2pojo.usePrimitives |
<useTitleAsClassname> |
boolean |
1.0.0 |
Use the title as class name. Otherwise, the property and file name is used. Default: falseUser Property: jsonschema2pojo.useTitleAsClassname |
Parameter Details
<addCompileSourceRoot>
- Type:
boolean - Since:
0.1.9 - Required:
No - User Property:
jsonschema2pojo.addCompileSourceRoot - Default:
true
<annotationStyle>
Supported values:
jackson2(apply annotations from the Jackson 2.x library)jackson3(apply annotations from the Jackson 2.x library, and from Jackson 3.x databind for data-binding annotations)jackson(alias for jackson2)jsonb(apply annotations from the JSON-B 1.x library)jsonb2(apply annotations from the JSON-B 2.x library)gson(apply annotations from the gson library)moshi1(apply annotations from the moshi 1.x library)none(apply no annotations at all)
- Type:
java.lang.String - Since:
0.3.1 - Required:
No - User Property:
jsonschema2pojo.annotationStyle - Default:
jackson2
<classNamePrefix>
- Type:
java.lang.String - Since:
0.4.6 - Required:
No - User Property:
jsonschema2pojo.classNamePrefix
<classNameSuffix>
- Type:
java.lang.String - Since:
0.4.6 - Required:
No - User Property:
jsonschema2pojo.classNameSuffix
<constructorsRequiredPropertiesOnly>
isIncludeRequiredPropertiesConstructor() and off the isIncludeAllPropertiesConstructor() configuration options. It is specifically tied to the isIncludeConstructors() property, and will do nothing if that property is not enabled- Type:
boolean - Since:
0.4.8 - Required:
No - User Property:
jsonschema2pojo.constructorsRequiredPropertiesOnly - Default:
false
<customAnnotator>
org.jsonschema2pojo.Annotator and will be used in addition to the one chosen by annotationStyle.
If you want to use the custom annotator alone, set annotationStyle to none.
- Type:
java.lang.String - Since:
0.3.6 - Required:
No - User Property:
jsonschema2pojo.customAnnotator - Default:
org.jsonschema2pojo.NoopAnnotator
<customDatePattern>
- Type:
java.lang.String - Since:
0.4.33 - Required:
No - User Property:
jsonschema2pojo.customDatePattern
<customDateTimePattern>
- Type:
java.lang.String - Since:
0.4.33 - Required:
No - User Property:
jsonschema2pojo.customDatePattern
<customRuleFactory>
org.jsonschema2pojo.rules.RuleFactory and will be used to create instances of Rules used for code generation.- Type:
java.lang.String - Since:
0.4.5 - Required:
No - User Property:
jsonschema2pojo.customRuleFactory - Default:
org.jsonschema2pojo.rules.RuleFactory
<customTimePattern>
- Type:
java.lang.String - Since:
0.4.36 - Required:
No - User Property:
jsonschema2pojo.customTimePattern
<dateTimeType>
- Type:
java.lang.String - Since:
0.4.22 - Required:
No - User Property:
jsonschema2pojo.dateTimeType
<dateType>
- Type:
java.lang.String - Since:
0.4.22 - Required:
No - User Property:
jsonschema2pojo.dateType
<excludes>
- Type:
java.lang.String[] - Since:
0.4.3 - Required:
No
<fileExtensions>
- Type:
java.lang.String[] - Since:
0.4.23 - Required:
No - User Property:
jsonschema2pojo.fileExtensions
<formatDateTimes>
- Type:
boolean - Since:
0.4.29 - Required:
No - User Property:
jsonschema2pojo.formatDateTimes - Default:
false
<formatDates>
- Type:
boolean - Since:
0.4.33 - Required:
No - User Property:
jsonschema2pojo.formatDates - Default:
false
<formatTimes>
- Type:
boolean - Since:
0.4.36 - Required:
No - User Property:
jsonschema2pojo.formatTimes - Default:
false
<formatTypeMapping>
- Type:
java.util.Map<java.lang.String, java.lang.String> - Since:
1.0.0 - Required:
No - User Property:
jsonschema2pojo.formatTypeMapping
<generateBuilders>
withXxx(value) (that return this), alongside the standard, void-return setters.- Type:
boolean - Since:
0.1.2 - Required:
No - User Property:
jsonschema2pojo.generateBuilders - Default:
false
<includeAdditionalProperties>
- Type:
boolean - Since:
0.4.14 - Required:
No - User Property:
jsonschema2pojo.includeAdditionalProperties - Default:
true
<includeAllPropertiesConstructor>
isIncludeConstructors() configuration option and is incompatible with isConstructorsRequiredPropertiesOnly(), and will have no effect if isIncludeConstructors() is not set to true. If isIncludeConstructors() is set to true then this configuration determines whether the resulting object should include a constructor with all listed properties as parameters.- Type:
boolean - Since:
1.0.3 - Required:
No - User Property:
jsonschema2pojo.includeAllPropertiesConstructor - Default:
true
<includeConstructorPropertiesAnnotation>
- Type:
boolean - Since:
1.0.2 - Required:
No - User Property:
jsonschema2pojo.includeConstructorPropertiesAnnotation - Default:
false
<includeConstructors>
- Type:
boolean - Since:
0.4.8 - Required:
No - User Property:
jsonschema2pojo.includeConstructors - Default:
false
<includeCopyConstructor>
isIncludeConstructors() configuration option and is incompatible with isConstructorsRequiredPropertiesOnly(), and will have no effect if isIncludeConstructors() is not set to true. If isIncludeConstructors() is set to true then this configuration determines whether the resulting object should include a constructor the class itself as a parameter, with the expectation that all properties from the originating class will assigned to the new class.- Type:
boolean - Since:
1.0.3 - Required:
No - User Property:
jsonschema2pojo.includeCopyConstructor - Default:
false
<includeDynamicAccessors>
- Type:
boolean - Since:
0.4.17 - Required:
No - User Property:
jsonschema2pojo.includeDynamicAccessors
<includeDynamicBuilders>
- Type:
boolean - Required:
No - User Property:
jsonschema2pojo.includeDynamicBuilders - Default:
false
<includeDynamicGetters>
- Type:
boolean - Required:
No - User Property:
jsonschema2pojo.includeDynamicGetters - Default:
false
<includeDynamicSetters>
- Type:
boolean - Required:
No - User Property:
jsonschema2pojo.includeDynamicSetters - Default:
false
<includeGeneratedAnnotation>
- Type:
boolean - Required:
No - User Property:
jsonschema2pojo.includeGeneratedAnnotation - Default:
true
<includeGetters>
- Type:
boolean - Required:
No - User Property:
jsonschema2pojo.includeGetters - Default:
true
<includeHashcodeAndEquals>
hashCode and equals methods in generated Java types.- Type:
boolean - Since:
0.3.1 - Required:
No - User Property:
jsonschema2pojo.includeHashcodeAndEquals - Default:
true
<includeJsr303Annotations>
Schema rules and the annotation they produce:
- maximum = @DecimalMax
- minimum = @DecimalMin
- minItems,maxItems = @Size
- minLength,maxLength = @Size
- pattern = @Pattern
- required = @NotNull
- Type:
boolean - Since:
0.3.2 - Required:
No - User Property:
jsonschema2pojo.includeJsr303Annotations - Default:
false
<includeJsr305Annotations>
- Type:
boolean - Since:
0.4.8 - Required:
No - User Property:
jsonschema2pojo.includeJsr305Annotations - Default:
false
<includeRequiredPropertiesConstructor>
isIncludeConstructors() configuration option and is incompatible with isConstructorsRequiredPropertiesOnly(), and will have no effect if isIncludeConstructors() is not set to true. If isIncludeConstructors() is set to true then this configuration determines whether the resulting object should include a constructor with only the required properties as parameters.- Type:
boolean - Since:
1.0.3 - Required:
No - User Property:
jsonschema2pojo.includeRequiredPropertiesConstructor - Default:
false
<includeSetters>
- Type:
boolean - Required:
No - User Property:
jsonschema2pojo.includeSetters - Default:
true
<includeToString>
toString method in generated Java types.- Type:
boolean - Since:
0.3.1 - Required:
No - User Property:
jsonschema2pojo.includeToString - Default:
true
<includeTypeInfo>
By default the type information is stored in the @class property, this can be overridden in the deserializationClassProperty of the schema.
- Type:
boolean - Since:
1.0.2 - Required:
No - User Property:
jsonschema2pojo.includeTypeInfo - Default:
false
<includes>
- Type:
java.lang.String[] - Since:
0.4.3 - Required:
No
<inclusionLevel>
Supported values
ALWAYSNON_ABSENTNON_DEFAULTNON_EMPTYNON_NULLUSE_DEFAULTS
- Type:
java.lang.String - Required:
No - User Property:
jsonschema2pojo.inclusionLevel - Default:
NON_NULL
<initializeCollections>
null.- Type:
boolean - Since:
No version given - Required:
No - User Property:
jsonschema2pojo.initializeCollections - Default:
true
<outputDirectory>
- Type:
java.io.File - Since:
0.1.0 - Required:
No - User Property:
jsonschema2pojo.outputDirectory - Default:
${project.build.directory}/generated-sources/jsonschema2pojo
<outputEncoding>
- Type:
java.lang.String - Since:
0.4.0 - Required:
No - User Property:
jsonschema2pojo.outputEncoding - Default:
UTF-8
<parcelable>
- Type:
boolean - Since:
0.4.11 - Required:
No - User Property:
jsonschema2pojo.parcelable - Default:
false
<propertyWordDelimiters>
- Type:
java.lang.String - Since:
0.2.2 - Required:
No - User Property:
jsonschema2pojo.propertyWordDelimiters - Default:
- _
<refFragmentPathDelimiters>
- Type:
java.lang.String - Since:
0.4.31 - Required:
No - User Property:
jsonschema2pojo.refFragmentPathDelimiters - Default:
#/.
<removeOldOutput>
Be warned, when activated this option will cause jsonschema2pojo to indiscriminately delete the entire contents of the target directory (all files and folders) before it begins generating sources.
- Type:
boolean - Since:
0.3.7 - Required:
No - User Property:
jsonschema2pojo.removeOldOutput - Default:
false
<serializable>
- Type:
boolean - Since:
0.4.23 - Required:
No - User Property:
jsonschema2pojo.serializable - Default:
false
<skip>
- Type:
boolean - Since:
0.2.1 - Required:
No - User Property:
jsonschema2pojo.skip - Default:
false
<sourceDirectory>
- Type:
java.lang.String - Since:
0.1.0 - Required:
No - User Property:
jsonschema2pojo.sourceDirectory
<sourcePaths>
- Type:
java.lang.String[] - Since:
0.3.1 - Required:
No - User Property:
jsonschema2pojo.sourcePaths
<sourceSortOrder>
OS(Let the OS influence the order the source files are processed.)FILES_FIRST(Case sensitive sort, visit the files first. The source files are processed in a breadth first sort order.)SUBDIRS_FIRST(Case sensitive sort, visit the sub-directories before the files. The source files are processed in a depth first sort order.)
- Type:
java.lang.String - Since:
0.4.34 - Required:
No - User Property:
jsonschema2pojo.sourceSortOrder - Default:
OS
<sourceType>
Supported values:
jsonschema(schema documents, containing formal rules that describe the structure of JSON data)json(documents that represent an example of the kind of JSON data that the generated Java types will be mapped to)yamlschema(JSON schema documents, represented as YAML)yaml(documents that represent an example of the kind of YAML (or JSON) data that the generated Java types will be mapped to)
- Type:
java.lang.String - Since:
0.3.3 - Required:
No - User Property:
jsonschema2pojo.sourceType - Default:
jsonschema
<targetPackage>
- Type:
java.lang.String - Since:
0.1.0 - Required:
No - User Property:
jsonschema2pojo.targetPackage
<targetVersion>
- maven.compiler.source property
- maven.compiler.release property
- maven-compiler-plugin 'source' configuration option
- maven-compiler-plugin 'release' configuration option
- the current JVM version
- Type:
java.lang.String - Required:
No - User Property:
jsonschema2pojo.targetVersion
<timeType>
- Type:
java.lang.String - Since:
0.4.22 - Required:
No - User Property:
jsonschema2pojo.timeType
<toStringExcludes>
- Type:
java.lang.String[] - Since:
0.4.35 - Required:
No - User Property:
jsonschema2pojo.toStringExcludes
<useBigDecimals>
java.math.BigDecimal instead of float (or Float) when representing the JSON Schema type 'number'. Note that this configuration overrides isUseDoubleNumbers().- Type:
boolean - Since:
0.4.22 - Required:
No - User Property:
jsonschema2pojo.useBigDecimals - Default:
false
<useBigIntegers>
java.math.BigInteger instead of int (or Integer) when representing the JSON Schema type 'integer'. Note that this configuration overrides isUseLongIntegers().- Type:
boolean - Since:
0.4.25 - Required:
No - User Property:
jsonschema2pojo.useBigIntegers - Default:
false
<useDoubleNumbers>
double (or Double) instead of float (or Float) when representing the JSON Schema type 'number'.- Type:
boolean - Since:
0.4.0 - Required:
No - User Property:
jsonschema2pojo.useDoubleNumbers - Default:
true
<useInnerClassBuilders>
isGenerateBuilders() method. If the isGenerateBuilders() is false, then this property will not do anything.- Type:
boolean - Since:
1.0.0 - Required:
No - User Property:
jsonschema2pojo.useInnerClassBuilders - Default:
false
<useJakartaValidation>
jakarta.validation package instead of javax.validation package when adding JSR-303 annotations to generated Java types. This property works in collaboration with the isIncludeJsr303Annotations() configuration option. If the isIncludeJsr303Annotations() returns false, then this configuration option will not affect anything.- Type:
boolean - Required:
No - User Property:
jsonschema2pojo.useJakartaValidation - Default:
false
<useJodaDates>
org.joda.time.DateTime instead of java.util.Date when adding date type fields to generated Java types.- Type:
boolean - Since:
0.4.0 - Required:
No - User Property:
jsonschema2pojo.useJodaDates - Default:
false
<useJodaLocalDates>
org.joda.time.LocalDate instead of string when adding string type fields of format date (not date-time) to generated Java types.- Type:
boolean - Since:
0.4.9 - Required:
No - User Property:
jsonschema2pojo.useJodaLocalDates - Default:
false
<useJodaLocalTimes>
org.joda.time.LocalTime instead of string when adding string type fields of format time (not date-time) to generated Java types.- Type:
boolean - Since:
0.4.9 - Required:
No - User Property:
jsonschema2pojo.useJodaLocalTimes - Default:
false
<useLongIntegers>
long (or Long) instead of int (or Integer) when representing the JSON Schema type 'integer'.- Type:
boolean - Since:
0.2.2 - Required:
No - User Property:
jsonschema2pojo.useLongIntegers - Default:
false
<useOptionalForGetters>
java.util.Optional as return type for getters of non-required fields.- Type:
boolean - Required:
No - User Property:
jsonschema2pojo.useOptionalForGetters - Default:
false
<usePrimitives>
long, double, boolean) instead of wrapper types where possible when generating bean properties (has the side-effect of making those properties non-null).- Type:
boolean - Since:
0.2.0 - Required:
No - User Property:
jsonschema2pojo.usePrimitives - Default:
false
<useTitleAsClassname>
- Type:
boolean - Since:
1.0.0 - Required:
No - User Property:
jsonschema2pojo.useTitleAsClassname - Default:
false
