Skip to content

Latest commit

 

History

History
76 lines (75 loc) · 3.51 KB

TODO.md

File metadata and controls

76 lines (75 loc) · 3.51 KB

List of things to do:

  • Generation of controllers:
    • through #[Controller] annotation for mod
      • bootstrapping router and openapi spec
      • specify state type for State extractor as an optional argument
      • specify base path
    • Routing setup for handlers through #[Route] annotation.
      • generation and bootstrapping
      • allow multiple http methods for one handler
  • Requests:
    • Request body generation through #[RequestBody] annotation
      • for named struct - as a self-contained DTO
      • for unnamed struct with one element - as a wrapper around #[DTO]
      • request content type negotiation based on Content-Type header:
        • application/json
        • application/x-www-url-encoded
        • multipart/form-data
        • application/octet-stream
          • macro to generate newtype for axum::body::Bytes with custom content-type
        • text/plain
        • text/xml, application/xml
        • application/bson
        • application/cbor
    • thin wrappers around axum standard extractors:
      • Query
      • Query - we can't possibly type it, though
      • Path
      • HeaderMap
      • Request
      • Method
      • Extension
      • State
      • String
      • axum::body::Bytes
  • Responses:
    • Response variants generation:
      • for enum
      • for struct
      • support Result<T, E> where T and E are types annotated with #[Response]
      • detect collisions in http response codes for composite #[Response] types like Result<> IN COMPILE TIME
      • detect content-type mismatches in Result<> responses IN COMPILE TIME
    • Response content type negotiation based on Accept header
      • application/json
      • text/plain
      • text/html through custom trait
        • macro to define html template for specific type
      • application/octet-stream
      • text/xml, application/xml
      • application/bson
      • application/cbor
      • enforce a default Content-Type if no Accept header is specified
        • allow developer to amend default_format if there is only one possible format
    • Reject request before running the handler if handler cannot return an appropriate content type
    • HTTP response codes through annotation
  • DTO (Data transfer objects):
    • macro to generate DTOs for requests and responses through serde:
  • OpenAPI spec generation through utoipa
    • generate schemas for #[DTO]
    • generate schemas for #[RequestBody]
    • generate schemas for #[Response]
    • generate schemas for handlers
      • support content negotiation options for requests and responses
    • extract schemas into Components instead of inlining them
    • as a separate feature
    • integrated swagger-ui and alike - as separate features
  • Security schemas
  • Websockets
  • SSE
  • Overall design:
    • split into features
    • better organize macro generation code - quite messy at the moment
    • better tests
    • examples
    • documentation with cookbook
    • website