normalize-spec

command
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

normalize-spec converts TypeBox-style OpenAPI 3.1 anyOf enum patterns to standard OpenAPI enum arrays for ogen compatibility.

TypeBox generates string enums as:

anyOf: [{type: string, enum: ["a"]}, {type: string, enum: ["b"]}]

This tool converts them to:

type: string
enum: ["a", "b"]

Output JSON has object keys sorted lexicographically for deterministic diffs.

Usage: normalize-spec <input.json> <output.json>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL