Swashbuckle.WebApi: Invalid string length
I am having troubles to load the documentation using swagger-ui. I suspect that this happens because my json file is huge.
If necessary I can provide the JSON file, for debugging proposes, via private message.
If you need more information please just let me know.
Uncaught RangeError: Invalid string length
at JSON.stringify (<anonymous>)
at t.exports.u.getModelSampleJSON (http://localhost/api/swagger/ui/swagger-ui-min-js:9:748)
at new t.exports (http://localhost/api/swagger/ui/swagger-ui-min-js:8:26467)
at http://localhost/api/swagger/ui/swagger-ui-min-js:7:17315
at r (http://localhost/api/swagger/ui/swagger-ui-min-js:11:12853)
at Object.forEach (http://localhost/api/swagger/ui/swagger-ui-min-js:11:24144)
at http://localhost/api/swagger/ui/swagger-ui-min-js:7:17041
at http://localhost/api/swagger/ui/swagger-ui-min-js:11:22737
at r (http://localhost/api/swagger/ui/swagger-ui-min-js:11:16261)
at http://localhost/api/swagger/ui/swagger-ui-min-js:11:22408
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 24 (8 by maintainers)
yes @andrenpt that is normal… but sometimes it makes the json huge… the way to filter the json document is using the DocumentFilter… check this url and let me know http://stackoverflow.com/a/31159468/2144426
@andrenpt , that still looks wrong. I’ve pasted this json here, you should the validation error there.
http://www.jsoneditoronline.org/?id=914441c5039ad57bb3b1d5ab54f32e74
eg.:
@andrenpt thanks, but this does not look like a valid swager file.
For example, here what lines 99 to 105 look. the path “/webs/sometime/” is not defined correctly, it is missing operations, etc.
@andrenpt we use circular reference and it works just fine. I am keen to understand what is the issue, as we depend on swaschbuckle heavily. Would you be able to share your json file? Try renaming definitions and properties, it would be good if you could upload it here.