Closed mastak-in-ua closed 1 year ago
Hi @mastak-in-ua
Yes, you're right. This is the scenario with a certain post of operations and dependencies in the schema. The problem is how I parse JSON and try to match ocelot routing to swagger endpoints.
Unfortunately I don't have the time to fix this right now. If you feel like it, you can try it. It's all done in the SwaggerJsonTransformer
class.
If not then you can try use the parameter RemoveUnusedComponentsFromScheme
"SwaggerEndPoints": [
{
"Key": "projects",
"RemoveUnusedComponentsFromScheme": false,
"Config": [
{
"Name": "Projects API",
"Version": "v1",
"Service": {
"Name": "projects",
"Path": "/swagger/v1/swagger.json"
}
}
]
}
Closing after 8 days of waiting for the additional info requested.
Ocelot requires up to 500Mb additional memory to start a service with UseSwaggerForOcelotUI enabled.
How to reproduce:
swagger.json
file size 688Kb, about 300 operationsroutes.json
56Kb with routes to 2 external services and gateway inselfIf use ocelot routes with a service with only a few operations ( 10 operations ) it takes much less memory:![image](https://user-images.githubusercontent.com/113441753/215066051-6d2e854a-cd69-440e-921b-510a50784d75.png)
So it looks like more operations in target service - ocelot will take and keep more memory.