Guideline
Use camelCase for query parameters, api payloads and custom headers
Use hyphen in API urls
OpenAPI Specs
Check out the open api specs HERE.API Client(Swagger UI)
Swagger UI has been integrated to automate API testing for branch or environment deployments. This allows testing the API endpoints with authentication.
Running Swagger UI
To start Swagger UI with authentication, use the following command:
make swagger-ui email=<email> password=<password> branch=<branch_name>
Parameters
branch
- The deployed branch name orstage
orproduction
.email
- The email address for authentication.password
- The password for authentication.
How It Works
The script creates a user in the Cognito User Pool using the provided email and password.
It retrieves the IdToken after successful authentication.
Swagger UI is configured with the necessary authentication token and API url.
Swagger UI launches, allowing interaction with the API endpoints.
Accessing Swagger UI
Once Swagger UI is running, open a web browser and go to:
http://localhost:8080/
From there, you can use the Swagger UI interface to test the API endpoints.
Example Usage
To test APIs on a deployed branch feature-xyz
, run:
make swagger-ui email=user@example.com password=SecurePass123 branch=feature-xyz
For the stage environment:
make swagger-ui email=admin@example.com password=ProdPass123 branch=stage
Notes
The authentication token is valid for a limited period; rerun the command if it expires.
API Gateway updates must be correctly deployed for the specified branch or environment.