#golang #kubernetes-crd #openapi #crd #kubernetes

amalgam-parser

Schema parsers for CRD, OpenAPI, and Go types for amalgam

8 releases (4 breaking)

0.6.4 Sep 1, 2025
0.6.2 Sep 1, 2025
0.4.1 Aug 29, 2025
0.3.0 Aug 28, 2025
0.1.0 Aug 28, 2025

#14 in #crd

Download history

262 downloads per month
Used in 2 crates

Apache-2.0

270KB
6K SLoC

amalgam-parser

Schema parsing library for amalgam, supporting multiple input formats.

Overview

amalgam-parser reads schemas from various sources and converts them to amalgam's unified intermediate representation.

Supported Formats

  • OpenAPI/Swagger: v2.0 and v3.0+ specifications
  • Kubernetes CRDs: Custom Resource Definitions with OpenAPI schemas
  • JSON Schema: Draft 4, 6, 7, and 2020-12
  • Go Source: AST parsing of Go structs and interfaces
  • Protocol Buffers (planned): .proto file parsing

Usage

use amalgam_parser::{Parser, CrdParser, OpenApiParser};

// Parse Kubernetes CRDs
let crd_parser = CrdParser::new();
let schema = crd_parser.parse_file("my-crd.yaml")?;

// Parse from live cluster
let schema = crd_parser.parse_from_cluster("my.crd.io", "v1")?;

// Parse OpenAPI spec
let openapi_parser = OpenApiParser::new();
let schema = openapi_parser.parse_file("openapi.yaml")?;

Features

  • Automatic format detection
  • Schema validation
  • Type inference
  • Dependency resolution
  • Incremental parsing support

Dependencies

~47–68MB
~1M SLoC