Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Oct 31, 2023
1 parent 766718a commit f4ef32e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions docs/src/user_guide/factories.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@
# pseudo code
class Factory:

collections_dependency: Callable
collection_dependency: Callable

def __init__(self, collection_dependency: Callable):
def __init__(self, collections_dependency: Callable, collection_dependency: Callable):
self.collections_dependency = collections_dependency
self.collection_dependency = collection_dependency
self.router = APIRouter()

self.register_routes()

def register_routes(self):

@self.router.get("/collections")
def collections(
request: Request,
collection_list=Depends(self.collections_dependency),
):
...

@self.router.get("/collections/{collectionId}")
def collection(
request: Request,
Expand All @@ -27,6 +36,7 @@ class Factory:
request: Request,
collection=Depends(self.collection_dependency),
):
item_list = collection.items(...)
...

@self.router.get("/collections/{collectionId}/items/{itemId}")
Expand All @@ -35,6 +45,7 @@ class Factory:
collection=Depends(self.collection_dependency),
itemId: str = Path(..., description="Item identifier"),
):
item_list = collection.items(item_id=[itemId])
...


Expand All @@ -61,7 +72,7 @@ app.include_router(endpoints.router, tags=["OGC Features API"])

#### Creation Options

- **catalog_dependency** (Callable[..., tipg.collections.Catalog]): Callable which return a Catalog instance
- **collections_dependency** (Callable[..., tipg.collections.CollectionList]): Callable which return a CollectionList dictionary

- **collection_dependency** (Callable[..., tipg.collections.Collection]): Callable which return a Collection instance

Expand Down Expand Up @@ -143,7 +154,7 @@ app.include_router(endpoints.router)

#### Creation Options

- **catalog_dependency** (Callable[..., tipg.collections.Catalog]): Callable which return a Catalog instance
- **collections_dependency** (Callable[..., tipg.collections.CollectionList]): Callable which return a CollectionList dictionary

- **collection_dependency** (Callable[..., tipg.collections.Collection]): Callable which return a Collection instance

Expand Down

0 comments on commit f4ef32e

Please sign in to comment.