Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support format for 64-bit integer field types #409

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

esraaghanemali
Copy link

@esraaghanemali esraaghanemali commented Oct 15, 2023

In this PR I update generator to add a format property to the schema for the proto definitions: int64, sint64, uint64, sfixed64, and fixed64
As this was the case in OpenApi v2 specifications and we are migrating to openApi v3, we still need this info as we handle each one differently.

previous behavior
message MyMessage {
int64 my_field = 1;
}
the generated openApi V3 specifications are

components:
  schemas:
    MyMessage:
      type: object
      properties:
        my_field:
          type: string

but openApi v2 https://github.com/grpc-ecosystem/grpc-gateway/tree/main/protoc-gen-openapiv2 we got this

components:
  schemas:
    MyMessage:
      type: object
      properties:
        my_field:
          type: string
          format: int64

@esraaghanemali esraaghanemali requested a review from a team as a code owner October 15, 2023 20:18
@google-cla
Copy link

google-cla bot commented Oct 15, 2023

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.

@arthaali
Copy link

@timburks Hello, can you please take a look at this addition to the type int64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants