HackerTrans
TopNewTrendsCommentsPastAskShowJobs

martinn

no profile record

Submissions

Show HN: Create typed declarative API clients quickly and easily (Python)

github.com
1 points·by martinn·2 anni fa·0 comments

comments

martinn
·2 anni fa·discuss
At this stage it's mostly been a toy learning project, but I can definitely do that if there's interest.
martinn
·2 anni fa·discuss
A while back while learning rust, I built a little tool that would kind of give you an aggregate view of what gource shows you but based on lines of code rather than commits. (i.e. see top contributors by lines of code on any git repo).

https://github.com/martinn/repoblame if anyone's curious.
martinn
·2 anni fa·discuss
I'm working on a library that allows anyone to build fully typed, declarative API clients very easily, in Python.

https://github.com/martinn/quickapiclient
martinn
·2 anni fa·discuss
Thanks, that makes sense for that use case.

My question is probably a more general one around the use case for writing an API spec (in a format like OpenAPI or TypeSpec), and then translating and writing the server implementation to match that. As opposed to being able to create the API spec automatically based on server implementation (and being able to easily refresh it).

Understand that writing the spec and then the server implementation seems to have some benefits. I'm curious to hear about the common use cases for it, as in my mind I could quickly stub a server implementation (and automatically generate a spec) rather than try to create the spec by hand and then write the server implementation again. But I'm sure there's some other things I'm missing.
martinn
·2 anni fa·discuss
Could someone clarify what's the use case of a tool like this please.

Is this something that helps if you, say, are building a new API and will need to create both the server implementation as well as the client implementations in multiple languages? And so, it can automatically do all of that for you based on an API spec? Or is it something different.

Funnily enough, I developed a Python library recently that allows you to build API clients in a way that very closely resembles the TypeSpec example. But I'm pretty sure they are very different things.
martinn
·2 anni fa·discuss
I'm working on a library for creating fully typed declarative API clients, quickly and easily. In Python.

https://github.com/martinn/quickapiclient