Skip to main content

Module extract

Module extract 

Source
Expand description

axum extractors for JSON:API requests.

Each extractor is a thin binding: it reads the relevant part of the request and delegates to jsonapi_http, turning failures into a JsonApiError rejection.

Structs§

BaseUrl
The application’s base URL for building self/related links and the Location header, provided from application state via FromRef.
JsonApi
Typed JSON:API request-body extractor. Validates the Content-Type, buffers the body, and deserializes a Document<T>, rejecting with a JSON:API error document (415 / 400 / 409 / 422) on failure.
JsonApiQuery
JSON:API query-parameter extractor (sort/page/filter/fields/ include). Does not validate include paths — use JsonApiQueryValidated for that. Requires no application state.
JsonApiQueryValidated
JSON:API query extractor that additionally validates include paths against an Arc<TypeRegistry> pulled from application state, rooted at T’s resource type. Opt-in: apps without a registry use JsonApiQuery instead.
NegotiatedMediaType
The response media type negotiated by AcceptLayer, read back out of the request extensions where the layer stored it.