stac-extensions / stac-extensions.github.io

Overview of STAC Extensions, with advice on creating new extensions
https://stac-extensions.github.io
Apache License 2.0
14 stars 9 forks source link

sat extension #12

Closed matthewhanson closed 3 years ago

matthewhanson commented 3 years ago

Update https://github.com/stac-extensions/sat with https://github.com/radiantearth/stac-spec/tree/3a83d75aec7f16ae597ee9779777a97e83ff46a4/extensions/sat

cholmes commented 3 years ago

I ported all the content, but I'm not totally sure what I'm doing on the schema. Made an attempt but I'm not sure if it's right. If someone could check it over and fix any problems that'd be great. Or I can pick this up tomorrow (thursday) and figure out how to validate locally, etc.

matthewhanson commented 3 years ago

Removed the template examples, updated the landsat8 and sentinel1 examples, updated schema. All checks out now.

Original sat extension defined minItems as 1, whereas @cholmes JSON schema utilizes "anyOf" with "required"..it accomplishes the same thing but I'm wondering what is the best practice here given that requirements are separated from definitions where minItems is declared. Can we just declare minItems here rather than in the reference "fields"? @m-mohr ?

m-mohr commented 3 years ago

Original sat extension also uses anyOf, which is correct. minProperties doesn't have any effect as it also counts for example the datetime property.

cholmes commented 3 years ago

Thanks for updating. I borrowed the anyOf with required from the view extension.

@m-mohr - you're saying that the original sat extension did the check right too? I couldn't figure out if it was doing the required check right, so was definitely cargo culting from the view extension.

I took notes on the schema stuff - I'd like to make a section that explains to people not experienced with JSON Schema how to make one for their extension.

My other question was how to run the validation locally before the publish step. I heard you all talking about it, but wasn't sure. Is it just npm run check-examples? Or something else?

cholmes commented 3 years ago

And are we ready for release of this one now?

m-mohr commented 3 years ago

Let me please check all schemas once until we release any of the extensions. anyOf is how it is meant to be implemented.

Yes, check-examples does validate the example, which doesn't necessarily mean the schema is correct.

m-mohr commented 3 years ago

Going to review now

m-mohr commented 3 years ago

Reviewed and fixed several things, but it doesn't validate yet due to a "dependency" on sar. So we should release that first.

m-mohr commented 3 years ago

Published.