The REST endpoint generator prompts

The following section lists the prompts for the general case of generating endpoints for a generic child resource. All responses are case-sensitive.

Which entity?

Which data model entity would you like to generate endpoints for?

Specify the entity name.

Requiring the Ext suffix

If the specified entity has a name that does not start or end with "Ext", then the following prompt appears. It identifies that "Ext" will be added to the resource name.

Guidewire maintains the entity naming standard of Standard-IS-FNC-1321-DataModelNaming.
<entityName> does not start or end with 'Ext', therefore the REST endpoint
generator will add the suffix 'ext' to all REST generated code. Answer 'yes' to
acknowledge. y/n

You must acknowledge this by entering "y". If you do not enter "y", the generator throws an illegal state exception and stops running.

The default element resource name

The default element resource name for this entity is '<defaultElementResourceName>'. If you
want to use a different name, specify it and press Enter. To accept the default, just
press Enter.

The REST endpoint generator identifies the default name it will use for the element resource. You can specify a different name is desired.

The default collection resource name

The default plural for this entity is <defaultCollectionResourceName>. If you want to use a different plural, 
specify it and press Enter. To accept the default, just press Enter.

Specify a custom name for the collection resource, or press Enter to accept the default name.

Requiring the Ext suffix (for the collection resource)

If the specified collection resource has a name that does not start end with "Ext", then the following prompt appears. It identifies that "Ext" will be added to the resource name.

Guidewire maintains the entity naming standard of Standard-IS-FNC-1321-DataModelNaming.
<customCollectionResourceName> does not start or end with 'Ext', therefore the REST endpoint
generator will add the suffix 'ext' to it in all REST generated code. Answer 'yes' to
acknowledge. y/n

You must acknowledge this by entering "y". If you do not enter "y", the generator throws an illegal state exception and stops running.

Default hyphenation

The url string for <entityName> will use the following hyphenation: <defaultValue>.
If you would like to use a different hyphenation, please enter it here (leave blank to use 
the default, all capitalized letters will be converted to lowercase):

If the name of the entity has multiple capital letters and/or numbers in a row, then the REST endpoint generator shows the default hyphenation for the endpoint paths (such as /bop-line-ext for an entity named BOPLine_Ext). You can specify a custom hyphenation approach (such as /bopline-ext) or press Enter to accept the default.

Which API?

Which API should the endpoints be added to?

Specify the API name. The technical name is specified in lower case, such as "common" for the Common API or "admin" for the Admin API.

Each API has restrictions and recommendations around what can be added to it:

  • Endpoints for effective-dated entities can be added only to:
    • Job API (the generated GETs are also added to the Policy API)
  • Endpoints for non-effective-dated entities can be added only to:
    • Account API
    • Admin API
    • Common API
  • Endpoints cannot be added to:
    • Composite API
    • Product Definition API (except for reference data)
    • System Tools API
    • Test Util API

(Technically speaking, non-effective-dated entities can be added to the Job API. But Guidewire does not recommend doing this.)

For more information, see The API for the new endpoints.

Root endpoint or child endpoint?

Is the <entityName> endpoint the (r)oot of the endpoint path (e.g. GET /activities) 
or the (c)hild of another resource (e.g. GET /activities/{activityId}/notes)? r/c

Enter "c" to make the custom resource a child of some existing parent resource. (This prompt is not presented for effective-dated entities. Effective-dated entities cannot be root resources.)

For more information, see The parent of the custom resource.

What is the resource name of the parent?
Enter the resource name of the parent.
  • This is the value of the resourceType from the parent resource's schema.
  • This must be an element resource (such as Activity), not a collection (such as Activities).
  • In order to generate child endpoints, there must already be a set of CRUD endpoints for the parent resource.

Be aware that, for most endpoints, the resource name is the same as what appears in the endpoint path. For example, the resource name for GET /activities/{ActivityId} is Activity. But sometimes, the endpoint path differs from the resource name. For example, the resource name for GET /contacts/{contactId} is not Contact, but rather AccountContact. To verify you are using the correct name, check the resourceType from the parent resource's schema.

For more information, see The parent of the custom resource.

Stream-back collection or query-back collection?

Is the collection resource backed by a (s)tream or (q)uery?

Select whether your collection is loaded using a stream or a Gosu query. (This prompt is not presented for effective-dated entities. Effective-dated entities are always backed by streams.) For more information, see Populating collections.

Endpoint access

Which roles can access the GET collection and GET element endpoint? 
Here are the options [<list-of-roles>]
Enter the values separated by comma. If you do not want to specify roles, just press Enter.

The REST endpoint generator lists the available roles. Enter a comma-separated list of roles that will have GET access.

Any roles that are given GET access to endpoints in the Job API will also have access to the GET endpoints in the Policy API.

Note that you do not need to answer any of the authorization prompts. You can press Enter for each prompt. However, this only bypasses the coding done by the REST endpoint generator. This does not bypass the need to configure authorization for the endpoints.

Which roles can access the POST collection endpoint? 
Here are the options [<list-of-roles>]
Enter the values separated by comma. If you do not want to specify roles, just press Enter.

The REST endpoint generator lists the available roles. Enter a comma-separated list of roles that will have POST access. Note that GET access is required for POST access. Thus, any role which was not given GET access cannot be given POST access.

Which roles can access the PATCH element endpoint?
Here are the options [<list-of-roles>]
Enter the values separated by comma. If you do not want to specify roles, just press Enter.

The REST endpoint generator lists the available roles. Enter a comma-separated list of roles that will have PATCH access. Note that GET access is required for PATCH access. Thus, any role which was not given GET access cannot be given PATCH access.

Which roles can access the DELETE element endpoint?
Here are the options [<list-of-roles>]
Enter the values separated by comma. If you do not want to specify roles, just press Enter.

The REST endpoint generator lists the available roles. Enter a comma-separated list of roles that will have DELETE access. Note that GET access is required for DELETE access. Thus, any role which was not given GET access cannot be given DELETE access.

Integration graph

Should <CustomEntity> be added to an integration graph?

Enter "y" or "n". For more information on adding custom resources to integration graphs, see Additional considerations for generated endpoints.

Completion of the script

After the REST endpoint generator script successfully completes, it lists information about the files it created or modified similar to the following example.

2022-03-18 16:42:42,817 INFO Beginning endpoint generation
2022-03-18 16:42:42,818 INFO Generating resource classes
2022-03-18 16:42:42,832 INFO Modifying configuration file <api_collection>_ext-1.0.swagger.yaml
2022-03-18 16:42:42,868 INFO Modifying configuration file <api_collection>_ext-1.0.schema.json
2022-03-18 16:42:42,877 INFO Modifying configuration file <api_collection>_ext-1.0.mapping.json
2022-03-18 16:42:42,880 INFO Modifying configuration file <api_collection>_ext-1.0.updater.json
2022-03-18 16:42:42,885 INFO Modifying configuration file shared_ext-1.0.apiconfig.yaml
2022-03-18 16:42:42,903 INFO Modifying configuration file default_ext-1.0.access.yaml
2022-03-18 16:42:42,907 INFO Modifying configuration file internal_ext-1.0.access.yaml
2022-03-18 16:42:42,909 INFO Modifying configuration file accountnumbers_ext-1.0.access.yaml
2022-03-18 16:42:42,917 INFO Modifying configuration file <role>.role.yaml
2022-03-18 16:42:42,939 INFO Finished endpoint generation