From fc8d7c27ae842af26713d69be27ab776c25f6661 Mon Sep 17 00:00:00 2001 From: Nahuel Date: Mon, 23 Dec 2024 14:31:19 +0100 Subject: [PATCH] Fmt --- poem-openapi-derive/src/api.rs | 2 +- poem-openapi/src/base.rs | 8 +++++--- poem-openapi/src/registry/mod.rs | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/poem-openapi-derive/src/api.rs b/poem-openapi-derive/src/api.rs index 8f7e0e8374..88bb45a4fe 100644 --- a/poem-openapi-derive/src/api.rs +++ b/poem-openapi-derive/src/api.rs @@ -6,12 +6,12 @@ use syn::{ Path, ReturnType, Type, }; -use crate::parameter_style::ParameterStyle; use crate::{ common_args::{ APIMethod, CodeSample, DefaultValue, ExampleValue, ExternalDocument, ExtraHeader, }, error::GeneratorResult, + parameter_style::ParameterStyle, utils::{ convert_oai_path, get_crate_name, get_description, get_summary_and_description, optional_literal, optional_literal_string, parse_oai_attrs, remove_description, diff --git a/poem-openapi/src/base.rs b/poem-openapi/src/base.rs index 604fa407f8..f28f0159b9 100644 --- a/poem-openapi/src/base.rs +++ b/poem-openapi/src/base.rs @@ -31,9 +31,11 @@ pub enum ParameterStyle { Simple, /// Space-separated array values. Has effect only for non-exploded arrays. SpaceDelimited, - /// Pipeline-separated array values. Has effect only for non-exploded arrays. + /// Pipeline-separated array values. Has effect only for non-exploded + /// arrays. PipeDelimited, - /// Bracket-nested objects, e.g. `paramName[prop1]=value1¶mName[prop2]=value2` + /// Bracket-nested objects, e.g. + /// `paramName[prop1]=value1¶mName[prop2]=value2` DeepObject, } @@ -96,7 +98,7 @@ pub struct ExtractParamOptions { /// separate parameters for each value of the array or key-value pair of the /// map. pub explode: bool, - + /// The style of the parameter. pub style: Option, } diff --git a/poem-openapi/src/registry/mod.rs b/poem-openapi/src/registry/mod.rs index 1148812b2b..a26f9f78e5 100644 --- a/poem-openapi/src/registry/mod.rs +++ b/poem-openapi/src/registry/mod.rs @@ -11,8 +11,8 @@ use poem::http::Method; pub(crate) use ser::Document; use serde::{ser::SerializeMap, Serialize, Serializer}; use serde_json::Value; -use crate::ParameterStyle; -use crate::types::Type; + +use crate::{types::Type, ParameterStyle}; #[allow(clippy::trivially_copy_pass_by_ref)] #[inline] @@ -372,7 +372,7 @@ pub struct MetaOperationParam { pub required: bool, pub deprecated: bool, pub explode: bool, - pub style: Option + pub style: Option, } #[derive(Debug, PartialEq, Serialize)]