Function rocket_okapi_fork::request::get_nested_form_parameters [−][src]
pub fn get_nested_form_parameters<T>(
gen: &mut OpenApiGenerator,
_name: String,
required: bool
) -> Vec<Parameter> where
T: JsonSchema,
Expand description
Given an object that implements the JsonSchema
generate all the Parameter
that are used to create documentation.
Use when manualy implementing a
Form Guard.
Example:
use rocket::form::FromForm; use serde::{Serialize, Deserialize}; use schemars::JsonSchema; use rocket_okapi::{ gen::OpenApiGenerator, request::OpenApiFromForm, request::get_nested_form_parameters }; #[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema, FromForm)] pub struct ApiPagination{ page: Option<u32>, per_page: Option<u32>, }