API Interface Testing: Turning Interface-Level Testing into Executable Scripts

This article introduces the community-sourced Skill "API Interface Testing" (@user_fa905b36/api-testing, version 0.5.0, category dev-programming). It starts from OpenAPI/Swagger documents or test case schemas, automatically covers parameters, boundary conditions, authentication, idempotency, concurrency, error responses, and data consistency, and produces executable API test scripts along with execution results. The article outlines the capability scope, the division of responsibilities with automated-e2e-testing and test-case-writing, the prerequisites for activation (requires_api_key=true), typical workflow chains, and usage considerations.

Read More
swagger-to-testcases: Generating Test Cases and Complete Testing Framework from Swagger/OpenAPI Specification Files

swagger-to-testcases is a tool that generates automated API test cases from Swagger/OpenAPI specification files and comes with a complete pytest testing framework. It supports Swagger/OpenAPI 2.0 or 3.x specification files (in JSON or YAML format) as input, and outputs 26-column Excel test case sheets along with pytest framework files. It also provides complete infrastructure, including configuration, HTTP clients, logging, and reporting.

Read More
FastAPI Documentation Auto-generation: Tips for Using Swagger and OpenAPI

FastAPI's automatic documentation is based on the OpenAPI specification, providing interactive API documentation through Swagger UI and ReDoc. It can quickly display interface functions, parameters, and return values, supporting direct testing. Enabling it is simple: create a FastAPI application, and after running, access `/docs` (Swagger UI) or `/redoc` (ReDoc) to view the documentation. Core techniques include: setting global information (title, description, version, etc.) using FastAPI constructor parameters; using function annotations and the `Path`/`Query` utility classes to describe interfaces and parameters in detail; categorizing interfaces with `tags` for easy filtering; hiding internal interfaces with `include_in_schema=False`; using Pydantic models to standardize return formats, or `HTTPException` to mark error status codes. These methods can enhance document clarity and usability, avoid the trouble of manual writing and maintenance, ensure consistency between interface information and code, and optimize team collaboration and user experience.

Read More