Skip to content

Module stac_fastapi.api.openapi

openapi.

Functions

config_openapi

def config_openapi(
    app: fastapi.applications.FastAPI,
    settings: stac_fastapi.types.config.ApiSettings
)

Config openapi.

update_openapi

def update_openapi(
    app: fastapi.applications.FastAPI
) -> fastapi.applications.FastAPI

Update OpenAPI response content-type.

This function modifies the openapi route to comply with the STAC API spec's required content-type response header.

Classes

VndOaiResponse

class VndOaiResponse(
    *args,
    **kwargs
)

JSON with custom, vendor content-type.

Ancestors (in MRO)

  • starlette.responses.JSONResponse
  • starlette.responses.Response

Class variables

charset
media_type

Instance variables

headers

Methods

def delete_cookie(
    self,
    key: 'str',
    path: 'str' = '/',
    domain: 'str | None' = None,
    secure: 'bool' = False,
    httponly: 'bool' = False,
    samesite: "typing.Literal[('lax', 'strict', 'none')] | None" = 'lax'
) -> 'None'

init_headers

def init_headers(
    self,
    headers: 'typing.Mapping[str, str] | None' = None
) -> 'None'

render

def render(
    self,
    content: 'typing.Any'
) -> 'bytes'
def set_cookie(
    self,
    key: 'str',
    value: 'str' = '',
    max_age: 'int | None' = None,
    expires: 'datetime | str | int | None' = None,
    path: 'str' = '/',
    domain: 'str | None' = None,
    secure: 'bool' = False,
    httponly: 'bool' = False,
    samesite: "typing.Literal[('lax', 'strict', 'none')] | None" = 'lax'
) -> 'None'