Trait poem_openapi::types::Type [−][src]
pub trait Type: Sized + Send + Sync {
const NAME: TypeName;
const IS_REQUIRED: bool;
fn schema_ref() -> MetaSchemaRef;
fn parse(value: Value) -> ParseResult<Self>;
fn parse_from_str(value: Option<&str>) -> ParseResult<Self>;
fn to_value(&self) -> Value;
fn register(registry: &mut Registry) { ... }
}
Expand description
Represents a OpenAPI type.
Associated Constants
const IS_REQUIRED: bool
const IS_REQUIRED: bool
If it is true
, it means that this value is required.
Required methods
fn schema_ref() -> MetaSchemaRef
fn schema_ref() -> MetaSchemaRef
Get schema reference of this type.
fn parse(value: Value) -> ParseResult<Self>
fn parse(value: Value) -> ParseResult<Self>
Parse from serde_json::Value
.
fn parse_from_str(value: Option<&str>) -> ParseResult<Self>
fn parse_from_str(value: Option<&str>) -> ParseResult<Self>
Parse from string.
Convert this value to serde_json::Value
.