Skip to content

OpenAPI 3.2: Represent null-only domains and typeless constrained schemas #1010

Open

Description

@CaliLuke

OpenAPI 3.2: Represent null-only domains and typeless constrained schemas

Problem. Importer strict-subset gap: it rejects null-only schemas and typeless assertions. Supporting import requires a shared representation for these instance domains; the current exporter/runtime do not already support arbitrary typeless schemas.

Reproduce. Run go test ./internal/openapiimport -run '^TestAnalyzeRejectsConstrainedSchemaWithoutType$' -count=1 from the repository root. The focused existing test exercises the current boundary. Minimal schema: OAS 3.2 component schemas {type: null}, {pattern: '^a'}, and {properties: {x: {type: string}}} without type. Existing probes: TestAnalyzeRejectsConstrainedSchemaWithoutType; empty/never schemas are covered by schema-boolean-false.

Expected behavior. Represent null-only domains and assertions that are valid without an explicit type, preserving the exact accepted JSON values through import, runtime evaluation, and regeneration. Test null against non-null JSON kinds and typeless assertions against strings, numbers, arrays, objects, and null. Empty/false schemas are out of scope.

Evidence at revision 98131b0.

Specification. OAS 3.2 §4.24 and §4.24.3; JSON Schema type is an assertion, not an inference rule

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