Skip to content

Improve request and response handling - #10

Merged
Siyet merged 2 commits into
mainfrom
3
Nov 16, 2026
Merged

Siyet merged 2 commits into
mainfrom
3

Conversation

@Siyet

@Siyet Siyet commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Implement step 3 of #3:

  • Use msgspec for request validation, response encoding and default validation-error rendering, without direct Pydantic imports or serialization fallbacks. Reject unsupported Pydantic models and data objects.
  • Compile translated FastAPI/Body/Field string patterns with Rust regex. Reject compiled Python patterns on this path; native msgspec.Meta(pattern=...) retains its existing behavior.
  • Support JSONL/SSE generator endpoints and custom response classes, preserving dependency cleanup and application exception handlers. Explicit SSE events use the exact ServerSentEvent class with raw_data or metadata only.
  • Add structured body error locations and multiple errors for supported types without repeating model hooks or default factories.
  • Check defaults and copied route metadata with an internal C extension before and after copying, preserving standard-library deepcopy behavior. Add native ABI3 wheel build and test jobs for CPython 3.11-3.14 on Linux, macOS and Windows.

JSON body and response types must be supported by msgspec. FastAPI still depends on Pydantic for its own internals. Building this package from source requires a C11 compiler and CPython headers.

Local Linux Docker checks cover Python 3.11-3.14 at both FastAPI bounds, including reuse of the Python 3.11-built ABI3 wheel. Source typing, native stub checks and distribution checks also pass.

@Siyet
Siyet merged commit b545519 into main Nov 16, 2026
18 checks passed
@Siyet
Siyet deleted the 3 branch November 16, 2026 07:20
@Siyet Siyet mentioned this pull request Nov 16, 2026
25 tasks done
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