Pular para conteúdo

tucoopy.io.schema

Bundled JSON Schema helpers.

This module loads JSON Schemas bundled with the package under tucoopy.io.schemas and exposes small helpers to:

  • return schema dicts (for validation tooling), and
  • write schema files to disk (for editors/CI).

Examples:

>>> from tucoopy.io.schema import animation_spec_schema
>>> schema = animation_spec_schema()
>>> isinstance(schema, dict)
True

animation_spec_schema

animation_spec_schema()

Return the JSON Schema for the tucoopy animation spec.

game_schema

game_schema()

Return the JSON Schema for tucoop.io.json.game_to_dict output.

write_schema

write_schema(path, *, which='animation_spec', indent=2)

Write a bundled schema JSON file to disk.

Parameters:

Name Type Description Default
path str | Path

Output path for the schema JSON.

required
which str

"animation_spec" or "game".

'animation_spec'