Skip to content

OpenAPI 3.2: Support local $defs and references within a schema resource #999

Open

Description

@CaliLuke

OpenAPI 3.2: Support local $defs and references within a schema resource

Problem. Importer and generation gap for same-resource JSON Schema definitions. External-document and document-level reference resolution are covered separately.

Reproduce. Run go test ./internal/openapiimport -run '^TestSchemaGrammarKeywordsAreNeverSilentlyIgnored/\$defs$' -count=1 from the repository root. The focused existing test exercises the current boundary. Minimal schema: OAS 3.2 schema resource { $defs: {Name: {type: string}}, $ref: '#/$defs/Name' } embedded in a component or operation schema. Existing rejection probe: TestSchemaGrammarKeywordsAreNeverSilentlyIgnored case $defs.

Expected behavior. Preserve same-resource $defs and local fragment references through import and regeneration, including nested and recursive references through representable object/property positions. Exclude external document loading and mandatory collection-only cycles, which are separate capabilities.

Evidence at revision 98131b0.

Specification. OAS 3.2 §4.24.1 and §4.24.7; JSON Schema 2020-12 Core vocabulary

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