Skip to content
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

Different gateway swagger response json than service swagger #203

Closed
teomane opened this issue Nov 3, 2021 · 5 comments
Closed

Different gateway swagger response json than service swagger #203

teomane opened this issue Nov 3, 2021 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@teomane
Copy link
Contributor

teomane commented Nov 3, 2021

Hello,

I have an issue with the library. The example value of the response of a service is seen differently on the gateway swagger. Let me give an example:

This is the JSON of the response of my endpoint (taken from the service's swagger):

[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "isRejected": true,
    "category": {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "parentCategoryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "code": "string",
      "name": "string",
      "level": 0,
      "parentCategory": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "parentCategoryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "code": "string",
        "name": "string",
        "level": 0
      }
    }
  }
]

And this is the JSON from the gateway for the same service:

[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "isRejected": true,
    "category": {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "parentCategoryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "code": "string",
      "name": "string",
      "level": 0
    }
  }
]

I can't see the node:

"parentCategory": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "parentCategoryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "code": "string",
        "name": "string",
        "level": 0
}

What do you think about the problem ?

@Burgyn
Copy link
Owner

Burgyn commented Nov 5, 2021

Hi,

it's from Ocelot Aggregates, or from standard service? If its from aggregation then looks similar like issue #191

@Burgyn Burgyn added needs-more-info Autor needs more info waiting-8-days Closing after 8 days of waiting for the additional info requested. labels Nov 5, 2021
@teomane
Copy link
Contributor Author

teomane commented Nov 5, 2021

It is not from aggregates. It is just a standard downstream service configured with Routes.

@no-response no-response bot removed the needs-more-info Autor needs more info label Nov 5, 2021
@github-actions github-actions bot removed the waiting-8-days Closing after 8 days of waiting for the additional info requested. label Nov 5, 2021
@Burgyn
Copy link
Owner

Burgyn commented Nov 5, 2021

Can you please prepare simple reproducible example. Because it's OK on my projects.

@Burgyn Burgyn added the help wanted Extra attention is needed label Nov 5, 2021
@eymentopcuoglu
Copy link
Contributor

Hi,

It seems rendering of circular-referenced objects on Swagger UI is still an ongoing issue. However, a comment on this issue seemed to work for me! For our case, to make the paths of the downstream Swagger endpoints relative, I used DownstreamSwaggerEndPointBasePath:

app.UseSwaggerForOcelotUI(opt =>
            {
                opt.DownstreamSwaggerEndPointBasePath = "../swagger/docs";
            });

@teomane
Copy link
Contributor Author

teomane commented Nov 13, 2021

Thank you @eymentopcuoglu. It works for me.

@Burgyn Burgyn closed this as completed Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants