Skip to content

Add experimental JTD to ESM validator code generator #136

@cursor

Description

@cursor

Goal

Add an experimental CLI that reads a JTD schema (RFC 8927) and generates an ES2020 ESM validator exporting validate() for browser BroadcastChannel payload validation.

Scope (deliberately limited)

Support only:

  • properties
  • optionalProperties
  • type primitives
  • enum
  • metadata.id

Reject the rest (elements, values, discriminator/mapping, ref/definitions, nested properties) with:

Unsupported JTD feature: <feature>. This experimental tool only supports flat schemas with properties, optionalProperties, type, and enum.

Deliverables

  • New Maven module producing a shaded jtd-esm-codegen uber-jar (CLI entry point).
  • Code in package io.github.simbo1905.json.jtd.codegen.
  • Unit tests + sample schema.
  • Nightly GitHub Actions workflow building jar + GraalVM native binaries for linux/windows/macos (amd64/arm64).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions