Mapping PolicyCenter objects to JSON objects
In defining your REST API, you need to develop a JSON schema that describes how to convert a given PolicyCenter entity object into a JSON object that a REST response returns. The PolicyCenter object can be nearly any data model entity. In creating your JSON mapping file, use the extension mapping.json and prepend the appropriate namespace for your REST configuration files to the file name.
Important
The JSON mapping schema must directly reflect the JSON API schema. This means that for every property you define on a JSON object in a *.schema.json file, there must an equivalent property for the same JSON object in the associated *.mapping.json file.
The mapping schema
The mapping schema file looks similar to the following JSON definition.
{
"schemaName": "...",
"mappers": {
"Object": {
"schemaDefinition": "..."
"root": "..."
"properties": {
"propertyOne": {
"path": "..."
},
"propertyTwo": "..." {
"path": "..."
}
}
}
}
}
The example code inserts spaces for readability. The schema requires the use of the
'schemaName' and 'mappers' element. The use of the
'combine' element is optional. You must supply real values for variables
in italic font.
