Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [9]: item.validate()
- ---------------------------------------------------------------------------
- ValidationError Traceback (most recent call last)
- ~/src/pystac-schwehr/pystac/validation/stac_validator.py in validate_core(self, stac_dict, stac_object_type, stac_version, href)
- 163 try:
- --> 164 self._validate_from_uri(stac_dict, schema_uri)
- 165 return schema_uri
- ~/src/pystac-schwehr/pystac/validation/stac_validator.py in _validate_from_uri(self, stac_dict, schema_uri)
- 124 schema, resolver = self.get_schema_from_uri(schema_uri)
- --> 125 jsonschema.validate(instance=stac_dict, schema=schema, resolver=resolver)
- 126 for uri in resolver.store:
- /usr/lib/python3/dist-packages/jsonschema/validators.py in validate(instance, schema, cls, *args, **kwargs)
- 933 if error is not None:
- --> 934 raise error
- 935
- ValidationError: None is not of type 'object'
- Failed validating 'type' in schema[0]:
- {'properties': {'bbox': {'items': {'type': 'number'},
- 'minItems': 4,
- 'type': 'array'},
- 'coordinates': {'items': {'type': 'number'},
- 'minItems': 2,
- 'type': 'array'},
- 'type': {'enum': ['Point'], 'type': 'string'}},
- 'required': ['type', 'coordinates'],
- 'title': 'GeoJSON Point',
- 'type': 'object'}
- On instance:
- None
- The above exception was the direct cause of the following exception:
- STACValidationError Traceback (most recent call last)
- <ipython-input-9-ea5aa8dfeb4d> in <module>
- ----> 1 item.validate()
- ~/src/pystac-schwehr/pystac/stac_object.py in validate(self)
- 239 STACValidationError
- 240 """
- --> 241 return pystac.validation.validate(self)
- 242
- 243 def get_root(self):
- ~/src/pystac-schwehr/pystac/validation/__init__.py in validate(stac_object)
- 39 STACValidationError
- 40 """
- ---> 41 validate_dict(stac_dict=stac_object.to_dict(),
- 42 stac_object_type=stac_object.STAC_OBJECT_TYPE,
- 43 stac_version=pystac.get_stac_version(),
- ~/src/pystac-schwehr/pystac/validation/__init__.py in validate_dict(stac_dict, stac_object_type, stac_version, extensions, href)
- 85 extensions = info.common_extensions
- 86
- ---> 87 return RegisteredValidator.get_validator().validate(stac_dict, stac_object_type, stac_version,
- 88 extensions, href)
- 89
- ~/src/pystac-schwehr/pystac/validation/stac_validator.py in validate(self, stac_dict, stac_object_type, stac_version, extensions, href)
- 68 """
- 69 results = []
- ---> 70 core_result = self.validate_core(stac_dict, stac_object_type, stac_version, href)
- 71 if core_result is not None:
- 72 results.append(core_result)
- ~/src/pystac-schwehr/pystac/validation/stac_validator.py in validate_core(self, stac_dict, stac_object_type, stac_version, href)
- 167 msg = self._get_error_message(schema_uri, stac_object_type, None, href,
- 168 stac_dict.get('id'))
- --> 169 raise STACValidationError(msg, source=e) from e
- 170
- 171 def validate_extension(self, stac_dict, stac_object_type, stac_version, extension_id,
- STACValidationError: Validation failed for ITEM with ID USGS/GAP/CONUS/2011 against schema at https://schemas.stacspec.org/v1.0.0-beta.2/item-spec/json-schema/item.json
- In [10]: pystac.validation.validate(item)
- ---------------------------------------------------------------------------
- ValidationError Traceback (most recent call last)
- ~/src/pystac-schwehr/pystac/validation/stac_validator.py in validate_core(self, stac_dict, stac_object_type, stac_version, href)
- 163 try:
- --> 164 self._validate_from_uri(stac_dict, schema_uri)
- 165 return schema_uri
- ~/src/pystac-schwehr/pystac/validation/stac_validator.py in _validate_from_uri(self, stac_dict, schema_uri)
- 124 schema, resolver = self.get_schema_from_uri(schema_uri)
- --> 125 jsonschema.validate(instance=stac_dict, schema=schema, resolver=resolver)
- 126 for uri in resolver.store:
- /usr/lib/python3/dist-packages/jsonschema/validators.py in validate(instance, schema, cls, *args, **kwargs)
- 933 if error is not None:
- --> 934 raise error
- 935
- ValidationError: None is not of type 'object'
- Failed validating 'type' in schema[0]:
- {'properties': {'bbox': {'items': {'type': 'number'},
- 'minItems': 4,
- 'type': 'array'},
- 'coordinates': {'items': {'type': 'number'},
- 'minItems': 2,
- 'type': 'array'},
- 'type': {'enum': ['Point'], 'type': 'string'}},
- 'required': ['type', 'coordinates'],
- 'title': 'GeoJSON Point',
- 'type': 'object'}
- On instance:
- None
- The above exception was the direct cause of the following exception:
- STACValidationError Traceback (most recent call last)
- <ipython-input-10-ada00c668668> in <module>
- ----> 1 pystac.validation.validate(item)
- ~/src/pystac-schwehr/pystac/validation/__init__.py in validate(stac_object)
- 39 STACValidationError
- 40 """
- ---> 41 validate_dict(stac_dict=stac_object.to_dict(),
- 42 stac_object_type=stac_object.STAC_OBJECT_TYPE,
- 43 stac_version=pystac.get_stac_version(),
- ~/src/pystac-schwehr/pystac/validation/__init__.py in validate_dict(stac_dict, stac_object_type, stac_version, extensions, href)
- 85 extensions = info.common_extensions
- 86
- ---> 87 return RegisteredValidator.get_validator().validate(stac_dict, stac_object_type, stac_version,
- 88 extensions, href)
- 89
- ~/src/pystac-schwehr/pystac/validation/stac_validator.py in validate(self, stac_dict, stac_object_type, stac_version, extensions, href)
- 68 """
- 69 results = []
- ---> 70 core_result = self.validate_core(stac_dict, stac_object_type, stac_version, href)
- 71 if core_result is not None:
- 72 results.append(core_result)
- ~/src/pystac-schwehr/pystac/validation/stac_validator.py in validate_core(self, stac_dict, stac_object_type, stac_version, href)
- 167 msg = self._get_error_message(schema_uri, stac_object_type, None, href,
- 168 stac_dict.get('id'))
- --> 169 raise STACValidationError(msg, source=e) from e
- 170
- 171 def validate_extension(self, stac_dict, stac_object_type, stac_version, extension_id,
- STACValidationError: Validation failed for ITEM with ID USGS/GAP/CONUS/2011 against schema at https://schemas.stacspec.org/v1.0.0-beta.2/item-spec/json-schema/item.json
Add Comment
Please, Sign In to add comment