Skip to content

Commit

Permalink
Update snapshot versions
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesarnal committed Nov 28, 2023
1 parent 5fcfb56 commit 9b49ae8
Show file tree
Hide file tree
Showing 23 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-codegen-parent</artifactId>
<version>1.0.13</version>
<version>1.1.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

import javax.lang.model.SourceVersion;

import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JFieldVar;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.commonmark.parser.Parser;
Expand Down Expand Up @@ -133,6 +135,11 @@ public boolean isIncludeAdditionalProperties() {
public boolean isIncludeToString() {
return false;
}

@Override
public boolean isFormatDateTimes() {
return false;
}
};
protected static JavaBeanPostProcessor postProcessor = new JavaBeanPostProcessor();

Expand Down Expand Up @@ -858,7 +865,7 @@ private void generateJavaBean(CodegenJavaBean bean, CodegenInfo info, IndexedCod
String generatedBeanFQCN = generatedBeanPackage + "." + generatedBeanName;

SchemaMapper schemaMapper = new SchemaMapper(
new JaxRsRuleFactory(config, new Jackson2Annotator(config), new SchemaStore() {
new JaxRsRuleFactory(config, new JaxRsJackson2Annotator(info, config), new SchemaStore() {
@Override
public Schema create(Schema parent, String path, String refFragmentPathDelimiters) {
String beanClassname = schemaRefToFQCN(path);
Expand Down Expand Up @@ -993,4 +1000,23 @@ public Rule<JClassContainer, JType> getEnumRule() {
}
}

public static class JaxRsJackson2Annotator extends Jackson2Annotator {

private CodegenInfo codegenInfo;

/**
* Constructor.
*/
public JaxRsJackson2Annotator(CodegenInfo codegenInfo, GenerationConfig generationConfig) {
super(generationConfig);
this.codegenInfo = codegenInfo;
}

@Override
public void dateTimeField(JFieldVar field, JDefinedClass clazz, JsonNode node) {
if (!codegenInfo.getSuppressDateTimeFormats()) {
super.dateTimeField(field, clazz, node);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class CodegenInfo {
private List<CodegenJavaBean> beans = new ArrayList<>();
private String contextRoot = "";
private List<CodegenBeanAnnotationDirective> beanAnnotations = new ArrayList<>();
private Boolean suppressDateTimeFormats = Boolean.FALSE;

/**
* Constructor.
Expand Down Expand Up @@ -136,4 +137,11 @@ public void setBeanAnnotations(List<CodegenBeanAnnotationDirective> beanAnnotati
this.beanAnnotations = beanAnnotations;
}

public Boolean getSuppressDateTimeFormats() {
return suppressDateTimeFormats;
}

public void setSuppressDateTimeFormats(Boolean suppressDateTimeFormats) {
this.suppressDateTimeFormats = suppressDateTimeFormats;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,12 @@ private void processCodegenConfig(Map<String, Object> codegen) {
if (cr != null) {
this.codegenInfo.setContextRoot(cr);
}

//process suppress date-time formats
Boolean suppressDateTimeFormat = (Boolean) codegen.get("suppress-date-time-formatting");
if (suppressDateTimeFormat != null) {
this.codegenInfo.setSuppressDateTimeFormats(suppressDateTimeFormat);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -64,7 +63,6 @@ public class ArtifactMetaData {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
private Date createdOn;
/**
Expand All @@ -79,7 +77,6 @@ public class ArtifactMetaData {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("modifiedOn")
private Date modifiedOn;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import java.util.Date;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -40,11 +39,10 @@ public class Comment {
@JsonProperty("value")
private String value;
/**
*
*
* (Required)
*
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
private Date createdOn;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Date;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -63,7 +62,6 @@ public class GroupMetaData {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
private Date createdOn;
/**
Expand All @@ -78,7 +76,6 @@ public class GroupMetaData {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("modifiedOn")
private Date modifiedOn;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.Date;
import java.util.List;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -65,7 +64,6 @@ public class SearchedArtifact {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
@JsonPropertyDescription("")
private Date createdOn;
Expand Down Expand Up @@ -108,7 +106,6 @@ public class SearchedArtifact {
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("modifiedOn")
@JsonPropertyDescription("")
private Date modifiedOn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import java.util.Date;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -53,7 +52,6 @@ public class SearchedGroup {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
@JsonPropertyDescription("")
private Date createdOn;
Expand All @@ -70,7 +68,6 @@ public class SearchedGroup {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("modifiedOn")
@JsonPropertyDescription("")
private Date modifiedOn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -59,7 +58,6 @@ public class SearchedVersion {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
@JsonPropertyDescription("")
private Date createdOn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import java.util.Date;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
Expand Down Expand Up @@ -37,7 +36,6 @@ public class SystemInfo {
private String description;
@JsonProperty("version")
private String version;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("builtOn")
private Date builtOn;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -68,7 +67,6 @@ public class VersionMetaData {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
private Date createdOn;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -64,7 +63,6 @@ public class ArtifactMetaData {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
private Date createdOn;
/**
Expand All @@ -79,7 +77,6 @@ public class ArtifactMetaData {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("modifiedOn")
private Date modifiedOn;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import java.util.Date;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -40,11 +39,10 @@ public class Comment {
@JsonProperty("value")
private String value;
/**
*
*
* (Required)
*
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
private Date createdOn;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Date;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -63,7 +62,6 @@ public class GroupMetaData {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
private Date createdOn;
/**
Expand All @@ -78,7 +76,6 @@ public class GroupMetaData {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("modifiedOn")
private Date modifiedOn;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.Date;
import java.util.List;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -65,7 +64,6 @@ public class SearchedArtifact {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
@JsonPropertyDescription("")
private Date createdOn;
Expand Down Expand Up @@ -108,7 +106,6 @@ public class SearchedArtifact {
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("modifiedOn")
@JsonPropertyDescription("")
private Date modifiedOn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import java.util.Date;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -53,7 +52,6 @@ public class SearchedGroup {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
@JsonPropertyDescription("")
private Date createdOn;
Expand All @@ -70,7 +68,6 @@ public class SearchedGroup {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("modifiedOn")
@JsonPropertyDescription("")
private Date modifiedOn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
Expand Down Expand Up @@ -59,7 +58,6 @@ public class SearchedVersion {
* (Required)
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'", timezone = "UTC")
@JsonProperty("createdOn")
@JsonPropertyDescription("")
private Date createdOn;
Expand Down
Loading

0 comments on commit 9b49ae8

Please sign in to comment.