STAC validator does not run as expected
Hi,
I'd like to test the STAC validator on my backend, but cannot get it running on my system: miniconda Python 3.10.4 on Windows 10 64bit.
After installing the package using pip install stac-validator I tried to run the executable: stac-validator -v stac-collections.out, which led to the error:
Please upgrade from version to version 1.0.0!
[
{
"version": "",
"path": "stac-collections.out",
"schema": [
""
],
"valid_stac": false,
"error_type": "KeyError",
"error_message": "'stac_version'"
}
]
I think there's something wrong internally, so I haven't attached stac-collections.out, but can do so if you want me to.
Running from within the python CLI leads to a similar error:
>>> from stac_validator import stac_validator
>>> url = 'https://geodb.openeo.dev.brockmann-consult.de/collections'
>>> stac = stac_validator.StacValidate(url)
>>> stac.run()
False
>>> print(stac.message)
[{'version': '', 'path': 'https://geodb.openeo.dev.brockmann-consult.de/collections', 'schema': [''], 'valid_stac': False, 'error_type': 'KeyError', 'error_message': "'stac_version'"}]
Hi @thomasstorm Can I see your file if it's not too long? The error may be saying that you have not specified a stac version. It's not recognizing your file as an item or a collection either I think?
Sure, it's attached. Note that I had to rename it to .txt so I could upload it. stac-collections.txt
Hi you have to take this part out {"collections":
Your file should start like this: {"stac_version": "0.9.0",
Here's an example https://github.com/stac-utils/stac-examples/blob/main/landsat8/LC81530252014153LGN00.json
This one is a collection https://github.com/radiantearth/stac-spec/blob/master/examples/collection.json
Hi you have to take this part out
{"collections":Your file should start like this:
{"stac_version": "0.9.0",
That's interesting! I was following the directions of openEO, who state that their specification is compatible with STAC API 0.9.0. So that piece of information is wrong, I guess, and they mean they are compatible with v1.0.0 instead?
My result seems to be compatible with STAC 1.0.0: https://api.stacspec.org/v1.0.0-rc.1/collections/#tag/Collections
What you are looking at is an api response which is different than normal STAC format.
Ok - sorry about that, I was not aware that there are differences. In any case, the error message is not helpful -- it insinuates that I should upgrade the stac validator, and does not really tell me what's wrong.
It could be better yes. I guess the first thing it looks for is a stac version because it needs to look up the right schema to test against.
#220 is pretty much asking for what is missing here.