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

[BUG] DEPRECATION WARNING: Rswag::Ui #718

Open
3 tasks
AlexcastroDev opened this issue Dec 23, 2023 · 2 comments · May be fixed by #714
Open
3 tasks

[BUG] DEPRECATION WARNING: Rswag::Ui #718

AlexcastroDev opened this issue Dec 23, 2023 · 2 comments · May be fixed by #714

Comments

@AlexcastroDev
Copy link
Contributor

Describe the bug

In the first install, config/initializers/rswag_ui.rb generate old swagger_endpoint

DEPRECATION WARNING: Rswag::Ui: WARNING: The method will be renamed to "openapi_endpoint" in v3.0 (called from block in <main> at /config/initializers/rswag_ui.rb:11)
Rswag::Ui.configure do |c|

  # List the Swagger endpoints that you want to be documented through the
  # swagger-ui. The first parameter is the path (absolute or relative to the UI
  # host) to the corresponding endpoint and the second is a title that will be
  # displayed in the document selector.
  # NOTE: If you're using rspec-api to expose Swagger files
  # (under openapi_root) as JSON or YAML endpoints, then the list below should
  # correspond to the relative paths for those endpoints.

  c.swagger_endpoint '/api-docs/v1/swagger.yaml', 'API V1 Docs'

  # Add Basic Auth in case your API is private
  # c.basic_auth_enabled = true
  # c.basic_auth_credentials 'username', 'password'
end

Steps to Test or Reproduce

Expected behavior

Create with:

Rswag::Ui.configure do |c|

  # List the Swagger endpoints that you want to be documented through the
  # swagger-ui. The first parameter is the path (absolute or relative to the UI
  # host) to the corresponding endpoint and the second is a title that will be
  # displayed in the document selector.
  # NOTE: If you're using rspec-api to expose Swagger files
  # (under openapi_root) as JSON or YAML endpoints, then the list below should
  # correspond to the relative paths for those endpoints.

  c.openapi_endpoint '/api-docs/v1/swagger.yaml', 'API V1 Docs'

  # Add Basic Auth in case your API is private
  # c.basic_auth_enabled = true
  # c.basic_auth_credentials 'username', 'password'
end

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

No need rush, i dont know if there's someone fixing this.

Dependency versions

The version of are you using for:

  • Rswag:

Relates to which version of OAS (OpenAPI Specification)

  • OAS2
  • OAS3
  • OAS3.1
@romanblanco
Copy link
Member

Thank you, for reporting this, @AlexcastroDev. Changes in #714 address this.

@romanblanco romanblanco linked a pull request Dec 23, 2023 that will close this issue
6 tasks
@minhtienvu
Copy link

I got a warning on my Rails app. I understand when your PR is merged to master, my warning will disappear. Is this true?

DEPRECATION WARNING: swagger_format= is deprecated and will be removed from rswag-specs 3.0 (use openapi_format= instead) (called from block in <top (required)> at /home/circleci/repo/spec/swagger_helper.rb:60)

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 a pull request may close this issue.

3 participants