Replies: 4 comments
-
Seems like resolution is not yet complete:
|
Beta Was this translation helpful? Give feedback.
-
You tried to install If you install |
Beta Was this translation helpful? Give feedback.
-
It looks like the generic use of from geojson_pydantic import FeatureCollection
from geojson_pydantic.geometries import Geometry
from pydantic import BaseModel
from fastapi import FastAPI
class MyProperties(BaseModel):
a: int
MyFeatureCollection = FeatureCollection[Geometry, MyProperties]
app = FastAPI()
@app.get("/api/geojson", response_model=MyFeatureCollection)
def get_geojson() -> MyFeatureCollection:
return MyFeatureCollection.model_validate({"type": "FeatureCollection", "features": []})
if __name__ == "__main__":
uvicorn.run("main:app", host="localhost", port=8000, reload=True) I get the following error:
The error seems coming from the Note that with geojson_pydantic v0.6.3 and pydantic v1.9.1 the above code runs. versions
|
Beta Was this translation helpful? Give feedback.
-
We don't have a date yet, there are couple issues we wanted to fix first Thanks for the FastAPI issue, might be worth opening a new issue for this |
Beta Was this translation helpful? Give feedback.
-
When will there be a version on pypi / conda compatible with pydantic v2 ? From the repo it looks like it is ready.
Beta Was this translation helpful? Give feedback.
All reactions