Publish Swagger Service Wizard

Publishes a service based on a Swagger document. The wizard guides you through the steps to specify the Swagger document, routing URI, and API Host and Path. You can optionally select validation options to apply to request messages in the service policy. The wizard creates a sample template policy to help you get started (see ).
gateway91
Publishes a service based on a Swagger document. The wizard guides you through the steps to specify the Swagger document, routing URI, and API Host and Path. You can optionally select validation options to apply to request messages in the service policy. The wizard creates a sample template policy to help you get started (see Validate Against Swagger Document Assertion).
To access this wizard: Tasks > Services and APIs > Publish Swagger Service Wizard
If the incoming protocol to your service differs from that of your Swagger service, be sure to change the Route via HTTP(S) Assertion (in the template policy generated by this wizard) to use that protocol. For example, inbound SSL is added to the Swagger policy, yet the Swagger back end uses HTTP. In this case, change the beginning of the URL in the Route via HTTP(S) Assertion in the template policy from "
${request.url.protocol}:
" to "
http:
".
Cluster Property
This wizard observes the 
swagger.maxDownloadSize
cluster property to limit the size of the Swagger document download. For more information, see Miscellaneous Cluster Properties
Security
This task requires the 'Administrator' role. 
Wizard
Step
What you should know...
1
Specify the location of the Swagger document. This document must be online, hosted on a HTTP/HTTPS server.
To configure options for the URL (for example, to specify credentials, SSL, or proxy options), click [
HTTP Options
] to open the Manage HTTP Options dialog.
An error message stating that the Swagger document location cannot be parsed may indicated that authentication is required. If this occurs, click [
HTTP Options
] to configure options for the URL.
2
  • Service Name:
    Enter a name for the service. If the Title is set in the Swagger document, it is set as the default value.
  • Routing URI:
    Enter the resolution URI for the service to publish. If the Base Path is set in the Swagger document, it is set as the default value.
  • API Host:
    Enter a valid host name or IP address, with optional port; for example:
    foobar.swagger.io:8080
    . If the API Host is set in the Swagger document, it is set as the default value.
  • API Base Path:
    Enter a valid path, with the leading '/' character. If the Base Path is set in the Swagger document, it is set as the default value.
  • Swagger Validation Options:
    Select the options to enable in the resulting Validate Against Swagger Document assertion in the published service policy. For a detailed description of each option, see Validate Against Swagger Document Assertion.
Frequently Asked Questions
Question
Answer
Why can't I specify a Swagger document on a local or network drive?
The
swagger.json
document is always expected to be hosted online. Advanced users can opt to paste the contents of the Swagger document into a context variable and create their own service.
Can I change the Swagger validation options later?
Yes. Simply open the Validate Against Swagger Document assertion in the published service and make the appropriate changes.
Why is my Swagger document download failing?
Verify that the document is a valid Swagger document. Also ensure that the document size does not exceed the maximum specified by the
swagger.maxDownloadSize
cluster property.