Skip to content
New issue

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

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

Already on GitHub? # to your account

swagger-ui-react onComplete is no longer called with a SwaggerUi instance #9876

Closed
julien-capellari opened this issue Apr 26, 2024 · 1 comment · May be fixed by codingfragments/tvh-guide#134

Comments

@julien-capellari
Copy link

Q&A (please complete the following information)

  • OS: Wwindows
  • Browser: Chrome
  • Method of installation: npm
  • Swagger-UI-React version: 5.17.0
  • Swagger/OpenAPI version: 3.0

Configuration

Swagger-UI-React configuration options:

const handleComplete = useCallback((swagger) => {
  ...
  swagger.preauthorizeApiKey('bearer', token);
}

return <SwaggerUI spec={spec} onComplete={handleComplete} />

Describe the bug you're encountering

handleComplete is called, but with no arguments. Instead I see this error : TypeError: Cannot read properties of undefined (reading 'preauthorizeApiKey')

Expected behavior

handleComplete should be called with a SwaggerUI instance.

@char0n
Copy link
Member

char0n commented Apr 30, 2024

Addressed in #9895

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants