commits
- Rename Peertube module references to Peer_tube in client library
- Refactor bushel_peertube to use generated Peer_tube types
- Remove hand-coded JSON codecs in favor of generated ones
- Add helper functions to extract values from Jsont.json for untyped fields
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>
The code generator was ignoring parameters that use $ref references
(e.g., $ref: '#/components/parameters/idOrUUID'). This caused path
template parameters like {id} to not be substituted in the generated
code.
Changes:
- Add param_name_from_ref to extract parameter name from $ref string
- Add resolve_parameter to look up referenced parameters in components
- Update analyze_operation to accept spec and path_item_params
- Merge path_item parameters with operation parameters
- Add explicit type annotation for path_item to fix type inference
The peertube library is regenerated with this fix, so get_video and
similar endpoints now correctly accept their path parameters.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add YAML support to openapi-gen CLI using yamlt library
- Fix recursive schema handling (self-referential types use Jsont.json)
- Fix topological sort to ignore self-dependencies
- Fix newline before @param in generated doc comments
- Generate PeerTube library from official OpenAPI spec (v8.0.0)
- Add peertube_auth library with OAuth2 session management
- Add peertube CLI with auth commands (login, logout, status, profiles)
- Remove old hand-written PeerTube library modules
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Git operations:
- Add retry logic with exponential backoff for HTTP 5xx errors
- Retry on RPC failures, curl errors, connection issues
- 3 retries with 2s/4s/8s delays before failing
- Apply to clone, fetch, pull, push, and subtree operations
Sources registry (sources.toml):
- New module for tracking package URL overrides
- default_url_base for deriving URLs from subtree names
- Per-package entries with url, upstream, branch, reason
Verse config:
- Add knot field for git push server (e.g., "git.recoil.org")
- Default to "git.recoil.org" if not present in config
- Auto-write knot to config file if missing
URL handling:
- Remove hardcoded anil.recoil.org references
- Derive git push server from handle or use configured knot
- Generic SSH URL normalization in forks.ml
Sync resilience:
- Skip failed clones in merge/subtree phases instead of crashing
- Track successfully fetched repos separately from failures
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename Peertube module references to Peer_tube in client library
- Refactor bushel_peertube to use generated Peer_tube types
- Remove hand-coded JSON codecs in favor of generated ones
- Add helper functions to extract values from Jsont.json for untyped fields
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>
The code generator was ignoring parameters that use $ref references
(e.g., $ref: '#/components/parameters/idOrUUID'). This caused path
template parameters like {id} to not be substituted in the generated
code.
Changes:
- Add param_name_from_ref to extract parameter name from $ref string
- Add resolve_parameter to look up referenced parameters in components
- Update analyze_operation to accept spec and path_item_params
- Merge path_item parameters with operation parameters
- Add explicit type annotation for path_item to fix type inference
The peertube library is regenerated with this fix, so get_video and
similar endpoints now correctly accept their path parameters.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add YAML support to openapi-gen CLI using yamlt library
- Fix recursive schema handling (self-referential types use Jsont.json)
- Fix topological sort to ignore self-dependencies
- Fix newline before @param in generated doc comments
- Generate PeerTube library from official OpenAPI spec (v8.0.0)
- Add peertube_auth library with OAuth2 session management
- Add peertube CLI with auth commands (login, logout, status, profiles)
- Remove old hand-written PeerTube library modules
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Git operations:
- Add retry logic with exponential backoff for HTTP 5xx errors
- Retry on RPC failures, curl errors, connection issues
- 3 retries with 2s/4s/8s delays before failing
- Apply to clone, fetch, pull, push, and subtree operations
Sources registry (sources.toml):
- New module for tracking package URL overrides
- default_url_base for deriving URLs from subtree names
- Per-package entries with url, upstream, branch, reason
Verse config:
- Add knot field for git push server (e.g., "git.recoil.org")
- Default to "git.recoil.org" if not present in config
- Auto-write knot to config file if missing
URL handling:
- Remove hardcoded anil.recoil.org references
- Derive git push server from handle or use configured knot
- Generic SSH URL normalization in forks.ml
Sync resilience:
- Skip failed clones in merge/subtree phases instead of crashing
- Track successfully fetched repos separately from failures
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>