News for hackers. Stuff that matters.
Re:Building the Brex API by dnautics on Thursday October 21, 2021 @06:08PM (#28951421)
> 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 =(

Re:Building the Brex API by pratikel on Thursday October 21, 2021 @06:29PM (#28951606)
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...

Re:Building the Brex API by dnautics on Thursday October 21, 2021 @06:32PM (#28951635)
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)
Re:Building the Brex API by pratikel on Thursday October 21, 2021 @06:47PM (#28951752)
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.

Re:Building the Brex API by nerdponx on Thursday October 21, 2021 @08:22PM (#28952466)
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.
Re:Building the Brex API by dnautics on Thursday October 21, 2021 @09:17PM (#28952751)
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?

Re:Building the Brex API by MediumD on Thursday October 21, 2021 @06:20PM (#28951522)
I no longer work at Brex, but I believe they did this using Kotlin rather than Elixir.
Re:Building the Brex API by dnautics on Thursday October 21, 2021 @06:28PM (#28951588)
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)