Hacker News new | ask | show | jobs
by mayank 2051 days ago
> Does OpenAPI generate code for you?

An OpenAPI spec is the equivalent of your .proto files. You need codegen to go from your .proto files to native classes, and you need codegen to go from your OpenAPI spec to native.

> Protobuf and Cap'n Proto feature dedicated schema languages that feel like a programming language. It looks like OpenAPI has you writing schemas themselves in JSON or YAML. Ick.

Counterpoint: I can take an OpenAPI spec and parse/process/render/codegen it in every single language without a custom parser library.

1 comments

Your counterpoint makes no sense...

And Protobuf has generators for more languages than OpenAPI/Swagger.

FYI. OpenAPI Generator supports many programming languages and server-side frameworks: https://github.com/OpenAPITools/openapi-generator#overview

This is not to say it has more languages supported than Protobuf as I do not know exactly how many generators out there supporting Protobuf.

(OpenAPI Generator also comes with the generator/converter that converts OpenAPI spec documents into gRPC and protocol buffer schema files. Not sure if OpenAPI Generator is also counted as a generator for Protobuf)