swaggo / gin-swagger

gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
MIT License
3.76k stars 270 forks source link

too slow when rendering response which is array of huge elements #167

Open ArulJeyananth opened 3 years ago

ArulJeyananth commented 3 years ago

when the number is entries in a result is approx 10000, it takes approximately 3 to 5 mins to render the same in swagger UI ,

When I test my application APIs with swagger it takes longer time to display the result. Response content type: application/Json [ {"Id": 1,"name": "test 0001" }, { "Id": 2, "name": "test 0003" }, << add 10000 more entries >> { "Id": 10000, "name": "test 10000" }, ]

ubogdan commented 3 years ago

@ArulJeyananth Your issue is more related to the high number of response items and this behavior is quite normal. What exactly does this have to do with gin-swagger ?

ArulJeyananth commented 2 years ago

yes. it is due to "high number of response items" may be I have to raise this issue in core swagger?

ubogdan commented 2 years ago

In normal circumstances, you shouldn't reply with a large number of items and you may use a paginated result and lazy load the items. Swag is just a documentation generator, I don't see how we can help more in this matter.