File: enum_with_single_value.proto

package info (click to toggle)
golang-github-grpc-ecosystem-grpc-gateway 2.20.0-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 7,236 kB
  • sloc: javascript: 357; makefile: 147; sh: 26
file content (29 lines) | stat: -rw-r--r-- 906 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
syntax = "proto3";

package grpc.gateway.examples.internal.proto.examplepb;

import "google/api/annotations.proto";

option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb";

service EnumWithSingleValueService {
  rpc Echo(EnumWithSingleValueServiceEchoRequest) returns (EnumWithSingleValueServiceEchoResponse) {
    option (google.api.http) = {
      post: "/v1/example/enum-with-single-value/echo"
      body: "*"
    };
  }
}

// EnumWithSingleValue is an enum with a single value. Since it has just a single value
// the `enum` field should be omitted in the generated OpenAPI spec for the type when
// the omit_enum_default_value option is set to true.
enum EnumWithSingleValue {
  ENUM_WITH_SINGLE_VALUE_UNSPECIFIED = 0;
}

message EnumWithSingleValueServiceEchoRequest {
  EnumWithSingleValue value = 1;
}

message EnumWithSingleValueServiceEchoResponse {}