The API Test Generator provides a REST API for automatically generating pytest test cases from OpenAPI/Swagger specifications.
http://localhost:8080
Description: Health check endpoint
Request:
curl http://localhost:8080/healthResponse:
{
"status": "healthy",
"service": "API Test Generator"
}Status Code: 200 OK
Description: Generate pytest test cases from OpenAPI/Swagger specification
curl -X POST -F "file=@openapi.json" \
http://localhost:8080/generate-testscurl -X POST -H "Content-Type: application/json" \
-d @openapi.json \
http://localhost:8080/generate-testsResponse (Success):
{
"status": "success",
"test_code": "import pytest\nimport requests\n...",
"endpoints_count": 6
}Response (Error):
{
"error": "File must be JSON or YAML"
}Status Codes:
- 200: Success
- 400: Bad Request
- 500: Server Error
Description: Parse OpenAPI/Swagger specification and extract endpoints
Request:
curl -X POST -H "Content-Type: application/json" \
-d @openapi.json \
http://localhost:8080/parseResponse:
{
"status": "success",
"endpoints": [
{
"path": "/users",
"method": "GET",
"summary": "Get all users",
"parameters": [],
"responses": {"200": "Success"}
}
],
"count": 1
}Status Code: 200 OK
- OpenAPI 3.0
- Swagger 2.0
- JSON (.json)
- YAML (.yaml, .yml)
| Code | Message |
|---|---|
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Server Error |
curl -X POST -F "file=@openapi.json" \
http://localhost:8080/generate-tests \
-o generated_tests.pycurl -X POST -H "Content-Type: application/json" \
-d @openapi.json \
http://localhost:8080/parseFor issues: GitHub Issues For questions: GitHub Discussions