Skip to main content

Module content_type

Module content_type 

Source
Expand description

Content type enum and format resolution. Content type enum and format resolution.

Defines the unified content type for all interfaces. Lives in yeti-types (L0) so Context can reference it directly. Serialization implementations that need heavy deps (ciborium, rmp-serde, serde_yaml) live in yeti-sdk (L2).

Resolution priority:

  1. Transport headers (Upgrade, Accept: text/event-stream, Content-Type: application/grpc)
  2. URL extension (.json, .yaml, .sse, .proto, etc.)
  3. ?format= query parameter
  4. ?stream=sse query parameter
  5. Accept header (standard content negotiation)
  6. Default: JSON

Enums§

ContentType
Supported content types, transports, and discovery formats.

Functions§

resolve_format
Resolve content type from all sources. Zero allocations.
strip_extension
Strip a known file extension from a path segment.
strip_extension_from_path
Strip a known file extension from the last segment of a URL path.