When using Jackson\'s JSON schema module, instead of serializing the complete graph I\'d like to stop whenever one of my model classes is encountered, and use the class nam
You can use the HyperSchemaFactoryWrapper instead of SchemaFactoryWrapper. In this way you will get urn reference for nested entities:
HyperSchemaFactoryWrapper visitor= new HyperSchemaFactoryWrapper();
ObjectMapper mapper = objectMapperFactory.getMapper();
mapper.acceptJsonFormatVisitor(mapper.constructType(Zoo.class), visitor);
JsonSchema jsonSchema = visitor.finalSchema();
System.out.println(mapper.writeValueAsString(jsonSchema));