Skip to content

OpenAPI 3.2: Import JSON Schema type unions beyond nullable pairs #1000

Open

Description

@CaliLuke

OpenAPI 3.2: Import JSON Schema type unions beyond nullable pairs

Problem. Importer-only shape gap: generated Loom unions use oneOf and type nullability uses nullable forms; arbitrary type arrays are blocked rather than mapped.

Reproduce. Run go test ./internal/openapiimport -run '^TestAnalyzeRejectsNonNullableTypeUnions$' -count=1 from the repository root. The focused existing test exercises the current boundary. Minimal schema: OAS 3.2 schema {type: [string, integer]} or {type: [string, number, null]}. Existing admission probes cover nullable type union; extend schema admission with non-null and three-member arrays.

Expected behavior. Normalize arbitrary type arrays to a shared union representation without losing branch constraints or nullable identity, and import/render/evaluate/regenerate representative primitive/object/array combinations. Document that exporter may choose semantically equivalent oneOf output.

Evidence at revision 98131b0.

Specification. OAS 3.2 §4.24.3

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