Comments (4)
I also came across https://api.stacspec.org/v1.0.0-beta.1/core/#operation/getLandingPage.
https://github.com/TomAugspurger/stac-fastapi/tree/fix/landing-stac-version has a test that we match that spec. There are some missing things
> assert result == expected
E AssertionError: assert {'description...ion', 'title'} == {'conformsTo'...version', ...}
E Extra items in the right set:
E 'conformsTo'
E 'id'
E Full diff:
E {
E - 'conformsTo',
E 'description',...
E
E ...Full output truncated (7 lines hidden), use '-vv' to show
tests/resources/test_conformance.py:12: AssertionError
For at least id
, I think that's because the version of stac-pydantic pinned here is too old to include stac-utils/stac-pydantic#43. I see stac-utils/stac-pydantic#45 might be addressing the conformsTo
issue.
from stac-fastapi.
I think this is because the landing page sets
response_model_exclude_unset=True
. If I make this change
This is the case. It's kind of a weird interaction in pydantic that I wasn't aware of, where a default value that is set as a constant is excluded from the model output because technically it is not set.
import pydantic
class MyModel(pydantic.BaseModel):
const: str = pydantic.Field("stac-version", const=True)
inst = MyModel()
print(inst.json(exclude_unset=True))
>>> {}
I'd rather fix this upstream in stac-pydantic so that stac_version
is returned even if the response_model_exclude_unset
is set, since its definitely a field that should always be returned. I'm sure this is also a problem in Items and Collections.
Speaking of stac-pydantic, I have some time planned this week to update it to the latest version of the spec, at which point I think it makes sense to update this project to use the latest stac-pydantic version, which would contain a fix to this issue as well as the other stac-pydantic issues you mention.
from stac-fastapi.
This same behavior is also removing the geojson type
fields from the payload for similar reasons.
from stac-fastapi.
This is sort of fixed now that the api defaults to not using pydantic models to validate responses which skips this behavior. Closing for now but please feel free to reopen if this comes up again.
from stac-fastapi.
Related Issues (20)
- Collection update endpoint
- Upgrade fastapi version for Content-Type Header ReDoS HOT 1
- INFERRED_LINK_RELS is missing `items` links? HOT 1
- Datetime as null is not accepted by the STAC FASTAPI HOT 8
- Aliases in FilterExtensionGetRequest model are not working
- Simple search returns items onlly with properties.datetime field HOT 3
- Becoming a maintainer on this project HOT 5
- Examine if pr 442 introduces breaking changes HOT 2
- Document new enhanced middleware configuration options
- Cannot use custom fields in Items HOT 9
- Introduce a tool to bump all version strings across project before release
- Deprecate Context Extension module
- PUT "/collections/{collection_id}" throws "update_collection() missing 1 required positional argument: 'collection'" HOT 3
- Integration testing with key stac-fastapi backends HOT 5
- pin sub-modules (api/extensions) to specific version HOT 4
- Detect disabled extensions in requests HOT 2
- types in `BaseSearchGetRequest`?
- How to tell if search is for single datetime? (Should `str_to_interval` return a single value for that?) HOT 7
- Remove pystac HOT 1
- Authentication and authorization implementation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stac-fastapi.