Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update base path configuration for OpenAPI 3 #547

Merged
merged 5 commits into from
Sep 19, 2022

Conversation

romanblanco
Copy link
Member

@romanblanco romanblanco commented Sep 5, 2022

Problem

API Host and base URL definition has changed from OAS2 to OAS3.

schemes, host and basePath definitions are being replaced by Server Object

This is causing issue #318.

Closes #397
Closes #318

Solution

I'm building on top of @developingchris's approach from #397.
The solution is to parse the URL from the Server Object.

This concerns this parts of the Open API Specification:

The changes I made are compatible with:

  • OAS2
  • OAS3
  • OAS3.1

Related Issues

Checklist

  • Added tests
  • Changelog updated
  • Added documentation to README.md

Steps to Test or Reproduce

see #318

@romanblanco
Copy link
Member Author

Hi @jtannas, could you look at the changes to see if it makes sense to you?

Copy link
Collaborator

@jtannas jtannas left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! 🙂
I really appreciate the help while I'm getting this all figured out.

Just a few notes on places I found difficult to follow and it should be good to go!

rswag-specs/lib/rswag/specs/request_factory.rb Outdated Show resolved Hide resolved
rswag-specs/lib/rswag/specs/request_factory.rb Outdated Show resolved Hide resolved
rswag-specs/lib/rswag/specs/request_factory.rb Outdated Show resolved Hide resolved
@romanblanco
Copy link
Member Author

@jtannas Thanks for keeping the Gem alive!

I've applied the suggested changes (diff). Let me know if you see more things to improve 🙂

@jtannas jtannas merged commit 99e56ba into rswag:master Sep 19, 2022
@romanblanco romanblanco deleted the open-api-3-base-path branch September 19, 2022 17:58
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.

OAS v3 tests fail without basePath, but basePath generates invalid Swagger
3 participants