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

Fix swagger-api integration after last update #11278

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

mkllnk
Copy link
Member

@mkllnk mkllnk commented Jul 26, 2023

What? Why?

The API docs are broken since we updated the rswag-api gem.

See also:

What should we test?

  • Visit /api-docs
  • The API documentation should display.

Release notes

Changelog Category: Technical changes

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

@mkllnk mkllnk self-assigned this Jul 26, 2023
Comment on lines +5 to +20
describe "API documentation", type: :request do
it "shows the OFN API v1" do
get rswag_ui_path
expect(response).to redirect_to "/api-docs/index.html"

get "/api-docs/index.html"
expect(response).to have_http_status :success

expect(response.body).to match "API V1"
end

it "can load the Swagger config" do
get "/api-docs/v1/swagger.yaml"
expect(response).to have_http_status :success
end
end
Copy link
Member Author

Choose a reason for hiding this comment

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

This is an integration test with an external component. So it's not meant to be complete or particularly sophisticated. I just reproduced the error we had. It would have been simpler in a system spec but they are slow. I didn't want to add the overhead if we can run this in "0.1276 seconds" and it's still very simple.

@mkllnk mkllnk marked this pull request as ready for review July 26, 2023 06:02
Copy link
Contributor

@jibees jibees left a comment

Choose a reason for hiding this comment

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

Crystal clear! 👌

@filipefurtad0 filipefurtad0 self-assigned this Jul 28, 2023
@filipefurtad0 filipefurtad0 added the pr-staged-uk staging.openfoodnetwork.org.uk label Jul 28, 2023
@filipefurtad0
Copy link
Contributor

Hey @mkllnk ,

Cool, /api-docs are back:

image

Merging.

@filipefurtad0 filipefurtad0 merged commit 5d624ef into openfoodfoundation:master Jul 28, 2023
52 checks passed
@filipefurtad0 filipefurtad0 removed the pr-staged-uk staging.openfoodnetwork.org.uk label Jul 28, 2023
@mkllnk mkllnk deleted the swagger-fix branch August 14, 2023 04:35
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.

3 participants