Add const
This commit is contained in:
parent
00f79281db
commit
49b2d1f89d
4 changed files with 7 additions and 3 deletions
|
@ -32,7 +32,7 @@ macro_rules! impl_merge {
|
|||
impl_merge!(SchemaObject {
|
||||
merge: definitions extensions instance_type enum_values
|
||||
number string array object,
|
||||
or: schema id title description format all_of any_of one_of not
|
||||
or: schema id title description format const_value all_of any_of one_of not
|
||||
if_schema then_schema else_schema,
|
||||
});
|
||||
|
||||
|
|
|
@ -47,13 +47,13 @@ pub struct SchemaObject {
|
|||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
|
||||
// TODO Set instead of Vec
|
||||
pub instance_type: Option<SingleOrVec<InstanceType>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub format: Option<String>,
|
||||
#[serde(rename = "enum", skip_serializing_if = "Option::is_none")]
|
||||
// TODO Set instead of Vec
|
||||
pub enum_values: Option<Vec<Value>>,
|
||||
#[serde(rename = "const", skip_serializing_if = "Option::is_none")]
|
||||
pub const_value: Option<Value>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub all_of: Option<Vec<Schema>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
|
|
@ -101,6 +101,9 @@
|
|||
},
|
||||
"nullable": true
|
||||
},
|
||||
"const": {
|
||||
"nullable": true
|
||||
},
|
||||
"contains": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
|
|
@ -117,6 +117,7 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"const": true,
|
||||
"contains": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue