initial commit
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "Application",
|
||||
"version": "%version%"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "DebugAPI"
|
||||
}
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {
|
||||
"/api/v1/version": {
|
||||
"get": {
|
||||
"operationId": "DebugAPI_GetVersion",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/servicesGetVersionResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
"DebugAPI"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"protobufAny": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": {}
|
||||
},
|
||||
"rpcStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/protobufAny"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"servicesGetVersionResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"version": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
syntax = "proto3";
|
||||
package api.messages;
|
||||
|
||||
option go_package = "pkg/pb/api/messages";
|
||||
|
||||
message Message{}
|
||||
@@ -0,0 +1,8 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
)
|
||||
|
||||
//go:embed api.swagger.json
|
||||
var OpenAPI []byte
|
||||
@@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
package api.services;
|
||||
|
||||
option go_package = "pkg/pb/api/services";
|
||||
|
||||
import "protoc-gen-openapiv2/options/annotations.proto";
|
||||
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
|
||||
info: {
|
||||
title: "Application"
|
||||
version: "%version%"
|
||||
}
|
||||
security_definitions: {
|
||||
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
syntax = "proto3";
|
||||
package api.services;
|
||||
|
||||
option go_package = "pkg/pb/api/services";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
service DebugAPI {
|
||||
rpc GetVersion (GetVersion.Request) returns (GetVersion.Response) {
|
||||
option (google.api.http) = {
|
||||
get: "/api/v1/version"
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
message GetVersion {
|
||||
message Request {}
|
||||
message Response {
|
||||
string version = 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user