-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: 2024-05-25 15:45:21 * add tag query and parameter
- Loading branch information
Showing
5 changed files
with
205 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Generated with protoc-gen-openapi | ||
# https://github.com/pubgo/protoc-gen-openapi | ||
|
||
openapi: 3.0.3 | ||
info: | ||
title: openapi examples | ||
version: 0.0.1 | ||
paths: | ||
/v1/messages:deprecated: | ||
put: | ||
tags: | ||
- Messaging1 | ||
operationId: Messaging1_UpdateMessage | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Messagedeprecated' | ||
required: true | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Messagedeprecated' | ||
components: | ||
schemas: | ||
Messagedeprecated: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
label: | ||
deprecated: true | ||
type: string | ||
label1: | ||
deprecated: true | ||
type: string | ||
tags: | ||
- name: Messaging1 |
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,45 @@ | ||
// Copyright 2021 Google LLC. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
syntax = "proto3"; | ||
|
||
package tests.deprecated.message.v1; | ||
|
||
import "google/api/annotations.proto"; | ||
import "openapiv3/annotations.proto"; | ||
|
||
option go_package = "github.com/google/gnostic/apps/protoc-gen-openapi/examples/tests/noannotations/message/v1;message"; | ||
|
||
service Messaging1 { | ||
rpc UpdateMessage (Messagedeprecated) returns (Messagedeprecated) { | ||
option (google.api.http) = { | ||
put: "/v1/messages:deprecated" | ||
body: "*" | ||
}; | ||
} | ||
} | ||
|
||
message Messagedeprecated { | ||
int64 id = 1; | ||
string label = 2 [ | ||
(openapi.v3.property) = { | ||
deprecated: true | ||
} | ||
]; | ||
|
||
string label1 = 3 [ | ||
deprecated = true | ||
]; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,72 +23,90 @@ import "openapiv3/annotations.proto"; | |
option go_package = "github.com/google/gnostic/apps/protoc-gen-openapi/examples/tests/openapiv3annotations/message/v1;message"; | ||
|
||
option (openapi.v3.document) = { | ||
info: { | ||
title: "Title from annotation"; | ||
version: "Version from annotation"; | ||
description: "Description from annotation"; | ||
contact: { | ||
name: "Contact Name"; | ||
url: "https://github.com/google/gnostic"; | ||
email: "[email protected]"; | ||
} | ||
license: { | ||
name: "Apache License"; | ||
url: "https://github.com/google/gnostic/blob/master/LICENSE"; | ||
info: { | ||
title: "Title from annotation"; | ||
version: "Version from annotation"; | ||
description: "Description from annotation"; | ||
contact: { | ||
name: "Contact Name"; | ||
url: "https://github.com/google/gnostic"; | ||
email: "[email protected]"; | ||
} | ||
license: { | ||
name: "Apache License"; | ||
url: "https://github.com/google/gnostic/blob/master/LICENSE"; | ||
} | ||
} | ||
} | ||
components: { | ||
security_schemes: { | ||
additional_properties: [ | ||
{ | ||
name: "BasicAuth"; | ||
value: { | ||
security_scheme: { | ||
type: "http"; | ||
scheme: "basic"; | ||
} | ||
} | ||
components: { | ||
security_schemes: { | ||
additional_properties: [ | ||
{ | ||
name: "BasicAuth"; | ||
value: { | ||
security_scheme: { | ||
type: "http"; | ||
scheme: "basic"; | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}; | ||
|
||
service Messaging1 { | ||
rpc UpdateMessage(Message) returns(Message) { | ||
option(google.api.http) = { | ||
patch: "/v1/messages/{message_id}" | ||
body: "*" | ||
}; | ||
option(openapi.v3.operation) = { | ||
security: [ | ||
{ | ||
additional_properties: [ | ||
{ | ||
name: "BasicAuth"; | ||
value: {} | ||
} | ||
rpc UpdateMessage (Message) returns (Message) { | ||
option (google.api.http) = { | ||
patch: "/v1/messages/{message_id}" | ||
body: "*" | ||
}; | ||
|
||
option (openapi.v3.operation) = { | ||
tags: ["abc=def"], | ||
specification_extension: [ | ||
{ | ||
name: "x-operation-id"; | ||
value: { | ||
yaml: "updateMessage" | ||
}; | ||
} | ||
], | ||
parameters: [{ | ||
parameter: { | ||
description: "jwt token", | ||
in: "header", | ||
name: "Authorization", | ||
required: true, | ||
}, | ||
}], | ||
security: [ | ||
{ | ||
additional_properties: [ | ||
{ | ||
name: "BasicAuth"; | ||
value: {} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}; | ||
} | ||
}; | ||
} | ||
} | ||
|
||
service Messaging2 { | ||
rpc UpdateMessage(Message) returns (Message) {} | ||
rpc UpdateMessage (Message) returns (Message) {} | ||
} | ||
|
||
message Message { | ||
option (openapi.v3.schema) = { | ||
title: "This is an overridden message schema title"; | ||
}; | ||
option (openapi.v3.schema) = { | ||
title: "This is an overridden message schema title"; | ||
}; | ||
|
||
int64 id = 1; | ||
string label = 2 [ | ||
(openapi.v3.property) = { | ||
title: "this is an overriden field schema title"; | ||
max_length: 255; | ||
} | ||
]; | ||
int64 id = 1; | ||
string label = 2 [ | ||
(openapi.v3.property) = { | ||
title: "this is an overriden field schema title"; | ||
max_length: 255; | ||
} | ||
]; | ||
} |
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