Skip to content

OpenAPI 3.2: Support recursive schemas composed only of collection constructors #1012

Open

Description

@CaliLuke

OpenAPI 3.2: Support recursive schemas composed only of collection constructors

Problem. Importer-only Go construction limitation. Recursive refs through object fields/arrays/maps work, but mandatory array/map-only cycles cannot be initialized by current DSL constructors.

Reproduce. Run go test ./internal/openapiimport -run '^TestReferencePlanRejectsMandatoryCycles$' -count=1 from the repository root. The focused existing test exercises the current boundary. Minimal schema: OAS 3.2 components Node: {type: array, items: {$ref: '#/components/schemas/Node'}}; map analogue uses self-referential additionalProperties. Existing probes: TestReferencePlanRejectsMandatoryCycles and TestAnalyzeRejectsMandatoryReferenceCycles.

Expected behavior. Create a recursive type representation that can initialize collection-only cycles without invalid Go types or unsound placeholders; test import, generated compile, construction, encode/decode, and bounded recursive values.

Evidence at revision 98131b0.

Specification. OAS 3.2 §4.24.1 and §4.24.8; JSON Schema recursive local references

Activity

  1. added
    enhancement
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions