Scalars in the schema configuration files
A scalar is a single simple value, such as a string, number, datetime, or Boolean.
The schema extension file
definitions
section.
In the base configuration, this section is typically blank, as shown
below. "definitions": { }
You can add the name of one or more schemas to the definitions
section.
In each schema, you can define a properties
section, which lists one or
more properties defined for the schema.
If the property is a base configuration property that is not exposed to Cloud API, Guidewire recommends naming the schema property with an "_Ext" suffix. This is to prevent any possible future conflicts if Guidewire adds the property to the base configuration in a later release.
For scalar values, each property must also have a type
.
User
entity has a
JobTitle
field (this user's job title) and an
ExternalUser
field (whether the user works for the insurer or not).
The Admin API has /user
endpoints, but JobTitle
and
ExternalUser
are not exposed in the Cloud API User
resource. Suppose you want to expose them, and you want JobTitle
to be
writeable and ExternalUser
be read-only. You would add the following to
the admin_ext-1.0.schema.json
extension
file."definitions": {
"User": {
"properties": {
"jobTitle_Ext" : {
"title": "jobTitle_Ext",
"description": "The user's job title",
"type": "string",
},
"externalUser_Ext" : {
"title": "externalUser_Ext",
"description": "Whether the user is internal (is an employee of the insurer) or not",
"type": "boolean",
"readOnly": true
}
}
}
}
Schema property types
Set the type
attribute to a JSON schema types from the following
table.
Data model datatype | Corresponding JSON type | Additional required attributes |
---|---|---|
bit |
boolean |
|
dateonly |
string |
An additional "format " attribute set to
"date " |
datetime |
string |
An additional "format " attribute set to
"date-time " |
decimal |
number |
|
integer |
integer |
|
longint |
integer |
|
longtext |
string |
|
mediumtext |
string |
|
money |
number |
|
percentage |
number |
|
shorttext |
string |
|
text |
string |
|
varchar |
string |
If you are defining a date or datetime property, you must also define a
format
property set to the appropriate value. For example:
"expirationDate": {
"type": "string",
"format": "date-time"
}
The mapping extension file
mappers
section. In
the base configuration, this section is typically blank, as shown
below. "mappers": { }
You can add the name of one or more schemas to the mappers
section. In
each schema, you can define a properties
section, which lists one or
more properties defined in the schema.
For each property, you must identify how data is mapped from the Guidewire data model to
the property. This is done using a path
attribute.
User
entity has a
JobTitle
field and an ExternalUser
field. The
Admin API has /user
endpoints, but JobTitle
and
ExternalUser
are not exposed in the Cloud API User
resource. If you wanted to expose them, you would first add them to the schema. Then,
you would add the following to the admin_ext-1.0.mapping.json
extension
file. "mappers": {
"User": {
"properties": {
"jobTitle_Ext": {
"path": "User.JobTitle"
},
"externalUser_Ext": {
"path": "User.ExternalUser"
}
}
}
}
Mappers for custom entities
If you are adding a custom entity, then in addition to the business properties you
wish to expose, the mapper must also contain an "id" property that maps to the data
model entity's RestId
.
For example, suppose you are defining a mapper for a custom entity named
CustomEntityExt
with the following business properties:
isActive
, customDescription
,
expirationDescription
. The mapper would be as follows:
"mappers": {
"CustomEntityExt": {
"properties": {
"id": {
"path": "CustomEntity_Ext.RestId"
},
"isActive": {
"path": "CustomEntity_Ext.IsActive"
},
"customDescription": {
"path": "CustomEntity_Ext.CustomDescription"
},
"expirationDescription": {
"path": "CustomEntity_Ext.ExpirationDate"
}
}
}
}
DisplayName
. An entity name is a Gosu expression that
determines the value for an entity's DisplayName
field. For example,
the ABPerson
entity might have its entity name set to
ABPerson.LastName + ", " + ABPerson.FirstName
, which for a given
ABPerson
would render as "Newton, Ray". If an entity has no defined
entity name, the default behavior is to return the concatenation of every field in the
entity. If you add a property to a schema that maps to an entity's display name, be sure that there is an entity name defined for that entity. If there is not, then the application will return a concatenation of every field in the entity. This could potentially make information available in Cloud API that you do not want exposed through Cloud API.
For more information on entity names, see the Configuration Guide.
The updater extension file
updaters
section.
In the base configuration, this section is typically blank, as shown
below. "updaters": { }
You can add the name of one or more schemas to the updaters
section. In
each schema, you can define a properties
section, which lists one or
more properties defined in the schema.
For each writeable property, you must identify how data is mapped from the property to
the Guidewire data model. Similar to the mapping file, this is done using a
path
attribute. For scalars, it is not unusual for a given property
to have the same path
value on both the mapping file and the updater
file.
User
entity has a
JobTitle
field and an ExternalUser
field. The Admin API
has /user
endpoints, but JobTitle
and
ExternalUser
are not exposed in the Cloud API User
resource. Suppose you want to expose these fields to Cloud API, and you want to make
JobTitle
writeable and ExternalUser
read-only. You would
first add these properties to the schema and the mapping file. Then, you would add the
JobTitle
property to the admin_ext-1.0.updater.json
extension file. (ExternalUser
is omitted from the updater file because it is
read-only. "updaters": {
"User": {
"properties": {
"jobTitle_Ext": {
"path": "User.JobTitle"
}
}
}
}