Open xiacheng opened 4 years ago
{ "type": "string", "pattern": "^(\([0-9]{3}\))?[0-9]{3}-[0-9]{4}$" } Trying to add pattern field, and thought it could be good to leverage the jackson annotation @JsonFormat
Maybe not the cleanest, but you can achieve this via:
@JsonSchemaFormat("string") @JsonSchemaInject(json = "{\"pattern\":\"<your-pattern>\"")
{ "type": "string", "pattern": "^(\([0-9]{3}\))?[0-9]{3}-[0-9]{4}$" } Trying to add pattern field, and thought it could be good to leverage the jackson annotation @JsonFormat