Skip to content

[TT-16408] add full exclusive maximum and exclusive minimum support#10

Open
pvormste wants to merge 5 commits intomasterfrom
feat/TT-16408/add-full-exclusiveMaximum-and-exclusiveMinimum-support
Open

[TT-16408] add full exclusive maximum and exclusive minimum support#10
pvormste wants to merge 5 commits intomasterfrom
feat/TT-16408/add-full-exclusiveMaximum-and-exclusiveMinimum-support

Conversation

@pvormste
Copy link

@pvormste pvormste commented Feb 5, 2026

This pull request enhances support for OpenAPI Specification (OAS) 3.1's handling of exclusiveMinimum and exclusiveMaximum by allowing these schema properties to be represented as either booleans (OAS 3.0 style) or numeric values (OAS 3.1 style). The changes update the internal schema representation, conversion logic, validation routines, and add new test data to ensure correct handling of both OAS 3.0 and OAS 3.1 forms.

Schema Representation and Serialization:

  • Refactored the Schema struct in openapi3/schema.go to store exclusiveMinimum and exclusiveMaximum as pointers, allowing for both boolean (ExclusiveMinBool, ExclusiveMaxBool) and numeric (ExclusiveMin, ExclusiveMax) forms. Serialization and deserialization logic was updated to handle both OAS 3.0 and 3.1 representations. [1] [2] [3] [4] [5] [6] [7] [8]

Schema Validation Logic:

  • Updated the schema validation logic to correctly validate numbers using either the boolean or numeric forms of exclusiveMinimum and exclusiveMaximum, ensuring compliance with both OAS 3.0 and OAS 3.1. [1] [2] [3]

OpenAPI 2.0/3.0/3.1 Conversion:

  • Modified conversion functions between OpenAPI 2.0 and 3.x to map exclusiveMinimum and exclusiveMaximum appropriately between boolean and numeric forms, preserving the correct semantics during conversion. [1] [2] [3] [4] [5] [6] [7] [8]

Testing Improvements:

  • Updated and expanded tests to cover both boolean and numeric forms of exclusiveMinimum and exclusiveMaximum, including a new helper for boolean pointers and new test data for OAS 3.1. [1] [2] [3] [4]

API Enhancements:

  • Added new builder methods to the Schema type for setting both boolean and numeric forms of exclusiveMinimum and exclusiveMaximum.

These changes ensure robust support for both OAS 3.0 and 3.1 schema validation and conversion, and improve the flexibility and correctness of the OpenAPI tooling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant