pacman.utilities.file_format_schemas package

Subpackages

Module contents

A simple bit of support code for validation.

pacman.utilities.file_format_schemas.validate(json_obj: List[int | float | str | None | Dict[str, int | float | str | None | JsonObject | List[int | float | str | None | JsonObject | JsonArray]] | List[int | float | str | None | Dict[str, int | float | str | None | JsonObject | JsonArray] | JsonArray]] | Dict[str, int | float | str | None | Dict[str, int | float | str | None | JsonObject | List[int | float | str | None | JsonObject | JsonArray]] | List[int | float | str | None | Dict[str, int | float | str | None | JsonObject | JsonArray] | JsonArray]] | List[Dict[str, int | float | str | None | Dict[str, int | float | str | None | JsonObject | List[int | float | str | None | JsonObject | JsonArray]] | List[int | float | str | None | Dict[str, int | float | str | None | JsonObject | JsonArray] | JsonArray]]], schema_filename: str) None[source]

Check that the given JSON object (or array) is valid against the given schema. The schema is given by filename relative to this package.

Parameters:
  • json_obj (dict or list) – The entity to validate

  • schema_filename (str) – The name of the file containing the schema (e.g., “routes.json”)

Raises: