-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix * implement toYAMLNode * add comment * check len * add test * add comment * rename * update * generate
- Loading branch information
Showing
5 changed files
with
144 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
protoc-gen-openapiv2/internal/genopenapi/testdata/generator/path_item_object.prototext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
file_to_generate: "your/service/v1/your_service.proto" | ||
proto_file: { | ||
name: "your/service/v1/your_service.proto" | ||
package: "your.service.v1" | ||
message_type: { | ||
name: "StringMessage" | ||
field: { | ||
name: "value" | ||
number: 1 | ||
label: LABEL_OPTIONAL | ||
type: TYPE_STRING | ||
json_name: "value" | ||
} | ||
} | ||
service: { | ||
name: "YourService" | ||
method: { | ||
name: "Echo" | ||
input_type: ".your.service.v1.StringMessage" | ||
output_type: ".your.service.v1.StringMessage" | ||
options: { | ||
[google.api.http]: { | ||
post: "/api/echo" | ||
} | ||
} | ||
} | ||
} | ||
options: { | ||
go_package: "github.com/yourorg/yourprotos/gen/go/your/service/v1" | ||
} | ||
syntax: "proto3" | ||
} |
32 changes: 32 additions & 0 deletions
32
protoc-gen-openapiv2/internal/genopenapi/testdata/generator/path_item_object.swagger.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
swagger: "2.0" | ||
info: | ||
title: your/service/v1/your_service.proto | ||
version: version not set | ||
tags: | ||
- name: YourService | ||
consumes: | ||
- application/json | ||
produces: | ||
- application/json | ||
paths: | ||
/api/echo: | ||
post: | ||
operationId: YourService_Echo | ||
responses: | ||
"200": | ||
description: A successful response. | ||
schema: | ||
$ref: '#/definitions/StringMessage' | ||
parameters: | ||
- name: value | ||
in: query | ||
required: false | ||
type: string | ||
tags: | ||
- YourService | ||
definitions: | ||
StringMessage: | ||
type: object | ||
properties: | ||
value: | ||
type: string |