pub struct UndescribedInput { /* private fields */ }Expand description
A handler input an operation describes without its fields.
Fields are inferred by driving the type’s Deserialize impl and recording what it asks
for. A struct with a #[serde(flatten)] field asks to be read as a map instead - so that
the keys it does not name can be collected for the flattened member - and a map does not
say which keys it takes, so none of the struct’s fields can be inferred, the ones declared
beside the flattened member included. Such a request body is described as an object
without properties - or as any value, when the struct sits somewhere inside it - and such
query parameters are not described at all.
Describing the input by hand, with OpenApiRouteConfig::with_request_schema or
OpenApiRouteConfig::with_query_schema, takes it off
OpenApiRouteConfig::undescribed_inputs.
Implementations§
Source§impl UndescribedInput
impl UndescribedInput
Sourcepub fn type_name(&self) -> &'static str
pub fn type_name(&self) -> &'static str
Returns the type the extractor reads, as std::any::type_name spells it
Sourcepub fn read_as_map(&self) -> Option<&str>
pub fn read_as_map(&self) -> Option<&str>
Returns what serde expects of the struct it reads as a map, when that struct sits
inside the type rather than being the type itself: struct Name, for a derived one