# normalize-typegen/src/input

Input format parsers that produce the typegen IR.

`jsonschema.rs` parses JSON Schema objects (via `serde_json::Value`) into a `Schema`; exports `parse_json_schema` and `ParseError`. `openapi.rs` parses OpenAPI 3.x documents (components/schemas section) into the same IR via `parse_openapi`. `typescript.rs` (feature `input-typescript`) parses TypeScript type declarations using tree-sitter via arborium-typescript; exports `parse_typescript_types`. `proto.rs` parses Protobuf IDL (`.proto` files) — messages become structs, enums become int-literal enums, `repeated` maps to arrays, `map<K,V>` maps to `Type::Map`, `optional` fields become optional; hand-rolled tokenizer (no tree-sitter grammar in arborium for proto); always available with no feature flag. `graphql.rs` (feature `input-graphql`) parses GraphQL SDL using tree-sitter via arborium-graphql; `type`/`input`/`interface` become structs, `enum` becomes string-literal enum, non-null `!` marks required fields, nullable fields are wrapped in `Type::Optional`; exports `parse_graphql_schema`. All parsers return `Result<Schema, ParseError>`.
