You can use a wizard to generate a template swagger.json file to
specify a Representational State Transfer (REST) application programming interface (API). The wizard
is enabled for projects that target a Liberty server and use Web 2.5 and above.
About this task
Important: Applicable to Liberty, Liberty Core
Procedure
- Create a web project that targets a Liberty server.
For more information about creating web projects, see Creating web projects.
- To create a Swagger REST API definition file, complete one of the following options:
- Select , and then select Swagger REST API definition file in the
REST API definition section.
- Right-click a project and select .
- To select the type of JavaScript Object Notation (JSON) file that you want to create, complete
one of the following options:
- To create a file with all of the top-level Swagger elements that are required, select
Create a swagger.json template file.
- To create a file with sample contents for common definitions, such as GET,
PUT, and POST, select Create a swagger.json sample
file.
Select a location for the file that you are creating:
- Click Finish.
Results
The tools generate a swagger.json file in the
WebContent/META-INF folder for your web project. The file opens in your default
JSON editor.