diff --git a/CHANGES.md b/CHANGES.md index 995630dd..5c204b36 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). Note: Minor version `0.X.0` update might break the API, It's recommended to pin `tipg` to minor version: `tipg>=0.1,<0.2` +## [unreleased] + +- add `tags` to all routes + ## [0.5.6] - 2023-12-19 - Fix collections `prev` links and collections html templates diff --git a/docs/src/advanced/customization.md b/docs/src/advanced/customization.md index 93d5cca8..acf8c04d 100644 --- a/docs/src/advanced/customization.md +++ b/docs/src/advanced/customization.md @@ -41,7 +41,7 @@ async def lifespan(app: FastAPI): app = FastAPI(openapi_url="/api", docs_url="/api.html", lifespan=lifespan) endpoints = OGCFeaturesFactory(with_common=True) -app.include_router(endpoints.router, tags=["OGC Features API"]) +app.include_router(endpoints.router) add_exception_handlers(app, DEFAULT_STATUS_CODES) ``` diff --git a/docs/src/user_guide/factories.md b/docs/src/user_guide/factories.md index 95722f43..a1775d71 100644 --- a/docs/src/user_guide/factories.md +++ b/docs/src/user_guide/factories.md @@ -67,7 +67,7 @@ from tipg.factory import OGCFeaturesFactory app = FastAPI() endpoints = OGCFeaturesFactory(with_common=True) -app.include_router(endpoints.router, tags=["OGC Features API"]) +app.include_router(endpoints.router) ``` #### Creation Options @@ -106,7 +106,7 @@ from tipg.factory import OGCTilesFactory app = FastAPI() endpoints = OGCTilesFactory(with_common=True) -app.include_router(endpoints.router, tags=["OGC Tiles API"]) +app.include_router(endpoints.router) ``` #### Creation Options diff --git a/tipg/factory.py b/tipg/factory.py index 9f8789db..9cefbfa0 100644 --- a/tipg/factory.py +++ b/tipg/factory.py @@ -409,6 +409,7 @@ def _collections_route(self): # noqa: C901 } }, }, + tags=["OGC Features API"], ) def collections( request: Request, @@ -529,6 +530,7 @@ def _collection_route(self): } }, }, + tags=["OGC Features API"], ) def collection( request: Request, @@ -616,6 +618,7 @@ def _queryables_route(self): } }, }, + tags=["OGC Features API"], ) def queryables( request: Request, @@ -662,6 +665,7 @@ def _items_route(self): # noqa: C901 "model": model.Items, }, }, + tags=["OGC Features API"], ) async def items( # noqa: C901 request: Request, @@ -918,6 +922,7 @@ def _item_route(self): "model": model.Item, }, }, + tags=["OGC Features API"], ) async def item( request: Request, @@ -1150,6 +1155,7 @@ def _tilematrixsets_routes(self): }, }, }, + tags=["OGC Tiles API"], ) async def tilematrixsets( request: Request, @@ -1202,6 +1208,7 @@ async def tilematrixsets( }, }, }, + tags=["OGC Tiles API"], ) async def tilematrixset( request: Request, @@ -1248,6 +1255,7 @@ def _tilesets_routes(self): }, summary="Retrieve a list of available vector tilesets for the specified collection.", operation_id=".collection.vector.getTileSetsList", + tags=["OGC Tiles API"], ) async def collection_tileset_list( request: Request, @@ -1331,6 +1339,7 @@ async def collection_tileset_list( responses={200: {"content": {MediaType.json.value: {}}}}, summary="Retrieve the vector tileset metadata for the specified collection and tiling scheme (tile matrix set).", operation_id=".collection.vector.getTileSet", + tags=["OGC Tiles API"], ) async def collection_tileset( request: Request, @@ -1442,12 +1451,14 @@ def _tile_routes(self): response_class=Response, responses={200: {"content": {MediaType.mvt.value: {}}}}, operation_id=".collection.vector.getTileTms", + tags=["OGC Tiles API"], ) @self.router.get( "/collections/{collectionId}/tiles/{z}/{x}/{y}", response_class=Response, responses={200: {"content": {MediaType.mvt.value: {}}}}, operation_id=".collection.vector.getTile", + tags=["OGC Tiles API"], ) async def collection_get_tile( request: Request, @@ -1521,6 +1532,7 @@ def _tilejson_routes(self): response_model_exclude_none=True, response_class=ORJSONResponse, operation_id=".collection.vector.getTileJSONTms", + tags=["OGC Tiles API"], ) @self.router.get( "/collections/{collectionId}/tilejson.json", @@ -1529,6 +1541,7 @@ def _tilejson_routes(self): response_model_exclude_none=True, response_class=ORJSONResponse, operation_id=".collection.vector.getTileJSON", + tags=["OGC Tiles API"], ) async def collection_tilejson( request: Request, @@ -1620,6 +1633,7 @@ def _stylejson_routes(self): response_model_exclude_none=True, response_class=ORJSONResponse, operation_id=".collection.vector.getStyleJSONTms", + tags=["OGC Tiles API"], ) @self.router.get( "/collections/{collectionId}/style.json", @@ -1628,6 +1642,7 @@ def _stylejson_routes(self): response_model_exclude_none=True, response_class=ORJSONResponse, operation_id=".collection.vector.getStyleJSON", + tags=["OGC Tiles API"], ) async def collection_stylejson( request: Request, @@ -1849,7 +1864,7 @@ def register_routes(self): # We do not want `/` and `/conformance` from the factory with_common=False, ) - self.router.include_router(self.ogc_features.router, tags=["OGC Features API"]) + self.router.include_router(self.ogc_features.router) self.ogc_tiles = OGCTilesFactory( collection_dependency=self.collection_dependency, @@ -1860,4 +1875,4 @@ def register_routes(self): # We do not want `/` and `/conformance` from the factory with_common=False, ) - self.router.include_router(self.ogc_tiles.router, tags=["OGC Tiles API"]) + self.router.include_router(self.ogc_tiles.router)