pub struct MetaDataVocabulary {
pub title: Option<String>,
pub description: Option<String>,
pub default: Option<Value>,
pub deprecated: bool,
pub read_only: bool,
pub write_only: bool,
pub examples: Option<Vec<Value>>,
}Expand description
Meta-data vocabulary — annotations (title, description, etc.).
Fields§
§title: Option<String>The title keyword — short summary annotation.
The value of this keyword MUST be a string.
Both "title" and "description" can be used to decorate a
user interface with information about the data produced by this
user interface. A title will preferably be short, whereas a
description will provide explanation about the purpose of the
instance described by this schema.
description: Option<String>The description keyword — explanatory annotation.
The value of this keyword MUST be a string.
Both "title" and "description" can be used to decorate a
user interface with information about the data produced by this
user interface. A title will preferably be short, whereas a
description will provide explanation about the purpose of the
instance described by this schema.
default: Option<Value>The default keyword — default value annotation.
There are no restrictions placed on the value of this keyword. When multiple occurrences of this keyword are applicable to a single sub-instance, implementations SHOULD remove duplicates.
This keyword can be used to supply a default JSON value associated with a particular schema. It is RECOMMENDED that a default value be valid against the associated schema.
deprecated: boolThe deprecated keyword — deprecation annotation.
The value of this keyword MUST be a boolean. When multiple occurrences of this keyword are applicable to a single sub-instance, applications SHOULD consider the instance location to be deprecated if any occurrence specifies a true value.
If "deprecated" has a value of boolean true, it indicates that
applications SHOULD refrain from usage of the declared property.
It MAY mean the property is going to be removed in the future.
A root schema containing "deprecated" with a value of true
indicates that the entire resource being described MAY be removed
in the future.
The "deprecated" keyword applies to each instance location to
which the schema object containing the keyword successfully
applies. This can result in scenarios where every array item or
object property is deprecated even though the containing array
or object is not.
Omitting this keyword has the same behavior as a value of false.
read_only: boolThe readOnly keyword — read-only annotation.
The value of this keyword MUST be a boolean. When multiple occurrences of this keyword are applicable to a single sub-instance, the resulting behavior SHOULD be as for a true value if any occurrence specifies a true value, and SHOULD be as for a false value otherwise.
If "readOnly" has a value of boolean true, it indicates that
the value of the instance is managed exclusively by the owning
authority, and attempts by an application to modify the value of
this property are expected to be ignored or rejected by that
owning authority.
An instance document that is marked as "readOnly" for the
entire document MAY be ignored if sent to the owning authority,
or MAY result in an error, at the authority’s discretion.
Omitting this keyword has the same behavior as a value of false.
write_only: boolThe writeOnly keyword — write-only annotation.
The value of this keyword MUST be a boolean.
If "writeOnly" has a value of boolean true, it indicates that
the value is never present when the instance is retrieved from
the owning authority. It can be present when sent to the owning
authority to update or create the document (or the resource it
represents), but it will not be included in any updated or newly
created version of the instance.
An instance document that is marked as "writeOnly" for the
entire document MAY be returned as a blank document of some
sort, or MAY produce an error upon retrieval, or have the
retrieval request ignored, at the authority’s discretion.
Omitting this keyword has the same behavior as a value of false.
examples: Option<Vec<Value>>The examples keyword — example values annotation.
The value of this keyword MUST be an array. There are no restrictions placed on the values within the array. When multiple occurrences of this keyword are applicable to a single sub-instance, implementations MUST provide a flat array of all values rather than an array of arrays.
This keyword can be used to provide sample JSON values associated with a particular schema, for the purpose of illustrating usage. It is RECOMMENDED that these values be valid against the associated schema.
Implementations MAY use the value(s) of "default", if present,
as an additional example. If "examples" is absent, "default"
MAY still be used in this manner.
Trait Implementations§
Source§impl Clone for MetaDataVocabulary
impl Clone for MetaDataVocabulary
Source§fn clone(&self) -> MetaDataVocabulary
fn clone(&self) -> MetaDataVocabulary
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MetaDataVocabulary
impl Debug for MetaDataVocabulary
Source§impl Default for MetaDataVocabulary
impl Default for MetaDataVocabulary
Source§fn default() -> MetaDataVocabulary
fn default() -> MetaDataVocabulary
Source§impl<'de> Deserialize<'de> for MetaDataVocabulary
impl<'de> Deserialize<'de> for MetaDataVocabulary
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 JsonSchema for MetaDataVocabulary
impl JsonSchema for MetaDataVocabulary
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for MetaDataVocabulary
impl PartialEq for MetaDataVocabulary
Source§impl Serialize for MetaDataVocabulary
impl Serialize for MetaDataVocabulary
impl Eq for MetaDataVocabulary
impl StructuralPartialEq for MetaDataVocabulary
Auto Trait Implementations§
impl Freeze for MetaDataVocabulary
impl RefUnwindSafe for MetaDataVocabulary
impl Send for MetaDataVocabulary
impl Sync for MetaDataVocabulary
impl Unpin for MetaDataVocabulary
impl UnsafeUnpin for MetaDataVocabulary
impl UnwindSafe for MetaDataVocabulary
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.