Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation error reported only in stac-browser #504

Open
vprivat-ads opened this issue Nov 15, 2024 · 4 comments
Open

Validation error reported only in stac-browser #504

vprivat-ads opened this issue Nov 15, 2024 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@vprivat-ads
Copy link

I face a STAC validation error from stac-browser, related to the timestamps extension:

timestamps v1.1.0 Extension
/properties/published must match format "date-time" (format: date-time)
/type must be equal to constant (allowed value: Collection)
/type must be equal to constant (allowed value: Catalog)
must match exactly one schema in "oneOf" (passing schemas: null), for schema #/oneOf 

My STAC item is as follows:
S1A_20241114143038056552_redacted.json

I don't understand the error as the contents look valid to me. I tried to validate the file manually with stac-node-validator and it reports valid contents too, even in strict mode:

$ stac-node-validator ~/S1A_20241114143038056552_redacted.json  --verbose --strict
STAC Node Validator v2.0.0-beta.13

Config
  {
    verbose: true,
    strict: true,
    lint: false,
    format: false,
    schemas: null,
    schemaMap: {},
    custom: null,
    ignoreCerts: false,
    depth: -1,
    config: null,
    loader: [AsyncFunction: loader]
  }

/home/me/S1A_20241114143038056552_redacted.json
  STAC Version: 1.0.0
  Feature: valid
  Extensions
    https://stac-extensions.github.io/timestamps/v1.1.0/schema.json: valid

Summary (1)
  Valid: 1
  Invalid: 0
  Skipped: 0

So I don't understand if I face a bug from stac-browser, stac-node-validator, or simply invalid contents in my data :(

@m-mohr
Copy link
Collaborator

m-mohr commented Nov 17, 2024

Hmm, the published property looks valid to me. So I assume there's some difference between browser JS and Node JS that comes into play here, maybe just different versions of the dependencies (ajv/ajv-formats). Needs further investigation...

@m-mohr m-mohr added the bug Something isn't working label Nov 17, 2024
@m-mohr m-mohr added this to the 3.3.0 milestone Nov 17, 2024
@vprivat-ads
Copy link
Author

Another weird thing is that for other items where only the date changes, the contents are reported valid. I couldn't characterize the problem yet, I wonder if it only affects dates with milliseconds part starting with a zero or something like that.

@m-mohr
Copy link
Collaborator

m-mohr commented Nov 18, 2024

Another wieird thing is that published is valid and reported as invalid, but datetime/start_datetime/end_datetime are all invalid but not reported as invalid (it should end with a Z, not +00:00).

@m-mohr
Copy link
Collaborator

m-mohr commented Nov 18, 2024

I can reproduce it, but it's really weird. The same string set as datetime and it validates, although it's the same schema and validator. If I change the value slightly in published it also works. I'm a little clueless right now and will investigate further whenever I have a bit more time. Your item seems to be valid at first sight so just ignore the STAC Browser report for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants