pub struct EnumSchema {
pub description: String,
pub default: String,
pub title: String,
pub required: bool,
pub read_only: bool,
pub external_docs: Option<ExternalDocumentation>,
pub example: String,
pub ref: String,
pub extensions: HashMap<String, Value>,
}Expand description
EnumSchema is subset of fields from the OpenAPI v2 specification’s Schema object.
Only fields that are applicable to Enums are included
See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject
Example:
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_enum) = { … title: “MyEnum”; description:“This is my nice enum”; example: “ZERO”; required: true; … };
Fields§
§description: StringA short description of the schema.
default: String§title: StringThe title of the schema.
required: bool§read_only: bool§external_docs: Option<ExternalDocumentation>Additional external documentation for this schema.
example: String§ref: StringRef is used to define an external reference to include in the message.
This could be a fully qualified proto message reference, and that type must
be imported into the protofile. If no message is identified, the Ref will
be used verbatim in the output.
For example:
ref: ".google.protobuf.Timestamp".
extensions: HashMap<String, Value>Custom properties that start with “x-” such as “x-foo” used to describe extra functionality that is not covered by the standard OpenAPI Specification. See: https://swagger.io/docs/specification/2-0/swagger-extensions/
Trait Implementations§
Source§impl Clone for EnumSchema
impl Clone for EnumSchema
Source§fn clone(&self) -> EnumSchema
fn clone(&self) -> EnumSchema
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EnumSchema
impl Debug for EnumSchema
Source§impl Default for EnumSchema
impl Default for EnumSchema
Source§impl<'de> Deserialize<'de> for EnumSchema
impl<'de> Deserialize<'de> for EnumSchema
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 EnumSchema
impl Message for EnumSchema
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 EnumSchema
impl PartialEq for EnumSchema
Source§impl Serialize for EnumSchema
impl Serialize for EnumSchema
impl StructuralPartialEq for EnumSchema
Auto Trait Implementations§
impl Freeze for EnumSchema
impl RefUnwindSafe for EnumSchema
impl Send for EnumSchema
impl Sync for EnumSchema
impl Unpin for EnumSchema
impl UnwindSafe for EnumSchema
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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