gram
Safe HaskellNone
LanguageHaskell2010

Gram.Schema.JSONSchema

Description

Generates JSON Schema (Draft 2020-12) for PatternSubject.

This module provides functions to generate a formal JSON Schema document that specifies the structure of PatternSubject for validation and documentation purposes.

Since: 0.1.0

Synopsis

Documentation

generatePatternSchema :: Value Source #

Generate complete JSON Schema (Draft 2020-12) for PatternSubject

Returns a JSON Value representing the complete schema document with: - Schema metadata ($schema, $id, version) - Pattern definition (recursive structure) - Subject definition (identity, labels, properties) - Value definitions (all 10 value types with discriminators)

Example usage: let schema = generatePatternSchema putStrLn $ encodePretty schema

Since: 0.1.0

generateSubjectDefinition :: Value Source #

Generate JSON Schema definition for Subject

Subject contains: - identity: string identifier - labels: array of strings - properties: map of string keys to Value types

Since: 0.1.0

generateValueDefinition :: Value Source #

Generate JSON Schema definition for Value with oneOf discriminator

Value uses oneOf to represent all 10 possible value types: - Simple: integer, number (decimal), boolean, string - Complex: symbol, tagged string, array, map, range, measurement

Since: 0.1.0