- ID_SCHEMA =
{ 'oneOf' => [{ 'type' => 'integer' },
{ 'type' => 'string', 'format' => 'uuid' },] }.freeze
- ID =
JsonSchema.parse!(ID_SCHEMA)
- VIEWMODEL_UPDATE_SCHEMA =
{
'type' => 'object',
'description' => 'viewmodel update',
'properties' => { ViewModel::TYPE_ATTRIBUTE => { 'type' => 'string' },
ViewModel::ID_ATTRIBUTE => ID_SCHEMA,
ViewModel::NEW_ATTRIBUTE => { 'oneOf' => [{ 'type' => 'boolean' }, { 'type' => 'string', 'enum' => ['auto'] }] },
ViewModel::VERSION_ATTRIBUTE => { 'type' => 'integer' } },
'required' => [ViewModel::TYPE_ATTRIBUTE],
}.freeze
- VIEWMODEL_UPDATE =
JsonSchema.parse!(VIEWMODEL_UPDATE_SCHEMA)
- VIEWMODEL_REFERENCE_SCHEMA =
{
'type' => 'object',
'description' => 'viewmodel shared reference',
'properties' => { ViewModel::REFERENCE_ATTRIBUTE => { 'type' => 'string' } },
'additionalProperties' => false,
'required' => [ViewModel::REFERENCE_ATTRIBUTE],
}.freeze
- VIEWMODEL_REFERENCE =
JsonSchema.parse!(VIEWMODEL_REFERENCE_SCHEMA)
- BULK_UPDATE_SCHEMA =
{
'type' => 'object',
'description' => 'bulk update collection',
'properties' => {
ViewModel::TYPE_ATTRIBUTE => {
'type' => 'string',
'enum' => [ViewModel::BULK_UPDATE_TYPE],
},
ViewModel::BULK_UPDATES_ATTRIBUTE => {
'type' => 'array',
'items' => {
'type' => 'object',
'properties' => {
ViewModel::ID_ATTRIBUTE => ID_SCHEMA,
ViewModel::BULK_UPDATE_ATTRIBUTE => {
'oneOf' => [
{ 'type' => 'array' },
{ 'type' => 'object' },
]
},
},
'additionalProperties' => false,
'required' => [
ViewModel::ID_ATTRIBUTE,
ViewModel::BULK_UPDATE_ATTRIBUTE,
],
},
}
},
'additionalProperties' => false,
'required' => [
ViewModel::TYPE_ATTRIBUTE,
ViewModel::BULK_UPDATES_ATTRIBUTE,
],
}.freeze
- BULK_UPDATE =
JsonSchema.parse!(BULK_UPDATE_SCHEMA)