Skip to content

feat(api): add APIFlask decorators to improve generated API spec doc#857

Draft
tang-mm wants to merge 11 commits intomainfrom
certtf-780-api-docstring
Draft

feat(api): add APIFlask decorators to improve generated API spec doc#857
tang-mm wants to merge 11 commits intomainfrom
certtf-780-api-docstring

Conversation

@tang-mm
Copy link
Copy Markdown
Contributor

@tang-mm tang-mm commented Dec 31, 2025

This PR enhances the Server API documentation using inline docstrings and decorators in v1.py, following APIFlask pattern. This improves the auto-generated OpenAPI spec with comprehensive documentation.

Description

API endpoint documentation migrated from server/API.md to v1.py:

  • method docstring: the first line is "summary", followed by endpoint description text
  • @v1.input and @v1.output decorators for request/response
  • @v1.doc(responses={...}) decorators for non-200 status codes
  • Moved parameter descriptions from docstrings to Schema metadata in schema.py

Schema definition:

  • Added several new Marshmallow schemas for better explaining endpoint input and output
  • Added field-level metadata descriptions to schemas

Resolved issues

CERTTF-780

Documentation

Web service API changes

API docstring and decorators are added or updated, no behavior changes.

Tests

Using the test introduced in #852 :

$ uvx --with tox-uv tox run -e schema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant