julee.domain.use_cases.pointable_json_schema

PointableJSONSchema utility for generating standalone schemas from JSON pointer targets.

This module provides the PointableJSONSchema class that handles the complexity of extracting targeted schema sections while preserving important root metadata needed for proper JSON Schema validation and structured outputs.

Classes

PointableJSONSchema

Utility for generating standalone schemas from JSON pointer targets.

Module Contents

class julee.domain.use_cases.pointable_json_schema.PointableJSONSchema(root_schema)[source]

Utility for generating standalone schemas from JSON pointer targets.

This class takes a complete root schema and provides methods to generate standalone schemas for specific JSON pointer targets, preserving important root metadata like $schema, $id, definitions, etc.

schema_for_pointer(json_pointer)[source]

Generate a standalone schema for the given JSON pointer target.

This method extracts the target schema section using the JSON pointer and builds a complete, standalone schema that preserves important root metadata while making the pointer target the main content structure.

Parameters:

json_pointer (str) – JSON pointer string (e.g., “/properties/title”)

Returns:

Complete standalone schema with preserved metadata, suitable for structured outputs or standalone validation

Raises:

ValueError – If JSON pointer is invalid or cannot be resolved

Return type:

dict[str, Any]

root_schema[source]