Skip to content

OpenAPI 3.2: Support JSON Schema object property-count constraints #996

Open

Description

@CaliLuke

OpenAPI 3.2: Support JSON Schema object property-count constraints

Problem. Importer rejects minProperties and maxProperties even for map schemas whose count bounds the DSL already exports. Fixed-property records also lack a dedicated representation for object property-count assertions, so generation cannot express the full contract.

Reproduce. Run go test ./internal/openapiimport -run '^TestSchemaGrammarKeywordsAreNeverSilentlyIgnored/minProperties$' -count=1 from the repository root. The focused existing test exercises the current boundary. Minimal schema: OAS 3.2 schema: {type: object, additionalProperties: {type: string}, minProperties: 1, maxProperties: 4}. Existing rejection probes: TestSchemaGrammarKeywordsAreNeverSilentlyIgnored cases minProperties/maxProperties; exporter owner is applySchemaLengths for expr.Map.

Expected behavior. Preserve minProperties/maxProperties for both dynamic maps and fixed-property records through import, validation, and OpenAPI generation. Test empty objects, boundaries, and records whose optional properties vary the key count; retain map values and required-field behavior.

Evidence at revision 98131b0.

Specification. OAS 3.2 §4.24.1; JSON Schema 2020-12 Validation 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