Yes SWAGGER will work on Layer 7 / APIM on Gateway version 9.1 and Portal 4.0 and above.
Version 9.1 allows you to publish an API using a swagger document. 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).
Version 9.0 and above allows you to validate against a swagger document. The Validate Against Swagger Document Assertion validates a request against the API from a Swagger document. You can check the following:
- The request's scheme is allowed by the API
- The request's path is valid
- The request's method is allowed by the API
- The security credentials required by the API are present in the request
- The Swagger document must be available from a context variable before this assertion is encountered in the policy.
- The Swagger document is in the application/json format.
Please see the link bellow for detailed instructions
A new wizard in 9.1 lets you create a service endpoint on the Gateway that is protected/defined by a Swagger document.
Publish Swagger Service Wizard - CA API Gateway - 9.1 - CA Technologies Documentation
Information about the assertion that validates requests against the API from a Swagger document:
Validate Against Swagger Document Assertion - CA API Gateway - 9.1 - CA Technologies Documentation
What version of Swagger should be used?
You need to use Swagger 2.0 for both the Gateway and Portal