File published-apis.yaml
- It gives you total control over the network exposure of Guidewire PolicyCenter. The REST API framework does not publish an API merely because the API is part of the base PolicyCenter application.
- It ensures that if you extend the Guidewire base API Swagger files, you can publish the resulting APIs using your own namespace and versioning schema.
- It ensure that you do not accidentally publish an API. Thus, it ensures that test, or development, APIs do not accidentally leak into a production network.
apis:
- name: gw.pl.framework.api_list-1.0
- name: fully.qualified.path.to.apifile
defaultTemplate:
- name: gw.core.pc.framework.v1.dev_template-1.0
- name: fully.qualified.path.to.templatefileAPI templates
It is possible for the server environment to affect some aspects of how the REST framework exposes an API to the network. A primary use case is the security section of the Swagger documents. If a server allows for HTTP Basic Authentication, it is useful to include the appropriate declarations in the swagger.yaml file so that client tools such as Swagger UI or Postman can automatically interpret that information and give the user the option to specify authentication headers. However, whether the server supports Basic Authentication can depend upon whether the server is a development or production server. It is also possible that you want to expose the /swagger.json endpoint that self-documents the REST APIs, but, only for development or test or sandbox systems and not in production environment.
To meet these needs, you can specify an API template that the REST framework includes with
the API at runtime. You can specify that an API template affects only a single API, or, you
can specify a template as the global default. Both of the API declarations and default
template are sensitive to the server and env properties in
a similar manner to other configuration files. Thus, you can specify that the REST framework
publish an API to a specific server only, or, only if the server is operating in a specific
server mode.
Publishing to different environments
apis:
- name: gw.pc.systemtools.system_tools-10.0
env: dev
- name: gw.pl.framework.api_list-1.0
defaultTemplate:
- name: gw.pl.framework.dev_template-1.0
- name: customer.framework.prod_template-1.0
env : dev- The
apiselement lists multiple API names. The first API on the list is active in adevenvironment only. The last API (gw.pl.framework.api_list-1.0) is active in all environments. - The default template is gw.pl.framework.dev_template-1.0. It is
active in all environments except a development (
dev) environment. - The template to use in a development (
dev) environment is customer.framework.prod_template-1.0.
