generated from stac-extensions/template
-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
The schema contains the following section:
{
"type": "object",
"$comment": "This validates the fields in Collection Assets, but does not require them.",
"required": [
"assets"
],
"properties": {
"assets": {
"type": "object",
"not": {
"additionalProperties": {
"not": {
"allOf": [
{
"$ref": "#/definitions/require_any_field"
},
{
"$ref": "#/definitions/fields"
}
]
}
}
}
}
}
}What is the semantics meant to be? Are the nots actually meant to be there? I would expect the idea is that if there are any assets then any processing properties within them should be valid, not invalid. In code, I'd expect the following test to pass:
it('should fail validation when asset processing expression is invalid', async () => {
// given
example.assets = {
'example': {
'href': 'https://example.org/file.xyz',
'processing:expression': null,
}
};
// when
let valid = validate(example);
// then
expect(valid).toBeFalsy();
expect(
validate.errors.some(
(error) =>
error.instancePath === '/assets/example/processing:expression'
&& error.message === 'must be object',
)
).toBeTruthy();
});Metadata
Metadata
Assignees
Labels
No labels