feat: add OpenAPI 3.2 support#479
Conversation
OpenAPI 3.2.0 uses the same JSON Schema dialect as 3.1 — no breaking changes, only additive features (structured tags, streaming, OAuth device flow). The version regex in Builder#detect_meta_schema now accepts 3.2.x versions and routes them through the existing 3.1 codepath. Fixes ahx#469 Authored by: Aaron Lippold<lippold@gmail.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds OpenAPI 3.2 support by treating 3.2 documents as using the same JSON Schema dialect handling as OpenAPI 3.1, and updates tests/docs accordingly.
Changes:
- Extend meta-schema/dialect detection to accept
openapi: 3.2.x - Add a spec asserting a 3.2.0 document parses successfully
- Update README + changelog to document 3.2 support
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| spec/definition_spec.rb | Adds coverage verifying a minimal OpenAPI 3.2 document parses and exposes expected properties |
| lib/openapi_first/builder.rb | Expands version matching so 3.2 uses the OpenAPI 3.1 JSON Schema dialect path |
| README.md | Documents support for OpenAPI 3.2 |
| CHANGELOG.md | Notes the new OpenAPI 3.2 support and references the motivating issue |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| version = document['openapi'] | ||
| case version | ||
| when /\A3\.1\.\d+\z/ | ||
| when /\A3\.[12]\.\d+\z/ |
| # openapi_first | ||
|
|
||
| openapi_first is a Ruby gem for request / response validation and contract-testing against an [OpenAPI](https://www.openapis.org/) 3.0 or 3.1 Openapi API description (OAD). It makes an APIFirst workflow easy and reliable. | ||
| openapi_first is a Ruby gem for request / response validation and contract-testing against an [OpenAPI](https://www.openapis.org/) 3.0, 3.1, or 3.2 Openapi API description (OAD). It makes an APIFirst workflow easy and reliable. |
|
|
||
| ## Unreleased | ||
|
|
||
| - Add OpenAPI 3.2 support. OAS 3.2 uses the same JSON Schema dialect as 3.1 (no breaking changes), so the 3.1 codepath handles it correctly. Fixes #469. |
bin/setup runs bundle install but doesn't initialize the spec/data/train-travel-api submodule. Developers cloning the repo and running bin/setup then bundle exec rake see 6 test failures from missing fixture files. Adding git submodule update --init --recursive to bin/setup prevents this. Authored by: Aaron Lippold<lippold@gmail.com>
|
Hey @aaronlippold, thanks for looking into this. I was always struggling a bit with OAS 3.2, because I did not really understand what changes are included and what openapi_first needs to implement in order to support it. Here are some things from the release page where I think we need to do something:
I have listed these points in the related issue as well. |
|
I’ll take a look tonight
…--------
Aaron Lippold
***@***.***
260-255-4779
twitter/aim/yahoo,etc.
'aaronlippold'
On Tue, May 26, 2026 at 17:05 Andreas Haller ***@***.***> wrote:
*ahx* left a comment (ahx/openapi_first#479)
<#479 (comment)>
Hey @aaronlippold <https://github.com/aaronlippold>, thanks for looking
into this. I was always a struggling with OAS 3.2, because I did not really
understand what changes are included and what openapi_first needs to
implement in order to support it. Here are some things from the release
page <https://github.com/OAI/OpenAPI-Specification/releases/tag/3.2.0>
where I don't know what to do with:
1. discriminator and the new field defaultMapping – Does that just
work?
2. "Additions to support multipart media types"
2.1 New itemSchema field
2.2 New fields prefixEncoding and itemEncoding
3. Support for additional HTTP methods – Under an additionalOperations
entry in a Path, use any other methods not listed as keys using the correct
capitalization, e.g. LINK. Do NOT add HEAD under this, use the existing
sibling head.
I have listed these points in the related issue
<#469> as well.
—
Reply to this email directly, view it on GitHub
<#479?email_source=notifications&email_token=AALK42H6THYXXHUDYQKPJYT44YBKVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINJUHA4DGOJUGA4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4548839408>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALK42BHZV3WPJ3OA4XG5QL44YBKVAVCNFSM6AAAAACZNUCDFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DKNBYHAZTSNBQHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Summary
Builder#detect_meta_schemanow accepts3.2.xversions and routes them through the existing 3.1 codepathTest plan
parses a 3.2.0 document without errorpassesFixes #469