Hi
I'm trying to extend the functionality of the basic schema generation to include properties like title.
So if I have a class like this
public class MyFoo{
public String foo;
public int bar;
public String baz;
}
Out of the box I can get the following json:
What I'd like to do is create custom annotations so I can add JsonSchema properties to the fields in my pojo
For example if I annotate the foo property with a custom annotation (lets call it @JsonSchemaProp) like this
@JsonSchemaProp(titlePrefix = "this is a")
public String foo;
Then I'd like to see that reflected in my json schema above as
foo: {type: "string",
title: "this is a foo",
}
I looked at the sample code in TitleSchemaFactoryWrapper but its very basic. It doesn't give me any hints on how to access the property name currently being visited and that's where I seem to be stuck. In order to accomplish my goal I need to answer these two questions:
1. How do I access the annotations on a field/class from the SchemaFactoryWrapper
2. How do Access the field currently being visted in the overridden methods of my SchemaFactoryWrapper, e.g. inside
public JsonStringFormatVisitor expectStringFormat(JavaType convertedType)
If anyone has done anything similar and can help me with 1 or 2 I'd be eternally grateful.