Skip to content
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
21 changes: 21 additions & 0 deletions cmd/protoc-gen-openapi/examples/tests/pathparams/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ service Messaging {
};
}

rpc GetMessage2(GetMessage2Request) returns (Message) {
option (google.api.http) = {
get : "/v2/messages/{message_id=*}"
};
}

rpc GetMessage3(GetMessage3Request) returns (Message) {
option (google.api.http) = {
get : "/v3/{name=user/messages/*}"
};
}

rpc GetUserMessage(GetMessageRequest) returns (Message) {
option (google.api.http) = {
get : "/v1/users/{user_id}/messages/{message_id}"
Expand All @@ -47,6 +59,15 @@ message GetMessageRequest {
uint64 user_id = 2;
}

message GetMessage2Request {
string message_id = 1;
uint64 user_id = 2;
}

message GetMessage3Request {
string name = 1;
}

message Meta {
string message_id = 1;
uint64 user_id = 2;
Expand Down
53 changes: 53 additions & 0 deletions cmd/protoc-gen-openapi/examples/tests/pathparams/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,59 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v2/messages/{message_id}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage2
parameters:
- name: message_id
in: path
required: true
schema:
type: string
- name: user_id
in: query
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v3/user/messages/{message}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage3
parameters:
- name: message
in: path
description: The message id.
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
components:
schemas:
GoogleProtobufAny:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,59 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v2/messages/{messageId}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage2
parameters:
- name: messageId
in: path
required: true
schema:
type: string
- name: userId
in: query
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v3/user/messages/{message}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage3
parameters:
- name: message
in: path
description: The message id.
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
components:
schemas:
GoogleProtobufAny:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,59 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/google.rpc.Status'
/v2/messages/{messageId}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage2
parameters:
- name: messageId
in: path
required: true
schema:
type: string
- name: userId
in: query
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/tests.pathparams.message.v1.Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/google.rpc.Status'
/v3/user/messages/{message}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage3
parameters:
- name: message
in: path
description: The message id.
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/tests.pathparams.message.v1.Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/google.rpc.Status'
components:
schemas:
google.protobuf.Any:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,59 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v2/messages/{messageId}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage2
parameters:
- name: messageId
in: path
required: true
schema:
type: string
- name: userId
in: query
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v3/user/messages/{message}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage3
parameters:
- name: message
in: path
description: The message id.
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
components:
schemas:
GoogleProtobufAny:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,59 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v2/messages/{messageId}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage2
parameters:
- name: messageId
in: path
required: true
schema:
type: string
- name: userId
in: query
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v3/user/messages/{message}:
get:
tags:
- Messaging
operationId: Messaging_GetMessage3
parameters:
- name: message
in: path
description: The message id.
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
components:
schemas:
GoogleProtobufAny:
Expand Down
Loading