pub struct OpenApiMethodSpec {
pub method_name: String,
pub summary: Option<String>,
pub description: Option<String>,
pub parameters: Option<Value>,
pub result: Option<Value>,
pub errors: Vec<OpenApiError>,
pub tags: Vec<String>,
pub examples: Vec<OpenApiExample>,
}Expand description
OpenAPI specification for a single JSON-RPC method
Fields§
§method_name: String§summary: Option<String>§description: Option<String>§parameters: Option<Value>§result: Option<Value>§errors: Vec<OpenApiError>§examples: Vec<OpenApiExample>Implementations§
Source§impl OpenApiMethodSpec
impl OpenApiMethodSpec
Sourcepub fn with_summary(self, summary: impl Into<String>) -> Self
pub fn with_summary(self, summary: impl Into<String>) -> Self
Add a summary
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Add a description
Sourcepub fn with_parameters(self, params: Value) -> Self
pub fn with_parameters(self, params: Value) -> Self
Add parameter schema
Sourcepub fn with_result(self, result: Value) -> Self
pub fn with_result(self, result: Value) -> Self
Add result schema
Sourcepub fn with_error(self, error: OpenApiError) -> Self
pub fn with_error(self, error: OpenApiError) -> Self
Add an error specification
Sourcepub fn with_example(self, example: OpenApiExample) -> Self
pub fn with_example(self, example: OpenApiExample) -> Self
Add an example
Trait Implementations§
Source§impl Clone for OpenApiMethodSpec
impl Clone for OpenApiMethodSpec
Source§fn clone(&self) -> OpenApiMethodSpec
fn clone(&self) -> OpenApiMethodSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenApiMethodSpec
impl Debug for OpenApiMethodSpec
Source§impl<'de> Deserialize<'de> for OpenApiMethodSpec
impl<'de> Deserialize<'de> for OpenApiMethodSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OpenApiMethodSpec
impl RefUnwindSafe for OpenApiMethodSpec
impl Send for OpenApiMethodSpec
impl Sync for OpenApiMethodSpec
impl Unpin for OpenApiMethodSpec
impl UnwindSafe for OpenApiMethodSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more