google / gnostic

A compiler for APIs described by the OpenAPI Specification with plugins for code generation and other API support tasks.
Apache License 2.0
2.03k stars 241 forks source link

Revert "[+] support integer64 as string option (#355)" #431

Open ajorgensen opened 3 months ago

ajorgensen commented 3 months ago

ref: https://github.com/google/gnostic/pull/355 closes: https://github.com/google/gnostic/issues/411

This reverts commit c62333b7964941ab26259ef3648690e6bdd34459.

The original change conflated generating an OpenAPI v3 spec file with the guidance for encoding protobuf messages as json objects. OpenAPI v3 explicitly allows for integer types of int64 (https://swagger.io/docs/specification/data-models/data-types/#numbers). The OpenAPI v3 spec generated by this tool will then usually be fed into language specific generators which will determine how they want to handle each of the types depending on the specific target language.

google-cla[bot] commented 3 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

n0v1 commented 3 months ago

I also think that the generated OpenAPI specification should match the types in the proto file as close as possible and should not be language-specific. So for proto type int64 I would expect {"type": "integer", "format": "int64"} as it was before instead of {"type": "string"}.