Skip to content

Preserve OpenAPI examples and distinct HTTP media contracts - #1056

Merged
CaliLuke merged 2 commits into
mainfrom
luca/openapi-examples-media-contracts
Oct 30, 2026
Merged

CaliLuke merged 2 commits into
mainfrom
luca/openapi-examples-media-contracts

Conversation

@CaliLuke

Copy link
Copy Markdown
Owner

OpenAPI generation now preserves every authored schema-level example, including nulls and duplicates, while keeping media examples at their own scope.

Multiple request and response content entries now import as typed service union branches with MediaType HTTP mappings. Generated transports select the branch and codec from Content-Type, preserve per-media schemas, examples and field encoding, and validate exact/range selection. Existing single-media output is unchanged. Public documentation explains regeneration, range publication and custom codec ownership.

Each issue is a separate independently reviewed commit. Merge without squashing to preserve those atomic changes.

Import each media schema, examples and encoding into an independent typed
branch. Select generated request and response codecs by Content-Type, with
validated exact/range matching and branch-specific form representations.

Fixes #975.
@CaliLuke
CaliLuke merged commit 6a1229f into main Oct 30, 2026
15 checks passed
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 106 files, which is 6 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7b992a4e-7623-44b3-8bb4-7f28ec611ed0
Commits

Reviewing files that changed from the base of the PR and between 73762eb and 5e511cc.

Files ignored due to path filters: 3
  • http/integration_tests/fixtures/ticktock/gen/loom.json is excluded by !**/gen/**
  • jsonrpc/integration_tests/fixtures/mixedtick/gen/loom.json is excluded by !**/gen/**
  • jsonrpc/integration_tests/fixtures/ticktock/gen/loom.json is excluded by !**/gen/**
Files selected for processing: 106
  • .agents/skills/loom-framework/SKILL.md
  • .agents/skills/loom-framework/references/formal-models.md
  • .agents/skills/loom/SKILL.md
  • codegen/go_transform_fallibility.go
  • codegen/go_transform_presence.go
  • codegen/json_boundary_transform_test.go
  • docs/dsl-reference.md
  • docs/http-media-contracts.md
  • docs/openapi-import-coverage.md
  • dsl/http_media_type.go
  • dsl/http_media_type_test.go
  • expr/http_endpoint.go
  • expr/http_endpoint_validate.go
  • expr/http_media_encoding.go
  • expr/http_media_type.go
  • expr/http_media_type_test.go
  • expr/http_response.go
  • expr/value_plan.go
  • expr/value_plan_branch_selection_test.go
  • expr/value_plan_build.go
  • expr/value_projection.go
  • http/codegen/internal/representation/example_preparation.go
  • http/codegen/internal/representation/example_preparation_endpoint.go
  • http/codegen/internal/representation/layout.go
  • http/codegen/internal/representation/media_variants.go
  • http/codegen/internal/representation/prepare.go
  • http/codegen/internal/representation/response_codec.go
  • http/codegen/internal/representation/value_carriers.go
  • http/codegen/internal/transportir/media_variant.go
  • http/codegen/internal/transportir/model.go
  • http/codegen/internal/transportir/request_response.go
  • http/codegen/media_contract_integration_test.go
  • http/codegen/openapi/internal/ir/analyzer.go
  • http/codegen/openapi/internal/ir/analyzer_body_types.go
  • http/codegen/openapi/internal/ir/async_schema_examples.go
  • http/codegen/openapi/internal/ir/async_schema_inline.go
  • http/codegen/openapi/internal/ir/component_annotations.go
  • http/codegen/openapi/internal/ir/component_annotations_test.go
  • http/codegen/openapi/internal/ir/document.go
  • http/codegen/openapi/internal/ir/media_variants.go
  • http/codegen/openapi/internal/ir/model.go
  • http/codegen/openapi/internal/ir/operation_metadata.go
  • http/codegen/openapi/internal/ir/prepared_examples.go
  • http/codegen/openapi/internal/ir/render.go
  • http/codegen/openapi/internal/ir/representation_registry.go
  • http/codegen/openapi/internal/ir/schema_examples.go
  • http/codegen/openapi/internal/ir/schema_examples_test.go
  • http/codegen/openapi/internal/ir/tla/schema_examples/README.md
  • http/codegen/openapi/internal/ir/tla/schema_examples/SchemaExamples.tla
  • http/codegen/openapi/internal/ir/tla/schema_examples/append.cfg
  • http/codegen/openapi/internal/ir/tla/schema_examples/checked.cfg
  • http/codegen/openapi/internal/ir/tla/schema_examples/collapsed.cfg
  • http/codegen/openapi/internal/ir/tla/schema_examples/representative.cfg
  • http/codegen/openapi/schema.go
  • http/codegen/openapi/v3/example_determinism_test.go
  • http/codegen/openapi/v3/ir_adapter.go
  • http/codegen/openapi/v3/media_contract_test.go
  • http/codegen/openapi/v3/schema_examples_test.go
  • http/codegen/openapi/v3/schema_refs.go
  • http/codegen/openapi/v3/testdata/golden/reusable-components_file0.golden
  • http/codegen/openapi/v3/testdata/golden/reusable-components_file1.golden
  • http/codegen/service_data_body_types.go
  • http/codegen/service_data_element_types.go
  • http/codegen/service_data_json_input.go
  • http/codegen/service_data_media.go
  • http/codegen/service_data_payload.go
  • http/codegen/service_data_response.go
  • http/codegen/service_data_response_errors.go
  • http/codegen/template_sources_request.go
  • http/codegen/template_sources_request_decoder.go
  • http/codegen/template_sources_response.go
  • http/codegen/template_sources_response_decoder.go
  • http/codegen/testdata/media_contract_harness.go.txt
  • http/codegen/testdata/openapi_dsls_22.go
  • http/encoding.go
  • http/media_codec.go
  • http/media_contract.go
  • http/media_contract_test.go
  • internal/httpcodec/media_contract.go
  • internal/httpcodec/media_contract_test.go
  • internal/httpcodec/tla/media_contracts/MediaContracts.tla
  • internal/httpcodec/tla/media_contracts/PhysicalLayouts.tla
  • internal/httpcodec/tla/media_contracts/README.md
  • internal/httpcodec/tla/media_contracts/checked.cfg
  • internal/httpcodec/tla/media_contracts/collapsed.cfg
  • internal/httpcodec/tla/media_contracts/inherited-layout.cfg
  • internal/httpcodec/tla/media_contracts/native-layout.cfg
  • internal/httpencoding/multipart.go
  • internal/httpencoding/multipart_test.go
  • internal/openapiimport/analyze.go
  • internal/openapiimport/analyze_examples.go
  • internal/openapiimport/analyze_request_content.go
  • internal/openapiimport/analyze_schema_promotion.go
  • internal/openapiimport/analyze_test.go
  • internal/openapiimport/issues_299_303_test.go
  • internal/openapiimport/media_contract.go
  • internal/openapiimport/media_contract_test.go
  • internal/openapiimport/model.go
  • internal/openapiimport/plan.go
  • internal/openapiimport/render.go
  • internal/openapiimport/render_media.go
  • internal/openapiimport/render_request_body.go
  • internal/openapiimport/render_response.go
  • internal/openapiimport/render_schema.go
  • internal/openapiimport/render_test.go
  • internal/openapiimport/schema_examples_test.go

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant