You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I love the JsonSchemaGenerator were I can use your JSON* annotations and javax.validation.constraints without problems.
One feature I miss is the possibility to generate a dependencies (until draft-07) / dependentRequired (since 2019_09) definition.
I would expect something like that @JsonDependsOn
`
package cms.container.module;
Hi, I love the JsonSchemaGenerator were I can use your JSON* annotations and javax.validation.constraints without problems.
One feature I miss is the possibility to generate a dependencies (until draft-07) / dependentRequired (since 2019_09) definition.
I would expect something like that @JsonDependsOn
`
package cms.container.module;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import crisp.explore.schema.SchemaVersion;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@TranslationType
@SchemaVersion(major = 2, minor = 0, fix = 0)
public class QuotationAuthor {
public static final String CONTENTTYPE_ID = "quotationAuthor";
private static final String DISPLAY_NAME_FIELD = "displayName";
private static final String POSITION_FIELD = "position";
private static final String COMPANY_FIELD = "company";
private static final String AVATAR_URI_FIELD = "avatarUri";
private static final String IMAGE_CAPTION_FIELD = "imageCaption";
private static final String IMAGE_ALTERNATE_TEXT_FIELD = "imageAlternateText";
private static final String IMAGE_TITLE_FIELD = "imageTitle";
private String displayName;
private String position;
private String company;
private String avatarUri;
private String imageCaption;
private String imageAlternateText;
private String imageTitle;
/**
*/
@JsonCreator
public QuotationAuthor(@JsonProperty(BaseContent.CMS_ID_FIELD) final String cmsId,
@JsonProperty(BaseContent.GC_ID_FIELD) final String gcId,
@JsonProperty(BaseContent.GC_TYPE_FIELD) final GcType gcType,
@JsonProperty(BaseContent.REALM_FIELD) final List realms,
@JsonProperty(BaseContent.LOCALE_FIELD) final String locale,
@JsonProperty(QuotationAuthor.DISPLAY_NAME_FIELD) final String displayName,
@JsonProperty(QuotationAuthor.POSITION_FIELD) final String position,
@JsonProperty(QuotationAuthor.COMPANY_FIELD) final String company,
@JsonProperty(QuotationAuthor.AVATAR_URI_FIELD) final String avatarUri,
@JsonProperty(QuotationAuthor.IMAGE_CAPTION_FIELD) final String imageCaption,
@JsonProperty(QuotationAuthor.IMAGE_ALTERNATE_TEXT_FIELD) final String imageAlternateText,
@JsonProperty(QuotationAuthor.IMAGE_TITLE_FIELD) final String imageTitle) {
super(cmsId, gcId, gcType, realms, locale);
this.displayName = displayName;
this.position = position;
this.company = company;
this.avatarUri = avatarUri;
this.imageCaption = imageCaption;
this.imageAlternateText = imageAlternateText;
this.imageTitle = imageTitle;
}
@NotNull
@notempty
@notblank
public String getDisplayName() {
return this.displayName;
}
public void setDisplayName(final String displayName) {
this.displayName = displayName;
}
public String getPosition() {
return this.position;
}
public void setPosition(final String position) {
this.position = position;
}
public String getCompany() {
return this.company;
}
public void setCompany(final String company) {
this.company = company;
}
@NotNull
@notempty
@notblank
@JsonDependsOn("imageCaption","imageTitle","imageAlternateText")
public String getAvatarUri() {
return this.avatarUri;
}
public void setAvatarUri(final String avatarUri) {
this.avatarUri = avatarUri;
}
@NotNull
@notempty
@notblank
@JsonDependsOn("avatarUri","imageTitle","imageAlternateText")
public String getImageCaption() {
return this.imageCaption;
}
public void setImageCaption(final String imageCaption) {
this.imageCaption = imageCaption;
}
@NotNull
@notempty
@notblank
@JsonDependsOn("imageCaption","imageTitle","avatarUri")
public String getImageAlternateText() {
return this.imageAlternateText;
}
public void setImageAlternateText(final String imageAlternateText) {
this.imageAlternateText = imageAlternateText;
}
@NotNull
@notempty
@notblank
@JsonDependsOn("imageCaption","avatarUri","imageAlternateText")
public String getImageTitle() {
return this.imageTitle;
}
public void setImageTitle(final String imageTitle) {
this.imageTitle = imageTitle;
}
/**
*/
@OverRide
@JsonProperty
@NotNull
@notempty
@notblank
public String contentTypeId() {
return QuotationAuthor.CONTENTTYPE_ID;
}
`
Here the expected schema file
{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "title": "QuotationAuthor", "type": "object", "properties": { "avatarUri": {"anyOf": [ { "type": "null", "title": "Not included" }, {"type": "string"} ]}, "realms": { "minItems": 1, "type": "array", "items": {"type": "string"} }, "cmsId": { "minLength": 1, "pattern": "^.*\\S+.*$", "type": "string" }, "displayName": { "minLength": 1, "pattern": "^.*\\S+.*$", "type": "string" }, "gcId": { "minLength": 1, "pattern": "^.*\\S+.*$", "type": "string" }, "gcType": { "type": "string", "enum": [ "Master Content", "Localized Content", "Undefined" ] }, "syncDate": {"anyOf": [ { "type": "null", "title": "Not included" }, { "format": "date-time", "type": "string" } ]}, "contentTypeId": { "minLength": 1, "pattern": "^.*\\S+.*$", "type": "string" }, "imageAlternateText": { "minLength": 1, "pattern": "^.*\\S+.*$", "type": "string" }, "locale": { "minLength": 1, "pattern": "^.*\\S+.*$", "type": "string" }, "environment": {"anyOf": [ { "type": "null", "title": "Not included" }, {"type": "string"} ]}, "imageCaption":{ "minLength": 1, "pattern": "^.*\\S+.*$", "type": "string" }, "provider": { "default": "QuotationAuthor", "type": "string", "enum": ["QuotationAuthor"] }, "company": {"anyOf": [ { "type": "null", "title": "Not included" }, {"type": "string"} ]}, "position": {"anyOf": [ { "type": "null", "title": "Not included" }, {"type": "string"} ]}, "imageTitle": { "minLength": 1, "pattern": "^.*\\S+.*$", "type": "string" } }, "required": [ "provider", "cmsId", "gcType", "realms", "locale", "displayName", "gcId", "contentTypeId" ], "dependencies": { "avatarUri": ["imageCaption","imageTitle","imageAlternateText"], "imageCaption": ["avatarUri","imageTitle","imageAlternateText"], "imageTitle": ["imageCaption","avatarUri","imageAlternateText"], "imageAlternateText": ["imageCaption","imageTitle","avatarUri"] }, "$id": "classpath://schema/cms-quotationauthor-schema-2.0.0.json" }
The text was updated successfully, but these errors were encountered: