Skip to content

feat: add openapi 3.1 support#49

Merged
Christian R (antiphp) merged 5 commits into
mainfrom
cr/3.1
Jun 25, 2026
Merged

feat: add openapi 3.1 support#49
Christian R (antiphp) merged 5 commits into
mainfrom
cr/3.1

Conversation

@antiphp

Copy link
Copy Markdown
Contributor

Goal of this PR

Support openapi v3.1.0 support.

How did I test it?

Unit tests & use it with gf-core. See https://github.com/GameFabric/gf-core/pull/865 (that PR will be closed after this has been acknowledged).

@antiphp Christian R (antiphp) self-assigned this Jun 25, 2026
Copilot AI review requested due to automatic review settings June 25, 2026 08:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds OpenAPI 3.1 output support to the spec generator by introducing an OpenAPIVersion option and upgrading generated documents to 3.1 semantics when requested, along with expanded golden-file coverage for both 3.0 and 3.1 outputs.

Changes:

  • Add SpecConfig.OpenAPIVersion and upgrade-to-3.1 flow using openapi3conv.Upgrade when a 3.1.x version is requested.
  • Extend TestBuildSpec to cover 3.0 vs 3.1 generation for different package-segment configurations.
  • Add new 3.1.0 golden spec outputs under testdata/.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
gen.go Adds configurable OpenAPI version selection and conditional 3.1 upgrade behavior.
gen_test.go Refactors golden-file tests into a table and adds 3.1.0 coverage cases.
example_test.go Pins example output to OpenAPI 3.0.0 explicitly via config.
testdata/spec-3.1.0.json New 3.1.0 golden spec (pkg segment = 1) for test comparisons.
testdata/spec-pkgseg0-3.1.0.json New 3.1.0 golden spec (pkg segment = 0) for test comparisons.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gen.go
Comment thread gen.go Outdated
Comment thread testdata/spec-3.1.0.json Outdated
Comment thread testdata/spec-3.1.0.json Outdated
Comment thread testdata/spec-pkgseg0-3.1.0.json Outdated
Comment thread testdata/spec-pkgseg0-3.1.0.json Outdated
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@antiphp Christian R (antiphp) merged commit 21ae060 into main Jun 25, 2026
17 checks passed
@antiphp Christian R (antiphp) deleted the cr/3.1 branch June 25, 2026 09:10
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.

4 participants