-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Error: Cannot read property 'charAt' of undefined #1616
Comments
can you post the swagger.json to reproduce this? |
@RomanGotsiy any idea? You probably need the swagger.json, right? |
I can not give JSON file. Company rules. Maybe you can give me some tips how to debug. |
Is it working with SwaggerUi3? |
Working if i am using this code:
Not loading and can not open JSON file in browser if i am using this code:
But it is okay if i am using UseSwaggerUi3 and loadning JSON file from "/swagger_new_ui3/v1/swagger.json" (JSON file generated by UseSwaggerUi3WithApiExplorer). In addision. With UseSwaggerReDocWithApiExplorer I can open JSON file generated from another project (another project generated JSON file by UseSwaggerReDocWithApiExplorer). I can give some parts of JSON, but i can not give it all (begining file, enum, some methods). |
From the stacktrace, I can only guess it has something to do with If you could locate the exact field that breaks and post it here it would be super useful. |
@RomanGotsiy I sent an e-mail to you (gotsijroman@gmail.com) with a JSON file. I hope this will help you understand more clearly what the problem is. |
If there is a problem with the NSwag output, please report here |
@Chiliukas I checked out you spec and hunted down the issue to the following snippet: "files": {
"type": "array",
"items": {
"type": "file"
}
} If you remove it, ReDoc doesn't crash (you can use it as a temporary workaround). It is clearly a ReDoc 1.x bug and has nothing to do with NSwag ouput. I opened a corresponding issue in ReDoc repo. I checked the same spec with redoc@2.0.0-alpha.38 and the issue can't be reproduced with it. |
@RomanGotsiy currently we are using 1.x in the middleware. Can I just switch to the new 2.x version without any problems for users? Or are there some serious breaking changes or some important features which are missing in the 2.x version? Thanks for investigating this problem... |
@RSuter yes, it should just work. |
@RomanGotsiy thanks for your answer, can you quickly check the linked PR? Is this fine? |
@RomanGotsiy @RSuter Thanks for your answers and investigating this problem. You have helped me a lot. Now everything is working well. It looks like nSwag has very strong support. |
I can not load my JSON file on ReDoc. I can open JSON file in a browser.
The same JSON working with UseSwaggerUi3WithApiExplorer.
I used UseSwaggerReDocWithApiExplorer in another project and works fine. But now ReDoc was implemented in project with 400 endpoints. It is hard to debug and find witch attribute missing for endpoint.
The problem is with generated JSON file. And redoc.min.js can not handled it. Somehow i must figured out witch endpoints must be changed.
I am using:
.NET CORE 1.0.2.
NSwag.ApiNetCore 11.19.2.0
The text was updated successfully, but these errors were encountered: