-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Cannot read property 'slice' of undefined #4807
Comments
Hey @Hackniu! Thanks for the report. Quoting myself in #4745 (comment):
|
I use the snippet code from #4745 and replace url with http://xxx/xxx/swagger-apis, it shows "no API definition found". below is the swagger-apis information, please do you know if I miss anything. thx { |
I use oauth2 authentication token for both ui and service. Since my swagger page is under the my main api, so it should append the token automatically, but in the SwaggerUIBundle, does it append the token automatically also? |
Is there a way to pass json file directly to SwaggerUIBundle instead of url |
You can pass a JS object to Swagger UI by using the |
Fixed! We've just released |
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
# your YAML here
Swagger-UI configuration options:
Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
Expected behavior
Screenshots
Additional context or thoughts
I am using:
{
"swagger-ui": "^3.5.0",
"react": "^16.4.1"
}
const React = require('react');
const SwaggerUI = require('swagger-ui');
class Swagger extends React.Component {
componentDidMount() {
SwaggerUI({
dom_id: "#ui",
url: "http://petstore.swagger.io/v2/swagger.json"
});
}
}
error: TypeError: Cannot read property 'slice' of undefined
the error is coming from swagger-ui, I try to comment out the componenentDidMount, and only leave the const SwaggerUI = require('swagger-ui'), the error is still there. Please anyone know how to solve the problem, thx
The text was updated successfully, but these errors were encountered: