Class MongoJsonSchemaMapper

java.lang.Object
org.springframework.data.mongodb.core.convert.MongoJsonSchemaMapper
All Implemented Interfaces:
JsonSchemaMapper

public class MongoJsonSchemaMapper extends Object implements JsonSchemaMapper
JsonSchemaMapper implementation using the conversion and mapping infrastructure for mapping fields to the provided domain type.
Since:
2.1
Author:
Christoph Strobl, Mark Paluch
  • Constructor Details

  • Method Details

    • mapSchema

      public org.bson.Document mapSchema(org.bson.Document jsonSchema, Class<?> type)
      Description copied from interface: JsonSchemaMapper
      Map the required and properties fields the given Document containing the $jsonSchema against the given domain type.
      The source document remains untouched, fields that do not require mapping are simply copied over to the mapped instance.
      Specified by:
      mapSchema in interface JsonSchemaMapper
      Parameters:
      jsonSchema - the Document holding the raw schema representation. Must not be null.
      type - the target type to map against. Must not be null.
      Returns:
      a new Document containing the mapped $jsonSchema never null.