JSON schema files

JSON schema files define the structure of a given set of JSON objects. Guidewire InsuranceSuite JSON Schema support covers a subset of the fourth draft of the JSON Schema standard.

JSON schema files have three uses. JSON schema files can be output targets for integration mappings. In addition, they can serve as input or output types for Swagger schemas. You can also use JSON schema files standalone to parse or serialize JSON objects.

Note: Only Swagger schemas define REST APIs; JSON schemas cannot. Also, a Swagger schema must reference a JSON schema file if any of the operations in the Swagger schema have a JSON input or output.

File names

You write JSON Schema files in the JSON format. Place the files in a subdirectory of config/integration/schemas in Guidewire Studio.

Name schema files with the format, <name>-<version>.schema.json. When doing so, note the following:
  • The <name> portion cannot contain the hyphen character or any other character that would render the portion an invalid file name. The portion also does not include the version number.
  • The <version> portion consists of one or more sequences of digits. Separate these sequences of digits with the period character. Optionally follow each sequence of digits with a hyphen and an arbitrary string.

Examples:
  • config/integration/schemas/gw/pl/admin/user-1.0.schema.json defines the schema named gw.pl.admin.user-1.0.
  • config/integration/schemas/gw/pc/productmodel/productmodel-10.0.1-alpha.schema.json defines the schema named gw.pc.productmodel.productmodel-10.0.1-alpha.
Note: Distinguish schema file names from fully-qualified schema names. Format a schema file name in the manner this topic describes. Use a fully-qualified schema name to reference a schema file in a mapping file, Swagger file, import reference, or combine composition. Such a schema name includes any subdirectories of config/integration/schemas. In this way, the schema name has a function similar to a Java package.

See also