Extending schema definitions
By extending a schema definition, you can add properties to a resource that are not otherwise present in the base schema definition. This process involves adding a schema definition extension to a schema extension file.
Schema extension files
In Studio, schema extension files are located in Integration > schemas > ext > <API name> directories, with the file naming pattern of <API name>_ext-<VERSION>.schema.json.
For example, the schema extension file for the Common API is located at Integration > schemas > ext > common.v1 > common_ext-1.0.schema.json. The base file has the following content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"x-gw-combine": [
"gw.content.cc.common.v1.common_content-1.0",
"ext.framework.v1.framework_ext-1.0"
],
"definitions": {}
}
$schema
: References the JSON Schema namespace declarationx-gw-combine
: References an array of schema files that can be extended. These files are referenced as fully qualified names that are relative paths within the schemas directory.definitions
: Contains the schema definition extensions. In this case, the value is an empty object, because no extensions have been created yet.