Files
threshold/internal/proto/local/controller/api/v1/error.proto
T
Jeff Mitchell f36f25a23b Add json_name fields to proto for complex names (#27)
This was generating fine before but it makes it explicit in the proto
and it avoids weirdness where the protobuf tag will say a name is
something like requestId where the json tag says it's request_id. This
way they line up.

One thing not honoring this properly is TraceId. I don't know why the
JSON tag being generated doesn't match even when explicitly set here.
For now I'm just manually fixing it.
2020-05-05 14:08:13 -04:00

27 lines
903 B
Protocol Buffer

syntax = "proto3";
package controller.api.v1;
option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api;api";
import "google/protobuf/wrappers.proto";
message ErrorDetails {
google.protobuf.StringValue trace_id = 1 [json_name="TraceId"];
google.protobuf.StringValue request_id = 2 [json_name="request_id"];
repeated string request_fields = 3 [json_name="request_fields"];
}
// Error is returned by the JSON API when an error occurs.
message Error {
// The HTTP Status code applicable to this error
google.protobuf.Int64Value status = 1;
// An application-specific error string
google.protobuf.StringValue code = 2;
// A human readable explanation specific to this occurrence of the error
google.protobuf.StringValue message = 3;
// Additional metadata regarding the error. Depending on the error
// different fields will be populated.
ErrorDetails details = 4;
}