httk.serve.dsp.api

Adapt the bundled DSP OpenAPI contract through the public OpenAPI adapter.

Attributes

DCAT_MEDIA_TYPE

Full media type of the built-in alternate catalogue representation.

DCAT_PROFILE

DCAT-AP profile parameter used by the built-in alternate representation.

Functions

create_dsp_app(provider, *[, debug])

Create a mountable serving application for one DSP provider.

Module Contents

httk.serve.dsp.api.DCAT_MEDIA_TYPE = 'application/ld+json; profile="https://semiceu.github.io/DCAT-AP/releases/3.0.1/"'[source]

Full media type of the built-in alternate catalogue representation.

httk.serve.dsp.api.DCAT_PROFILE = 'https://semiceu.github.io/DCAT-AP/releases/3.0.1/'[source]

DCAT-AP profile parameter used by the built-in alternate representation.

httk.serve.dsp.api.create_dsp_app(provider, *, debug=False)[source]

Create a mountable serving application for one DSP provider.

Routes, methods, body schemas, status codes, and media types are loaded from the packaged OpenAPI 3.1 contract. Request and response validation resolves only the packaged offline schema registry.

Parameters:
  • provider (httk.serve.dsp.provider.DspProvider) – In-memory provider whose business operations are exposed.

  • debug (bool) – Whether Starlette debug responses are enabled for unexpected failures.

Returns:

Mountable serving application with the provider on app.state.

Raises:
  • TypeError – If provider is not a DspProvider.

  • RuntimeError – If the packaged contract uses an unsupported construct.

Return type:

httk.serve.http.ServeApp