Use RAML for Websocket definition
You can modify RAML files in order to describe Websockets (WS). This enables you to scan Websocket definitions in API Scan and to export them to Tosca Commander. You can then, for instance, use the Update API Modules feature to keep the maintenance effort for your Modules low.
Create WS description with RAML
To create a WS description with RAML, you have to adapt the file's baseURI and methods. You can, however, further adapt the RAML file based on your requirements.
The baseURI is an optional field in RAML that you can use to specify the service endpoint of an API and its resources. The methods define what to do with the resources, for example, send them.
To create a WS description with RAML, you have to perform the following steps:
-
Enter a WS endpoint in the baseURI field, for instance ws://localhost/stream.
-
Use WS methods in your RAML definition, for instance send, receive, or connect.
The example below illustrates how you can modify a RAML file to describe a WS and how API Scan displays the file after you scanned it. API Scan identifies the baseURI and methods of you RAML file and automatically switches from HTTP to WS.
RAML file with WS definitions and in API Scan
You can now run these messages in API Scan and export them to Tosca Commander.