You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"openapi": "3.0.2","info": {"title": "Dummy API","description": "Test","version": "1.0.0"},"servers": [{"url": "https://localhost:44352","description": "Test API"}],"tags": [{"name": "Books"}],"consumes": ["application/json"],"produces": ["application/json"],"paths": {"/book/{id}": {"get": {"tags": ["Books"],"description": "It is used to get the specific book data.\n","operationId": "getBook","parameters": [{"in": "path","name": "id","required": true,"schema": {"$ref": "#/definitions/bookId"}}],"responses": {"200": {"description": "It returns the specific book","schema": {"$ref": "#/components/schemas/bookIdData"}},"500": {"description": "Internal server error"}},"security": [{"Bearer": []}]}}},"definitions": {"bookId": {"type": "integer","minimum": 1,"description": "book id","xml": {"name": "bookId"}}},"components": {"schemas": {"bookIdData": {"type": "object","properties": {"id": {"type": "integer","format": "int64"},"book_id": {"type": "integer"},"book_type": {"type": "string"},"name": {"type": "string"},"description": {"type": "string"},},"xml": {"name": "bookIdData"}}},"securitySchemes": {"Bearer": {"type": "http","scheme": "bearer","bearerFormat": "JWT","description": "JWT Authorization header using the Bearer scheme","name": "Authorization","in": "header"}}}}
Swagger-UI configuration options:
<SwaggerUIurl="/swagger/swagger.json"/>
Describe the bug you're encountering
If I use
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"typescript": "4.3.5",
"swagger-ui-react": "^5.17.14",
this versions then getting the error like this
./node_modules/swagger-ui-react/index.mjs 49:36
Module parse failed: Unexpected token (49:36)
File was processed with these loaders:
./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| }) => {
| const [system, setSystem] = useState(null);
If I use
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"typescript": "^4.9.5",
"swagger-ui-react": "^5.17.14",
then not getting any error. It works fine.
Use this version of these packages : "react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"typescript": "4.3.5",
"swagger-ui-react": "^5.17.14",
run the project of react-typescript.
See error
Expected behavior
I want to use swagger-ui in My project so user can test the apis.
Screenshots
Additional context or thoughts
The text was updated successfully, but these errors were encountered:
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Swagger-UI configuration options:
Describe the bug you're encountering
If I use
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"typescript": "4.3.5",
"swagger-ui-react": "^5.17.14",
this versions then getting the error like this
./node_modules/swagger-ui-react/index.mjs 49:36
Module parse failed: Unexpected token (49:36)
File was processed with these loaders:
You may need an additional loader to handle the result of these loaders.
| }) => {
| const [system, setSystem] = useState(null);
If I use
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"typescript": "^4.9.5",
"swagger-ui-react": "^5.17.14",
then not getting any error. It works fine.
Here is my package.json file when getting error.
To reproduce...
Steps to reproduce the behavior:
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"typescript": "4.3.5",
"swagger-ui-react": "^5.17.14",
Expected behavior
I want to use swagger-ui in My project so user can test the apis.
Screenshots
Additional context or thoughts
The text was updated successfully, but these errors were encountered: