OpenAPI Generator allows generation of API client libraries from OpenAPI Specs
&gt;OpenAPI Generator allows generation of API client libraries from OpenAPI Specs<p>It does, but the generated code can be very shitty for some combinations of spec and output language. I maintain Rust bindings for the Kubernetes API server&#x27;s API, and I chose to write my own code generator instead. The README at <a href="https:&#x2F;&#x2F;github.com&#x2F;Arnavion&#x2F;k8s-openapi" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Arnavion&#x2F;k8s-openapi</a> has more details.<p>The point there about bugs in the spec is not limited to Kubernetes. $dayjob&#x27;s software product interacts with the Docker daemon&#x27;s server API so we generated bindings using the Docker spec, but that spec had a bug where some timespan values used the wrong integer type ( <a href="https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;moby&#x2F;issues&#x2F;39131" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;moby&#x2F;moby&#x2F;issues&#x2F;39131</a> ). Luckily we were able to fix them in our generated code because we&#x27;d opted to check in the generated code instead of building it dynamically at compile time. The generated code also had a bug in the function for pulling Docker images, because it did not account for the fact that pulling the image can fail at some point after it has started, in which case the HTTP response has a successful status code but the streaming body ends with an error record. We had to edit the generated code to incorporate any error records in the response body as an error in the overall function result.<p>And as I wrote in the &quot;sans-io&quot; section of that README, I also believe the generator&#x27;s approach of providing an API client that has all decisions made for you, like whether the API is sync or async (in languages where that matters), what HTTP library it uses internally, etc is overly limiting. It means that a user who does not agree with even one of those decisions is prevented from using the entire generated library. In my opinion the part where models&#x2F;requests can be encoded to bytes and models&#x2F;responses can be decoded from bytes is separate from the part where bytes are sent and received over HTTP, which is why k8s-openapi only does the former and you can write a thin wrapper to use it with your chosen HTTP client.<p>So basically, the generator exists and is a good starting point when you just want a quick and dirty way to consume an API, but a) you should have a plan for bugs in the spec and bugs in the generated code, b) you should have a plan for generating your own bindings instead of using a third-party library that generated them for you if you don&#x27;t agree with any of the third party&#x27;s choice of codegen parameters, and c) you might find hand-written bindings, or a bespoke hand-written generator for that particular spec, worth the investment.