REST API client configuration schema
The following JSON file shows configuration schema:
{
"type": "object",
"id": "com.guidewire.restclient.config.ConfigEx",
"description": "This is an external representation of the config object.\n This accepts suppliers for what the objects that the configuration needs.\n The config object can be initialized via ConfigEx.parse()",
"properties": {
"additionalInterceptors": {
"type": "array",
"description": "This is a collection of additional interceptors, authentication, tracing are added as interceptors.",
"items": {
"type": "object",
"id": "com.guidewire.restclient.config.InterceptorSetupEx",
"additionalProperties": false,
"properties": {
"interceptorSupplierClass": {
"type": "string",
"$ref": "java.lang.Class",
"required": true,
"description": "This is the supplier class, it is passed the properties to get a RequestInterceptor implementation"
},
"properties": {
"type": "object",
"description": "This is a map of name/value that is passed to the supplier",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"auth": {
"type": "object",
"id": "com.guidewire.restclient.config.AuthMethodEx",
"description": "This is how to authenticate: 'HttpBasic', 'HttpBearer', 'ApiKey', or 'OAuth' are supported, each has specific attributes based on their 'method' property.",
"oneOf": [ {
"$ref": "com.guidewire.restclient.config.ApiKeyAuthEx"
}, {
"$ref": "com.guidewire.restclient.config.HttpBasicAuthEx"
}, {
"$ref": "com.guidewire.restclient.config.HttpBearerAuthEx"
}, {
"$ref": "com.guidewire.restclient.config.OAuthEx"
} ]
},
"basePath": {
"type": "string",
"description": "This is the base path to the endpoint."
},
"credentialSupplierSupplierClass": {
"type": "string",
"$ref": "java.lang.Class",
"description": "this is a class that implements Credential supplier. The supplier can be initialized the with properties below, and is asked for the value of the various credentials, i.e., ApiKeyAuth is used the if paramName is defaulted it is 'apikey', so the supplier is asked for 'apikey' value. HttpBasicAuth uses username and password. HttpBearerAuth uses the schema or default to 'bearToken. OAuth uses username, password, clientId, clientSecret."
},
"eventHandlers": {
"type": "array",
"description": "This is the event handlers that should be applied to each request, RetrySetupEx, FallbackSetupEx, CircuitBreakerEx.",
"items": {
"type": "object",
"id": "com.guidewire.restclient.config.EventHandlerSetupEx",
"oneOf": [ {
"$ref": "com.guidewire.restclient.config.CircuitBreakerSetupEx"
}, {
"$ref": "com.guidewire.restclient.config.FallbackSetupEx"
}, {
"$ref": "com.guidewire.restclient.config.RetrySetupEx"
} ]
}
},
"httpClient": {
"type": "object",
"id": "com.guidewire.restclient.config.HttpClientSetupEx",
"description": "This is setup information for ssl or tls.",
"additionalProperties": false,
"properties": {
"clientSupplierClass": {
"type": "string",
"$ref": "java.lang.Class",
"description": "this is a function class that accepts a Map<String,String> and returns an HttpClient object. Note that if this is declared then the other suppliers are ignored."
},
"contextSupplierClass": {
"type": "string",
"$ref": "java.lang.Class",
"required": true,
"description": "this is a function class that accepts a Map<String,String> and returns an object that implements SSLSocketFactory"
},
"hostnameVerifierSupplierClass": {
"type": "string",
"$ref": "java.lang.Class",
"required": true,
"description": "this is a function class that accepts a Map<String,String> and returns an object that implements HostnameVerifier"
},
"properties": {
"type": "object",
"description": "this is a map of name/values which is passed to the httpClientSupplier, contextSupplier, and hostnameVerifierSupplier to get their respective object. to get a CredentialSupplier.",
"additionalProperties": {
"type": "string"
}
}
}
},
"logLevel": {
"type": "string",
"description": "This what to log, default is NONE:, NONE: No logging; BASIC: method, URL, response status, and execution time; HEADERS: the BASIC information and request/response headers; FULL: the HEADERS information, body, and metadata for request/response",
"enum": [ "NONE", "BASIC", "HEADERS", "FULL" ]
},
"loggerName": {
"type": "string",
"description": "This to override the logger for this end point; you may want to log different end points to different loggers. Note that the logger must be at DEBUG to enable the additional logLevel messages"
},
"mapperSupplierClass": {
"type": "string",
"$ref": "java.lang.Class",
"description": "This is an ObjectMapper, but default the standard mapper is used."
},
"properties": {
"type": "object",
"description": "this is a map of name/values which is passed to the CredentialSupplierSupplier to get a CredentialSupplier.",
"additionalProperties": {
"type": "string"
}
},
"timeout": {
"type": "object",
"id": "com.guidewire.restclient.config.TimeoutSetupEx",
"description": "This is timeout information.",
"additionalProperties": false,
"properties": {
"connectTimeoutMillis": {
"type": "integer",
"required": true
},
"readTimeoutMillis": {
"type": "integer",
"required": true
}
}
},
"traceActionsClass": {
"type": "string",
"$ref": "java.lang.Class",
"description": "This is whether to deal with trace headers, but default the standards headers are forwarded."
}
}
