Application and server configuration for testing the liberty OpenAPI UI.
The Liberty OpenAPI UI is an extended version of Swagger UI which makes a few adjustments. This test procedure tests that our modifications are present and that we haven't obviously broken anything.
If something looks wrong, it can be useful to compare how it's rendered in the online Swagger UI editor.
- Java 17 or later is required
- Build liberty locally with the changes you want to test
- Clone this repository
- In
gradle.propertiesupdateui.test.liberty.installDirto point to thebuild.image/wlpdirectory in your workspace so that the test runs on your locally built liberty - start the server and deploy the test application by running
./gradlew libertyStart
- UI Loads on https://localhost:9443/openapi/ui/
- Forced reload causes all resources to be reloaded
- OpenLiberty logo is at the top of the page
- No filter bar at the top of the page
- Top of the page has the title and description for the application but no links
-
OAS 3.0icon surrounding colour is#5d8203via element inspection - Footer is present
- Footer contains links for
Terms of service,Test Author - Website,Contact Test Author,Example licenseandDocs - No
Validbutton in footer - Operation Details
- Expand
GET /{id}-
idparameter is marked* required
-
- Expand
- UI Loads on https://localhost:9444/openapi/ui/
- Forced reload causes all resources to be reloaded
- OpenLiberty logo is at the top of the page
- No filter bar at the top of the page
- Top of the page has the title, summary and description for the application but no links
-
OAS 3.1icon surrounding colour is#5d8203via element inspection - Footer is present
- Footer contains links for
Terms of service,Test Author - Website,Contact Test Author,Apache 2.0andDocs- Apache 2.0 link works
- No
Validbutton in footer - Webhooks section below path operations is present
-
POST eventoperation is listed as a webhook
-
- Two Server values in Server dropdown
- Select
HTTPSserver url - Expand
GET /{id}operation-
idparameter is marked* required - Two responses -
200and404displayed - Change
media typein drop down- Example changes from either JSON -> XML or XML->JSON
- Can switch between
Example ValueandSchema - Attempt to provide an ID value and should be prohibited from doing so
- Click
Try Out- Provide an ID value of
1 - Click
Executeand get a-
200response
-
- Change ID value to
0 - Click
Execute-
404response
-
- Provide an ID value of
-
- Expand
POST /private- Padlock Icon is
Unlocked - Click
Try Out- Click execute
-
401response
-
- Click execute
- Padlock Icon is
- Click
Authorizeand go tooauthsection - Provide
Client_idmp-ui - Provide
Client_secretabc - Select
testscope - Click
authorize- Login with user credentials
testuser/testpassword - click
allow once - returned to the OpenAPI UI
- Login with user credentials
- Close modal
- All
/private*operations now have a locked padlock - Expand
POST /private- Click
Try Out- Click
Executeand get a200response
- Click
- Click
- Expand
GET /apiKeyNeeded- Padlock is
unlocked - Description is
Get a random record - Click Try Out
- Click Execute and get a
403response
- Click Execute and get a
- Padlock is
- Click
Authorize- Enter apikey
12345 - Click
Authorize - Close modal
- Enter apikey
- Expand
GET /apiKeyNeeded- Operation has a locked padlock
- Click
Try Out- Click
Executeand get a200response
- Click
- UI loads https://localhost:9443/api/explorer/
- Forced reload causes all resources to be reloaded
- OpenLiberty logo is at the top of the page
- The Filter box is present at the top of the page
- Filter using
openapi-ui-test-app(or any prefix of that) returns the operations - Filter using any other value returns no operations
- Top of the Page has
Liberty REST APIs -
OAS3icon surrounding colour is#5d8203via element inspection - No
Validbutton in page footer - Two Server values in Server dropdown
- Select
HTTPSserver url - Expand
GET /openapi-ui-test-app/{id}operation- Two responses -
200and404displayed - Change
Media typein drop down- Example changes from either JSON -> XML or XML->JSON
- Can switch between
Example ValueandSchema - Attempt to provide an ID value and should be prohibited from doing so
- Click
Try Out- Provide an ID value of
1 - Click
Executeand get a-
200response
-
- Change ID value to
0 - Click
Execute-
404response
-
- Provide an ID value of
- Two responses -
- Expand
POST /openapi-ui-test-app/private- Padlock Icon is
Unlocked - Click
Try Out- Click execute
-
401response
- Padlock Icon is
- Click
Authorizeand go tooauthsection - Provide
Client_idopenapi-ui - Provide
Client_secretabc - Select
testscope - Click
authorize- Login with user credentials
testuser/testpassword - click
allow once - returned to the OpenAPI UI
- Login with user credentials
- Close modal
- All
/openapi-ui-test-app/private*operations now have a locked padlock - Expand
POST /openapi-ui-test-app/private- Click
Try Out - Click
Executeand get a200response
- Click
- Expand
GET /openapi-ui-test-app/apiKeyNeeded- Padlock is
unlocked - Description is
Get a random record - Click Try Out
- Click Execute and get a
403response
- Click Execute and get a
- Padlock is
- Click
Authorize- Enter apikey
12345 - Click
Authorize - Close modal
- Enter apikey
- Expand
/openapi-ui-test-app/apiKeyNeeded- Operation has a locked padlock
- Click
Try Out- Click
Executeand get a200response
- Click
- UI loads on https://localhost:9443/ibm/api/explorer/ with credentials
testuser/testpassword - Forced reload causes all resources to be reloaded
- OpenLiberty logo is at the top of the page
- The Filter box is present at the top of the page
- Filter using
openapi-ui-test-app(or any prefix of that) returns the operations - Filter using any other value returns no operations
- Top of the Page has
Liberty REST APIs -
OAS 3.0icon surrounding colour is#5d8203via element inspection - No
Validbutton in page footer
- Test for mpOpenAPI (OpenAPI 3.0)
- Stop the server:
./gradlew :openapi-3.0:libertyStop - Copy in the customization:
cp -r openapi-3.0/src/main/liberty/config/example-customization openapi-3.0/src/main/liberty/config/mpopenapi - Start the server:
./gradlew :openapi-3.0:libertyStart - Headerbar colour and logo has changed on https://localhost:9443/openapi/ui/ (may need to Shift-refresh)
- Stop the server:
- Test for mpOpenAPI (OpenAPI 3.0)
- Stop the server:
./gradlew :openapi-3.1:libertyStop - Copy in the customization:
cp -r openapi-3.1/src/main/liberty/config/example-customization openapi-3.1/src/main/liberty/config/mpopenapi - Start the server:
./gradlew :openapi-3.1:libertyStart - Headerbar colour and logo has changed on https://localhost:9444/openapi/ui/ (may need to Shift-refresh)
- Stop the server:
- Test for
openapi-3.xfeature- Stop the server:
./gradlew :openapi-3.0:libertyStop - Copy in the customization:
cp -r openapi-3.0/src/main/liberty/config/example-customization openapi-3.0/src/main/liberty/config/openapi-3.1 - Start the server:
./gradlew :openapi-3.0:libertyStart - Headerbar colour and logo has changed on https://localhost:9443/api/explorer/ (may need to Shift-refresh)
- Stop the server:
- Stop both servers with
./gradlew libertyStop