pub struct MethodOpenApi {
pub resource: bool,
pub description: String,
pub request_schema: String,
pub response_schema: String,
pub error_responses: HashMap<u32, String>,
pub http_rule_index: u32,
pub path_parameter_name: String,
pub extensions: HashMap<String, String>,
pub datasource: bool,
}
Expand description
MethodOpenAPI is a message used to annotate gRPC methods with additional OpenAPI-specific metadata. This includes whether the method operates on a REST resource, its description, request schema, error responses, and the index of the HTTP rule where endpoints is defined.
Fields§
§resource: bool
Indicates if the method operates on a REST resource.
description: String
Description of the method.
request_schema: String
Schema of the request message. (Used when you want to use different schema than the one that will be generated from method request mesage type).
response_schema: String
Schema of the response message. (Used when you want to use different schema than the one that will be generated from method response mesage type).
error_responses: HashMap<u32, String>
Map of error response codes to descriptions.
http_rule_index: u32
Index of the associated HTTP rule.
path_parameter_name: String
Name of the path parameter used in openapi spec.
extensions: HashMap<String, String>
Map of extensions. Value is a free-form property to include a JSON of this field. This is copied to generated schema. Quotes must be escaped.
datasource: bool
Indicates if the method is a datasource.
Trait Implementations§
source§impl Clone for MethodOpenApi
impl Clone for MethodOpenApi
source§fn clone(&self) -> MethodOpenApi
fn clone(&self) -> MethodOpenApi
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MethodOpenApi
impl Debug for MethodOpenApi
source§impl Default for MethodOpenApi
impl Default for MethodOpenApi
source§impl<'de> Deserialize<'de> for MethodOpenApi
impl<'de> Deserialize<'de> for MethodOpenApi
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>,
source§impl Message for MethodOpenApi
impl Message for MethodOpenApi
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for MethodOpenApi
impl PartialEq for MethodOpenApi
source§impl Serialize for MethodOpenApi
impl Serialize for MethodOpenApi
impl StructuralPartialEq for MethodOpenApi
Auto Trait Implementations§
impl Freeze for MethodOpenApi
impl RefUnwindSafe for MethodOpenApi
impl Send for MethodOpenApi
impl Sync for MethodOpenApi
impl Unpin for MethodOpenApi
impl UnwindSafe for MethodOpenApi
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request