question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swagger response too slow for big swagger documents

See original GitHub issue

I have this issue too #173 . I used this solution "TransformByOcelotConfig" : false, this config correctly worked. But now I have a new problem: when calling my Apis into swagger, it’s calling with local IP instead of calling with my domain website name(for example myApp.com/api ). with this config all swagger calling Apis throw with error: ‘failed to fetch’.

{ "UpstreamPathTemplate": "/xxx/api/{everything}", "DownstreamPathTemplate": "/api/{everything}", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "xx.xx.xxx.xx" //local IP "Port": xxxxx } ], "SwaggerKey": "myAppKey", "RouteIsCaseSensitive": "false" }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Burgyncommented, Jan 24, 2022

Hi @namnik,

In new version 4.8.0 you can use RemoveUnusedComponentsFromScheme switch

"SwaggerEndPoints": [
{
  "Key": "projects",
  "RemoveUnusedComponentsFromScheme": false,
  "Config": [
    {
      "Name": "Projects API",
      "Version": "v1",
      "Service": {
        "Name": "projects",
        "Path": "/swagger/v1/swagger.json"
      }
    }
  ]
}

PR #218

1reaction
Burgyncommented, Jan 21, 2022

Hi @namnik https://github.com/namnik

thanks for your docs. Unfortunately I do not have good news. With a 16MB document, I come across Newonsoft limits. The transition to System.Text.Json is currently impossible because it does not allow modification of an existing document. Switching to that would take a lot of time that I don’t have.

In your case, a lot of time is spent removing unused components from the schema. If you don’t mind having these components in the resulting documentation, I can make settings that would allow you to turn it off.

Thanks.

On Thu, 20 Jan 2022 at 08:36, Saman Namnik @.***> wrote:

Hi @Burgyn https://github.com/Burgyn Sure, a large swagger json url: https://sandbox.wepod.ir/swagger/docs//XBankMain or https://api.wepod.ir/swagger/docs//XBankMain

Thanks,

— Reply to this email directly, view it on GitHub https://github.com/Burgyn/MMLib.SwaggerForOcelot/issues/181#issuecomment-1017195246, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNH6RXOVKMFTO7LMASP3NLUW63RNANCNFSM5AVI4VDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

– Prajem pekný zvyšok dňa, Ing. Milan Martiniak

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swagger UI hangs and become very slow after expanding ...
Hi Team, I have integrated swagger to my API controller. The UI gets hanged once I click to expand any of the endpoint....
Read more >
c# - Swagger UI for net core 3.1 api is very slow
See How to export a Swagger JSON/YAML file from Swagger UI. The slowness may be caused by the large file size and/or highly...
Read more >
SwaggerUI is Slow – How to speed it up in ASP.Net Core
I'll assume you can set up Swagger and just want to speed it up. Open your startup.cs and go to the UseSwaggerUI() call...
Read more >
Generation of the Swagger page takes too long...
The first – your spec is fairly large – around 1MB – the spec is not generated each time so it's really just...
Read more >
Lazy Loading | SwaggerHub Documentation
Enable or disable lazy loading (SwaggerHub On-Premise) ; Select Settings on the left. ; Select or unselect Enable Lazy Loading. ; Click Save...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found