@@ -3,15 +3,12 @@ syntax = "proto3";
33package test.api ;
44
55import "oapi/v1/file.proto" ;
6- import "oapi/v1/service.proto" ;
76import "oapi/v1/method.proto" ;
7+ import "oapi/v1/service.proto" ;
88
99option go_package = "github.com/technicallyjosh/protoc-gen-openapi/test_api" ;
10-
1110option (oapi.v1.file ) = {
12- servers {
13- url : "swagger.io"
14- }
11+ servers {url : "swagger.io" }
1512 prefix: "/v1"
1613
1714 security_schemes: {
@@ -25,27 +22,24 @@ option (oapi.v1.file) = {
2522
2623 security: {
2724 name : "bearer_auth"
28- scopes : ["scope:1", "scope:2" ]
25+ scopes : [
26+ "scope:1" ,
27+ "scope :2 "
28+ ]
2929 }
3030};
3131
3232service TestService {
3333 option (oapi.v1.service ) = {
34- servers {
35- url : "api.swagger.io"
36- }
37- add_servers {
38- url : "api.added.io"
39- }
34+ servers {url : "api.swagger.io" }
35+ add_servers {url : "api.added.io" }
4036 x_display_name: "Test Service"
4137 x_tag_group: "Test Group"
4238 };
4339
4440 rpc TestGet (TestGetRequest ) returns (TestGetResponse ) {
45- option (oapi.v1.method ) = {
46- get : "TestGet"
47- };
48- };
41+ option (oapi.v1.method ) = {get : "TestGet" };
42+ }
4943
5044 rpc TestPost (TestPostRequest ) returns (TestPostResponse ) {
5145 option (oapi.v1.method ) = {
@@ -57,34 +51,29 @@ service TestService {
5751
5852service Test2Service {
5953 option (oapi.v1.service ) = {
60- add_servers {
61- url : "api.added.io"
62- }
54+ add_servers {url : "api.added.io" }
6355 x_display_name: "Test 2 Service"
6456 x_tag_group: "Test 2 Group"
6557 };
6658
6759 rpc TestGet (TestGetRequest ) returns (TestGetResponse ) {
68- option (oapi.v1.method ) = {
69- get : "Test2Get"
70- };
71- };
60+ option (oapi.v1.method ) = {get : "Test2Get" };
61+ }
7262}
7363
74- message TestGetRequest {
64+ message TestGetRequest {
7565 string value = 1 ;
7666}
7767
78- message TestGetResponse {
68+ message TestGetResponse {
7969 string value = 1 ;
8070}
8171
82- message TestPostRequest {}
72+ message TestPostRequest {}
8373
84- message TestPostResponse {}
74+ message TestPostResponse {}
8575
8676message Error {
8777 string code = 1 ;
8878 string msg = 2 ;
8979}
90-
0 commit comments