Skip to content

Conversation

@TristanSpeakEasy
Copy link
Member

Summary

Fixes #128

The 3_2_0.yaml test file was incorrectly named - it contained an OpenAPI 3.1.0 document instead of a 3.2.0 document. This was confusing as the naming convention for other test files (e.g., 3_0_0.yaml, 3_1_0.yaml) uses the version number to indicate the source document's OpenAPI version.

Changes

  1. Renamed and updated testdata file:

    • 3_2_0.yamlexpected_3_2_0_upgraded.yaml
    • Updated content to represent a valid 3.2.0 document after upgrade (transformed nullable, examples, exclusiveMinimum/Maximum)
  2. Added test case to TestUpgrade_Success:

    • Tests upgrading from 3.1.0 to 3.2.0 with WithUpgradeTargetVersion("3.2.0") option
    • Verifies schema transformations: nullabletype array, exampleexamples, exclusiveMinimum/Maximum conversion

Schema Transformations Tested

Original (3.1.0) Upgraded (3.2.0)
nullable: true on object type: [object, "null"]
example: 123 examples: [123]
exclusiveMinimum: true + minimum: 0 exclusiveMinimum: 0
exclusiveMaximum: false + maximum: 100 maximum: 100
anyOf + nullable: true adds { type: ["null"] } to anyOf

Testing

All upgrade tests pass including the new test case:

PASS openapi.TestUpgrade_Success/upgrade_3_1_0_to_3_2_0_yaml (0.03s)

@TristanSpeakEasy TristanSpeakEasy requested a review from a team as a code owner January 18, 2026 23:37
@TristanSpeakEasy TristanSpeakEasy added bug Something isn't working tests Test-related changes and improvements openapi Related to OpenAPI core functionality labels Jan 18, 2026
@TristanSpeakEasy TristanSpeakEasy enabled auto-merge (squash) January 18, 2026 23:38
@TristanSpeakEasy TristanSpeakEasy merged commit 79617f7 into main Jan 18, 2026
10 checks passed
@TristanSpeakEasy TristanSpeakEasy deleted the fix/3_2_0-upgrade-testdata-128 branch January 18, 2026 23:44
@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

bug Something isn't working openapi Related to OpenAPI core functionality tests Test-related changes and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

whether is 3_2_0.yaml still focus on OpenAPI 3.2.0 ?

3 participants