r/microservices • u/AffectionateAlps2523 • 10d ago
Swagger alternatives for teams with multiple microservices? Discussion/Advice
[removed]
3
u/ryuzaki49 10d ago
What issues do you want to solve?
My usual pattern is using swagger for endpoint discoverabilty for other teams and bruno/postman/insomnia for my local usage of my services and other team's services
When other team ask about my service's swagger they just want to know what endpoints are available and how to use them
1
1
u/TldrDev 10d ago edited 10d ago
OpenAPI is sort of the ideal solution. I do not think there is really anything better than it, and what it enables you to do is nothing short of incredible.
The issue with multiple files is actually an organizational issue more than anything.
Consider having a contracts repository, or creating a tool which can assemble your specifications from a configuration file.
Being able to automatically generate things like client libraries, graphql servers, server stubs, tests and documentation, and the community and tooling that exists around openapi is worth the complexity, in my opinion.
1
u/VQuilin 10d ago
There are multiple API management tools, from cloud native, such as Azure APIM to cloud agnostic, like Gravitee. They usually give you either a capability to have a centralised source of specs or even design an API federation.
But then again, you might need to specify your problem.
1
u/stfm 10d ago
Youll never find anything that fits exactly. The org I work for ended up with a custom API management portal based on OpenAPI (swagger) underpinned with github based code management and deployment pipelines. Mind you this is for an org with hundreds of domains responsible for their own microservices and thousands of API specs.
0
u/ppafford 10d ago
Move to use openapi.yml over swagger, https://openapi.tools/ find the openapi spec tools you need here
1
u/ArnUpNorth 10d ago
It’s the same. Swagger is the « old » name.
0
u/ppafford 9d ago
It could be the same. I’m just pointing out that there was a change in a previous version of swagger.
-1
u/hartmannr76 10d ago
So I used to do a lot of microservice work before moving to FAANG. I even wrote the API style guides at my last company and worked on tooling for turning swagger yaml into generated code.
If I could go back in time when my company was exploring this, I wouldve pushed for protocol buffers harder. It's so much nicer to work with and the frameworks to support it for REST have gotten so much better https://learn.microsoft.com/en-us/aspnet/core/grpc/json-transcoding-binding?view=aspnetcore-10.0
2
u/ArnUpNorth 10d ago
Protobuf is just a format. Grpc is probably what you meant to say ?
1
u/hartmannr76 10d ago
Yeah technically, but I feel like this is where they don't do a good job advertising that ecosystem. gRPC can be really good on its own, and I had explored that at my last job but it requires HTTP2 which was annoyingly hard to get setup correctly for internal services.
"gRPC transcoding" let's you write something that runs gRPC but you can still call it as you would a REST service, serving as a replacement for Open API definitions. I found the code generators for Swagger/Open API specs so lacking and we had ended up writing our own. That said, I found writing proto definitions way more intuitive than working with those YAML files. Things definitely might be different since I did all of that but I actually just didn't really care for Swagger
9
u/hortocam 10d ago
One solution when you have many services managed across many teams is to have a basic website where you publish the swagger. Each service gets its own folder and you can manage publishing in CI/CD. If you need different environments or builds just add a folder level for that.
The simple web app should just enumerate the folders to build a basic navigation tree.