-
Notifications
You must be signed in to change notification settings - Fork 31
fix Link 'label:assets' field type as list #183
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
Conversation
@vincentsarago |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
==========================================
- Coverage 96.59% 95.52% -1.07%
==========================================
Files 25 25
Lines 587 671 +84
==========================================
+ Hits 567 641 +74
- Misses 20 30 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
min_length=1, | ||
alias="label:assets", | ||
validation_alias=AliasChoices("label:assets", "label_assets", "label"), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 well to be honest I believe we should just remove the label attribute and let extension
be handled with validate_extensions
https://github.com/stac-utils/stac-pydantic?tab=readme-ov-file#extensions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That makes the most sense IMO as well.
Are all extensions validated automatically by STAC-FastAPI when POSTing a STAC Item?
I don't see explicit calls to validate_extensions
in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think they are validated but we could add an option. Can you open an issue in stac-fastapi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I can look into adding that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature ready: stac-utils/stac-fastapi-pgstac#269
Replacement for this PR: #184
Posting a STAC Item that contains
label:assets
as defined below results in a validation error since thestr
doesn't match the expected list (https://github.com/stac-extensions/label?tab=readme-ov-file#links-source-imagery).I've tested that the fix works as expected by running our https://github.com/crim-ca/stac-app (STAC-FastAPI) with this
stac-pydantic
patch applied.