Clone this repository
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gz
Sync opam package metadata including x-maintenance-intent
and external dependency specifications.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add default value support: extract JSON defaults and generate OCaml literals
for bools, ints, floats, strings, enums, null, and empty arrays
- Generate constructors with optional params using ?(name=default) syntax
- Generate jsont codecs with ~dec_absent:default for absent field handling
- Add runtime validation for strings (minLength, maxLength, pattern),
numbers (minimum, maximum, exclusiveMinimum, exclusiveMaximum),
and lists (minItems, maxItems, uniqueItems)
- Add field-level union types for primitive oneOf/anyOf schemas
- Handle forward references in circular dependencies with Jsont.json fallback
- Improve topological sort to handle cycles gracefully
- Regenerate immich and peertube clients with new features
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Major enhancements to the OpenAPI code generator:
1. allOf composition support:
- Added resolve_schema_ref to look up referenced schemas
- Added flatten_all_of to recursively merge properties from composed schemas
- Added expand_schema to resolve allOf before generating types
- VideoDetails now contains all 50+ fields from Video merged in
2. Property type reference resolution:
- Updated type_of_json_schema to handle allOf with $ref in properties
- Properties like "id: allOf: [$ref: '#/components/schemas/id']" now
resolve to the correct type
3. Nullable field handling:
- Added is_nullable tracking to field_info
- Added nullable combinators to runtime (nullable_any, nullable_string,
nullable_ptime, nullable_int, nullable_float, nullable_bool)
- Fields marked "nullable: true" use these combinators to handle both
absent and explicit JSON null values
4. public_name in generated dune files:
- Libraries are now public by default for proper dependency management
The peertube library now generates fully typed records with proper
accessors for all schemas, including composed types like VideoDetails.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>