Skip to content

comicbox.formats.metron_api.schema

Metron API response schema.

A pass-through schema that accepts the mokkari Issue.model_dump(mode="json") dict under the metron_api root tag. The transform layer (comicbox/formats/metron_api/transform.py) maps fields into the comicbox internal schema; the schema’s job here is just to wrap-and-pass.

MetronApiSchema

Bases: JsonSchema

Top-level schema for Metron API responses.

Source code in comicbox/formats/metron_api/schema.py
15
16
17
18
19
20
21
22
23
24
25
26
class MetronApiSchema(JsonSchema):
    """Top-level schema for Metron API responses."""

    ROOT_TAG: str = "metron_api"
    ROOT_KEYPATH: str = "metron_api"

    metron_api = Raw()

    class Meta(JsonSchema.Meta):
        """Allow unknown to bypass through the Raw field."""

        unknown = "include"

Meta

Bases: Meta

Allow unknown to bypass through the Raw field.

Source code in comicbox/formats/metron_api/schema.py
23
24
25
26
class Meta(JsonSchema.Meta):
    """Allow unknown to bypass through the Raw field."""

    unknown = "include"