Skip to content

Conversation

@ndeloof
Copy link

@ndeloof ndeloof commented Dec 8, 2025

Change type

🆕 Add support for Open API 3.x

Short description

This PR introduce support for Open API 3.x document

Fixes

fixes #21

Full description

Add required attributes so the same codebase can be used to parse swagger 2.x and openapi 3.x documents.
This is used in https://github.com/allons-y/openapi (go-swagger fork) as a proof of concept
Let me know if this makes sense, then I'll adapt tests so they are executed and adapted for both file formats

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

@ndeloof ndeloof changed the title Update data structure and logic to handle both Swagger 2 and OpenAPI 3 documents Update data structure and logic to handle both Swagger 2 and OpenAPI 3 Dec 8, 2025
@fredbi
Copy link
Member

fredbi commented Dec 8, 2025

Thank you. I’ll take a thorough look at it and at your fork as well. We might have a to discuss a few things. I’ll let you know shortly

…3 documents

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
Copy link
Author

ndeloof commented Dec 8, 2025

updated: added a 2nd commit to run spec_test with swagger and openapi files, to confirm both are well supported

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 38.35616% with 180 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.69%. Comparing base (c14c0a6) to head (68a6c45).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
expander.go 50.40% 43 Missing and 18 partials ⚠️
components.go 14.51% 49 Missing and 4 partials ⚠️
media_type.go 23.21% 35 Missing and 8 partials ⚠️
request_body.go 31.81% 10 Missing and 5 partials ⚠️
properties.go 71.42% 3 Missing and 3 partials ⚠️
parameter.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #234      +/-   ##
==========================================
- Coverage   67.51%   63.69%   -3.82%     
==========================================
  Files          30       34       +4     
  Lines        2395     2749     +354     
==========================================
+ Hits         1617     1751     +134     
- Misses        615      791     +176     
- Partials      163      207      +44     
Flag Coverage Δ
oldstable-macos-latest 63.10% <38.35%> (-3.81%) ⬇️
oldstable-ubuntu-latest 63.10% <38.35%> (-3.81%) ⬇️
oldstable-windows-latest 63.65% <38.35%> (-3.84%) ⬇️
stable-macos-latest 63.10% <38.35%> (-3.81%) ⬇️
stable-ubuntu-latest 63.10% <38.35%> (-3.81%) ⬇️
stable-windows-latest 63.65% <38.35%> (-3.84%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
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.

OpenAPI version 3.0

2 participants