API文档速读:把第三方接口文档整理成可对接的速查材料
API文档速读是 SkillHub 社区 Skill(@user_70c2f807/api-doc-speed-reader,v1.0.0,knowledge-management),指导 Agent 在用户粘贴 API 文档后提取端点与参数、生成 curl/Python/JS 等示例、整理错误码与坑点,并可对比多份文档。无需 API Key。安装可通过 skillhub CLI 指定 Cursor、Claude Code、Codex 等 skills 目录,或下载官方 Zip。限制:不能仅凭外链读文档、不发起真实 HTTP、示例以粘贴内容为准。
Read MoreApifox Helper:在编辑器里把接口同步到 Apifox
Apifox Helper 是 SkillHub 社区 Skill(@user_3cf79a87/apifox-helper,v1.0.2),用于在用户要求时将当前选中接口上传或同步到 Apifox,或把 Controller 与路由处理函数导入 Apifox。需配置 API 密钥(requires_api_key=true)。可通过 skillhub install 安装到 Cursor、Claude Code、Codex 等对应 skills 目录。适合减少改代码后手工维护 Apifox 文档的成本。
Read MoreFastAPI 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 MoreFastAPI Practical: Building RESTful APIs with GET and POST Methods
FastAPI is a Python-based modern web framework with advantages such as high performance (close to Node.js and Go), automatic API documentation generation (Swagger UI and ReDoc), type hint support, and ease of use. For environment preparation, install FastAPI and uvicorn (recommended ASGI server). Quick start example: Create a root path endpoint (`@app.get("/")`) that returns a welcome message. Run with the command `uvicorn main:app --reload`. GET method practice includes: ① Path parameters (e.g., `/users/{user_id}`) with automatic type validation; ② Query parameters (e.g., `/users/filter?name=张三`) for filtering. POST method requires defining a Pydantic model (e.g., `UserCreate`) to receive JSON data, with automatic format validation and new user creation. FastAPI automatically generates API documentation; access `http://localhost:8000/docs` (Swagger UI) or `/redoc` to test interfaces. Its core advantages are summarized as: type hints, data validation, and interactive documentation, making it suitable for quickly building reliable RESTful APIs.
Read More