Skip to content

Commit

Permalink
Pydantic/fastAPI no longer handle generic Mapping for Config classes
Browse files Browse the repository at this point in the history
This all worked before but now we have to force the Config
to a plain dict before it will be accepted.
  • Loading branch information
timj committed Jul 18, 2023
1 parent 2e129be commit e0894c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/lsst/daf/butler/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ def read_server_config() -> Mapping:
db: <butlerRoot>
"""
config = Config.fromString(config_str, format="yaml")
return config
return config.toDict()


@app.get("/butler/v1/universe", response_model=dict[str, Any])
def get_dimension_universe(butler: Butler = Depends(butler_readonly_dependency)) -> DimensionConfig:
"""Allow remote client to get dimensions definition."""
return butler.dimensions.dimensionConfig
return butler.dimensions.dimensionConfig.toDict()


@app.get("/butler/v1/uri/{id}", response_model=str)
Expand Down

0 comments on commit e0894c6

Please sign in to comment.