Skip to content

Commit d25c011

Browse files
authored
Merge pull request #7 from swisspost/develop
Add format mapping for double, float and ignore unknown formats
2 parents 8fae0c8 + ebee638 commit d25c011

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>org.swisspush.maven.plugins</groupId>
44
<artifactId>jsons2xsd-maven-plugin</artifactId>
55
<packaging>maven-plugin</packaging>
6-
<version>1.0.3-SNAPSHOT</version>
6+
<version>1.0.4-SNAPSHOT</version>
77
<name>jsons2xsd Maven Mojo</name>
88
<description>jsons2xsd Maven Mojo</description>
99
<url>https://github.com/swisspush/jsons2xsd-maven-plugin</url>

src/main/java/org/swisspush/jsons2xsd/Jsons2XsdMojo.java

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ private void generate(File input, File output) throws IOException {
9292
.customTypeMapping(JsonSimpleType.INTEGER, "long", XsdSimpleType.LONG)
9393
.customTypeMapping(JsonSimpleType.INTEGER, "int64", XsdSimpleType.LONG)
9494
.customTypeMapping(JsonSimpleType.STRING, "uuid", XsdSimpleType.STRING)
95+
.customTypeMapping(JsonSimpleType.NUMBER, "double", XsdSimpleType.DECIMAL)
96+
.customTypeMapping(JsonSimpleType.NUMBER, "float", XsdSimpleType.DECIMAL)
97+
.ignoreUnknownFormats(true)
9598
.validateXsdSchema(false);
9699

97100
if(useGenericItemNames) {

0 commit comments

Comments
 (0)