@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
throws JsonMappingException
{
ObjectNode o = createSchemaNode("object", true);
//todo: should the classname go in the title?
//o.put("title", _className);
ObjectNode propertiesNode = o.objectNode();
for (int i = 0; i < _props.length; i++) {
BeanPropertyWriter prop = _props[i];
JavaType propType = prop.getSerializationType();
// 03-Dec-2010, tatu: SchemaAware REALLY should use JavaType, but alas it doesn't...
Type hint = (propType == null) ? prop.getGenericPropertyType() : propType.getRawClass();
// Maybe it already has annotated/statically configured serializer?
JsonSerializer<Object> ser = prop.getSerializer();
if (ser == null) { // nope
Class<?> serType = prop.getRawSerializationType();
if (serType == null) {
serType = prop.getPropertyType();
}
ser = provider.findValueSerializer(serType, prop);
}
JsonNode schemaNode = (ser instanceof SchemaAware) ?
((SchemaAware) ser).getSchema(provider, hint) :
JsonSchema.getDefaultSchemaNode();
propertiesNode.put(prop.getName(), schemaNode);
}
o.put("properties", propertiesNode);
return o;
}