The Swagger Operation object

This object describes a single REST API operation on a path.

Required properties

Property Type Description Combination style
operationId string

Required. If not using the AbstractApiHandler class, PolicyCenter uses this value as the expected name of a method on the API handler class.

The value must be the following:
  • A valid Java or Gosu method name
  • Unique within this Swagger schema
First non-null
responses map<string, Response object>
Required. Defines the set of responses for the operation. All operations must have at least one response defined:
  • If you define a single response with a 2xx response code, PolicyCenter uses that response code as the default on successful requests.
  • If you do not specify a 2xx response code, or if you specify multiple 2xx response codes, the API handler must return a Response object that specifies the appropriate response code.

PolicyCenter assumes that 4xx and 5xx response codes are for documentation purposes only, and are subject to less stringent validation rules.

The keys for this map must be valid HTTP response code strings (for example, 200, or similar) or the string "default".

Merge by key

Optional properties

Property Type Description Combination style
consumes string[]

Overrides any default consumes property declared on the Swagger root object. An operation that specifies a body parameter must define also at least one consumed type, either directly or by inheriting a default value from the root level of the document. This property determines what input content types are acceptable at runtime.

Each member of the array must be a valid MIME type.

First non-null
deprecated boolean Documentation only. First non-null
description string Documentation only. First non-null
externaDocs External documentation object Documentation only. First non-null
parameters Parameter object[] Defines the set of input parameters that this operation accepts. The operation can override parameters defined at the Path Item level by defining a parameter with the same name and location. Merge by logical ID, which is $ref, if specified, otherwise, it is name + in.
produces string[]

Overrides any default produces property declared on the root object. An operation that specifies a 200 or 201 response must specify also at least one produced type, either directly or by inheriting a default value from the root level of the document.

This property determines what output types the caller can request using the Accept header. The negotiated content type can affect how PolicyCenter serializes some types. For example, it can affect whether PolicyCenter serializes a JsonObject object or TransformResult object as JSON or as XML.

Each member of the array must be a valid MIME type.

First non-null
schemes string[] Documentation only. Members of the array must be one of the following:
  • http
  • https
  • ws
  • wss
First non-null
security Security requirement object Documentation only. First non-null
summary string Documentation only. First non-null
tags string[] Documentation only. First non-null

Guidewire extension properties

Property Type Description Combination style
x-gw-apihandler string Overrides the list of x-gw-apihandler classes defined on the root Swagger object. First non-null
x-gw-authenticated boolean Determines whether this operation requires authentication. If you do not specify a value, the default is true. First non-null
x-gw-extensions map<string, anyType>

The values in x-gw-extensions are available to the IRestValidatorFactoryPlugin plugin as well as available at runtime using SwaggerOperation on the RequestContext object.

This value can be an arbitrary map of property keys to values. The key values can be any string, and the anyType values can be any object, including nested JSON objects.

Merge of extensions
x-gw-parameter-sets string[]

Defines a list of parameter sets. PolicyCenter includes the parameters from the named sets as if the parameters were defined inline in this operation.

The parameters defined explicitly through the parameters property on the operation override any parameters included from a parameter set if the parameters have the same logical key (either $ref or name + id).

Each member of the array must be the name of a parameter set defined in the x-gw-parameter-sets property on the document root.

Merge by name
x-gw-permissions string[]

Overrides any value set for the x-gw-permissions property on the Swagger root object. The authenticated user must have all of the specified permissions in order to make a request against this operation. Otherwise, PolicyCenter returns a 403 Forbidden error.

Each member of the array must be a valid SystemPermissionType typecode.

First non-null
x-gw-reserve-db-connection boolean If set to true, PolicyCenter reserves a database connection for the duration of the handling of this request. If you do not specify a value, the default is false. First non-null
x-gw-runlevel string

Overrides any value for x-gw-runlevel set on the Swagger root object. This value specifies the run level that the server must be at in order to process requests for a given operation. If the server is not at that run level, PolicyCenter returns a 503 Service Unavailable error.

PolicyCenter supports the following server run levels:
  • NONE
  • GUIDEWIRE_STARTUP
  • NODAEMONS
  • DAEMONS
  • MULTIUSER

If you do not specify a value for x-gw-runlevel in the root Swagger document or in the operation, the default rune level value is maintenance.

First non-null
x-gw-serialization X-GW-Serialization object

Overrides any value set for x-gw-serialization on the root Swagger object.

First non-null