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

pin fastapi to previous version #242

Closed
vincentsarago opened this issue Aug 26, 2021 · 0 comments
Closed

pin fastapi to previous version #242

vincentsarago opened this issue Aug 26, 2021 · 0 comments

Comments

@vincentsarago
Copy link
Member

first reported in developmentseed/geojson-pydantic#42

Here is what we get when requesting /docs

...
  File "/usr/local/lib/python3.8/site-packages/fastapi/openapi/utils.py", line 410, in get_openapi
    return jsonable_encoder(OpenAPI(**output), by_alias=True, exclude_none=True)  # type: ignore
  File "pydantic/main.py", line 406, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 21 validation errors for OpenAPI
components -> schemas -> LineString -> properties -> coordinates -> items -> anyOf -> 0 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> LineString -> properties -> coordinates -> items -> anyOf -> 1 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> LineString -> $ref
  field required (type=value_error.missing)
components -> schemas -> MultiLineString -> properties -> coordinates -> items -> items -> anyOf -> 0 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> MultiLineString -> properties -> coordinates -> items -> items -> anyOf -> 1 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> MultiLineString -> $ref
  field required (type=value_error.missing)
components -> schemas -> MultiPoint -> properties -> coordinates -> items -> anyOf -> 0 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> MultiPoint -> properties -> coordinates -> items -> anyOf -> 1 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> MultiPoint -> $ref
  field required (type=value_error.missing)
components -> schemas -> MultiPolygon -> properties -> coordinates -> items -> items -> items -> anyOf -> 0 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> MultiPolygon -> properties -> coordinates -> items -> items -> items -> anyOf -> 1 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> MultiPolygon -> $ref
  field required (type=value_error.missing)
components -> schemas -> PgstacSearch -> properties -> bbox -> anyOf -> 0 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> PgstacSearch -> properties -> bbox -> anyOf -> 1 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> PgstacSearch -> $ref
  field required (type=value_error.missing)
components -> schemas -> Point -> properties -> coordinates -> anyOf -> 0 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> Point -> properties -> coordinates -> anyOf -> 1 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> Point -> $ref
  field required (type=value_error.missing)
components -> schemas -> Polygon -> properties -> coordinates -> items -> items -> anyOf -> 0 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> Polygon -> properties -> coordinates -> items -> items -> anyOf -> 1 -> items
  value is not a valid dict (type=type_error.dict)
components -> schemas -> Polygon -> $ref
  field required (type=value_error.missing)
...

As mentioned in the geojson-pydantic issue, the latest version of fastapi doesn't support Tuple with fixed size (work is ongoing to change this but not yet merged). While it worked with earlier fastapi version (0.65.1), the schema is not well representer (e.g for center: Optional[Tuple[float, float, int]] the openapi schema cannot render it but at least docs are shown 🤷‍♂️)

I'm not 100% sure which is the best version to use so it will need a closer look

@vincentsarago vincentsarago changed the title pin fastapi version to previous version pin fastapi to previous version Aug 26, 2021
lossyrob added a commit that referenced this issue Aug 27, 2021
This pins fastapi to 0.67.* in stac_fastapi.types, and has all other
packages rely on that dependency to pull in the correct version. This
also adds a missing dependency on stac_fastapi.types in
stac_fastapi.api.

Fixes #242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant