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

Add format mapping for double, float and ignore unknown formats #7

Merged
merged 8 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<groupId>org.swisspush.maven.plugins</groupId>
<artifactId>jsons2xsd-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1.0.3-SNAPSHOT</version>
<version>1.0.4-SNAPSHOT</version>
<name>jsons2xsd Maven Mojo</name>
<description>jsons2xsd Maven Mojo</description>
<url>https://github.com/swisspush/jsons2xsd-maven-plugin</url>
3 changes: 3 additions & 0 deletions src/main/java/org/swisspush/jsons2xsd/Jsons2XsdMojo.java
Original file line number Diff line number Diff line change
@@ -92,6 +92,9 @@ private void generate(File input, File output) throws IOException {
.customTypeMapping(JsonSimpleType.INTEGER, "long", XsdSimpleType.LONG)
.customTypeMapping(JsonSimpleType.INTEGER, "int64", XsdSimpleType.LONG)
.customTypeMapping(JsonSimpleType.STRING, "uuid", XsdSimpleType.STRING)
.customTypeMapping(JsonSimpleType.NUMBER, "double", XsdSimpleType.DECIMAL)
.customTypeMapping(JsonSimpleType.NUMBER, "float", XsdSimpleType.DECIMAL)
.ignoreUnknownFormats(true)
.validateXsdSchema(false);

if(useGenericItemNames) {