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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
GoogleProtobufAny:
Expand Down Expand Up @@ -90,7 +91,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
Status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
GoogleProtobufAny:
Expand Down Expand Up @@ -90,7 +91,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
Status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
tests.mapfields.message.v1.Message:
Expand Down Expand Up @@ -106,7 +107,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
GoogleProtobufAny:
Expand Down Expand Up @@ -90,7 +91,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
Status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
GoogleProtobufAny:
Expand Down Expand Up @@ -90,7 +91,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
Status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
Status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
Status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
Status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
type: string
Status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
title: this is an overriden field schema title
maxLength: 255
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
title: this is an overriden field schema title
maxLength: 255
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
title: this is an overriden field schema title
maxLength: 255
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
title: this is an overriden field schema title
maxLength: 255
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ components:
type: object
properties:
id:
type: string
type: integer
format: int64
label:
title: this is an overriden field schema title
maxLength: 255
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ paths:
- name: user_id
in: query
schema:
type: string
type: integer
format: uint64
responses:
"200":
description: OK
Expand Down Expand Up @@ -73,7 +74,8 @@ paths:
in: path
required: true
schema:
type: string
type: integer
format: uint64
- name: message_id
in: path
required: true
Expand Down Expand Up @@ -108,7 +110,8 @@ components:
message_id:
type: string
user_id:
type: string
type: integer
format: uint64
content:
type: string
maybe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ paths:
- name: userId
in: query
schema:
type: string
type: integer
format: uint64
responses:
"200":
description: OK
Expand Down Expand Up @@ -73,7 +74,8 @@ paths:
in: path
required: true
schema:
type: string
type: integer
format: uint64
- name: messageId
in: path
required: true
Expand Down Expand Up @@ -108,7 +110,8 @@ components:
messageId:
type: string
userId:
type: string
type: integer
format: uint64
content:
type: string
maybe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ paths:
- name: userId
in: query
schema:
type: string
type: integer
format: uint64
responses:
"200":
description: OK
Expand Down Expand Up @@ -73,7 +74,8 @@ paths:
in: path
required: true
schema:
type: string
type: integer
format: uint64
- name: messageId
in: path
required: true
Expand Down Expand Up @@ -124,7 +126,8 @@ components:
messageId:
type: string
userId:
type: string
type: integer
format: uint64
content:
type: string
maybe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ paths:
- name: userId
in: query
schema:
type: string
type: integer
format: uint64
responses:
"200":
description: OK
Expand Down Expand Up @@ -73,7 +74,8 @@ paths:
in: path
required: true
schema:
type: string
type: integer
format: uint64
- name: messageId
in: path
required: true
Expand Down Expand Up @@ -108,7 +110,8 @@ components:
messageId:
type: string
userId:
type: string
type: integer
format: uint64
content:
type: string
maybe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ paths:
- name: userId
in: query
schema:
type: string
type: integer
format: uint64
responses:
"200":
description: OK
Expand Down Expand Up @@ -73,7 +74,8 @@ paths:
in: path
required: true
schema:
type: string
type: integer
format: uint64
- name: messageId
in: path
required: true
Expand Down Expand Up @@ -108,7 +110,8 @@ components:
messageId:
type: string
userId:
type: string
type: integer
format: uint64
content:
type: string
maybe:
Expand Down
8 changes: 3 additions & 5 deletions cmd/protoc-gen-openapi/generator/reflector.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,11 @@ func (r *OpenAPIv3Reflector) schemaOrReferenceForField(field protoreflect.FieldD
kindSchema = wk.NewStringSchema()

case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Uint32Kind,
protoreflect.Sfixed32Kind, protoreflect.Fixed32Kind:
protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Uint64Kind,
protoreflect.Sfixed32Kind, protoreflect.Fixed32Kind, protoreflect.Sfixed64Kind,
protoreflect.Fixed64Kind:
kindSchema = wk.NewIntegerSchema(kind.String())

case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Uint64Kind,
protoreflect.Sfixed64Kind, protoreflect.Fixed64Kind:
kindSchema = wk.NewStringSchema()

case protoreflect.EnumKind:
kindSchema = wk.NewEnumSchema(*&r.conf.EnumType, field)

Expand Down