Skip to content

links

/links/*

This file describes the router for:

/links

GET /links

Return a regular /links response for an OPTIMADE implementation.

Source code in optimade_gateway/routers/links.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@ROUTER.get(
    "/links",
    response_model=LinksResponse,
    response_model_exclude_defaults=False,
    response_model_exclude_none=False,
    response_model_exclude_unset=True,
    tags=["Links"],
    responses=ERROR_RESPONSES,
)
async def get_links(
    request: Request, params: Annotated[EntryListingQueryParams, Depends()]
) -> LinksResponse:
    """`GET /links`

    Return a regular `/links` response for an OPTIMADE implementation.
    """
    return await get_entries(
        collection=await collection_factory(CONFIG.links_collection),
        response_cls=LinksResponse,
        request=request,
        params=params,
    )