Search code examples
asp.net-coreocelot

Can Ocelot have it's own Controller/Actions?


I am trying to put together an API gateway that also serves the purpose of mashing up calls to multiple APIs. I would also like to have autogenerated Swagger, so I'd like to combine the capability of Ocelot for authorization and rate limiting but would also like to be able to create the edge custom API's in .NET code to handle translations and combinations of API calls.

Is this possible with Ocelot, and are there any examples? Does Ocelot only work with downstream API's as separate applications? I'm trying to avoid an extra hop that would only exist for mashups and composite API calls.


Solution

  • There isn't any auto-generated swagger that's supported by Ocelot. But you can hand-roll your own solution.As far as i understand Ocelot only works by providing a ocelot.json configure with your re-reroutes configured to downstream apps/api s.

    Ocelot Swagger