News for hackers. Stuff that matters.

taswellian

Re:Why is Everyone in Tech so sad? on Saturday August 08, 2026 @07:46AM (#49220889)
Where is that?
Re:Stop Telling Me to Ask an LLM on Tuesday July 14, 2026 @04:31PM (#48912570)
why no respect?
Honest questions: What do "get ahead" and "throw under the bus" mean, exactly? Any examples?
Re:How to Choose Colors for Your CLI Applications (2023) on Thursday January 29, 2026 @10:51AM (#46811791)
It's easier to see dark text on a light background for people with astigmatism.
Re:Amazon axes 16,000 jobs as it pushes AI and efficiency on Wednesday January 28, 2026 @04:13PM (#46801604)
What do you mean? Who is "we" and "our"?
Re:2009scape – Runescape in 2009 on Saturday August 19, 2023 @06:54AM (#37187451)
I feel the same way... happy and sad at the same time. Great music!
Thanks! I'll keep looking for a solution and keep you in the loop once we figure something out.
This looks interesting, thank you!

I'm basically wondering what would help us produce (automatically?) a Python HTTP client based an OpenAPI spec, and achieve a development experience similar to using drwpow/openapi-typescript.

drwpow/openapi-typescript will generate the whole schema, along with paths, request and response models, as well as path and query parameters. In the IDE, all client methods will be type-safe and autocompleted.

Example:

  client = createClient<GeneratedSchema>();
  
  client.get("/my/autocompleted/endpoint/{some_param}", { params: { path: { some_param: "foobar" } } })
koxudaxi/datamodel-code-generator seems to generate the response models, but not much else. It seems we would have to manually write wrapper methods for each endpoint, manually specify the parameters and request models, and use a type hint for the return value of each method with the generated response model.

Example:

  def my_wrapped_endpoint(...) -> ResponseModel:
    pass

  client.my_wrapped_endpoint(some_param="foobar")

I'd like to avoid any manual wrapping or at least minimize the amount of it. Basically: to achieve a similar experience to what we have in TypeScript.

I hope my question is a bit clearer now. I'm not that familiar with Python, so I will appreciate any guidance regarding this problem. :)

Do you know if there's something similar for Python? Or what approach would you use for Python?
> You only have one life, do something with it that is satisfying. Get out of the rat race.

How?

I find satisfaction in many things, but none of those things pay the bills or put food on the table.