Hacker News new | ask | show | jobs
by dnautics 1707 days ago
> One of the best decisions we made was to auto generate the OpenAPI specs from our code.

I'm curious as to what they used to do this. It's been a major pain point for me for five-odd years that Elixir Phoenix (don't know if Brex used Phoenix for this) doesn't have an OpenAPI autogenerator, and, now, this is my third job where I'm building an OpenAPI API in Elixir, so I got permission to open source our solution later this year.

Would have been nice to collaborate, but I guess Brex is leaving Elixir, so, there's that. They kind of had a bit of a reputation for not contributing much code back to the ecosystem =(

3 comments

Hey,

I'm the author of the post and we built the API on Kotlin and some of them are our earliest Kotlin services. We're using Micronaut OpenAPI to generate specs.

You're right in that it's hard to do many of these things in Elixir and it was a big factor in us moving away from Elixir. I wrote a bit about it here https://medium.com/brexeng/building-backend-services-with-ko...

I wouldn't say it's hard to do it in Elixir; I did it as an elixir NOOB, junior dev 4 years ago: https://github.com/ityonemo/exaggerate -- if you look at the code history it was completed in about 3 weeks (but there's a reason this isn't on hex.pm; surely a company with many seniors has the bandwidth to do something like this right and share it with the community)
Sure. I'd frame this question of not whether these endeavors are difficult or possible but rather if they're the best way to use our time and effort to serve our customers.

FWIW on the note of OSS, we've made some minor contributions to micronaut and other open-source projects we use. We love OSS and are happy to make contributions and work with the broader community! The community and ecosystem has been incredible for us so far.

OpenAPI seems weirdly under-used and under-appreciated. OAS 3.1 has full JSONSchema compatibility and is generally (in my opinion) an excellent tool. But pretty much nothing supports it, not even the Swagger.io products. It's like people want to keep doing things the old hard way.
this is a huge pain point OAS 3.1 is "basically perfect" and I wish so much we could transition to it, but we expose our API via Swagger.io, so we can't transition yet.

I think OpenAPI is losing out the sexiness battle against graphQL, but I will say this: There's a way in which OpenAPI inherently makes you reflect on distributed systems errors. What are you going to do if a request 500's and you need to maintain consistency between two data systems?

I no longer work at Brex, but I believe they did this using Kotlin rather than Elixir.
thanks for the insight. either way, would be nice of them to either open source their solution (or if they are using someone else's point us to which one they picked)