diff --git a/internal/converter/components.go b/internal/converter/components.go index dd00658..4f3f719 100644 --- a/internal/converter/components.go +++ b/internal/converter/components.go @@ -36,6 +36,7 @@ func fileToComponents(opts options.Options, fd protoreflect.FileDescriptor) (*hi components.Schemas = stateToSchema(st) hasGetRequests := false + hasMethods := false // Add requestBodies and responses for methods services := fd.Services() @@ -48,23 +49,10 @@ func fileToComponents(opts options.Options, fd protoreflect.FileDescriptor) (*hi if hasGet { hasGetRequests = true } + hasMethods = true } } - components.Schemas.Set("connect-protocol-version", base.CreateSchemaProxy(&base.Schema{ - Title: "Connect-Protocol-Version", - Description: "Define the version of the Connect protocol", - Type: []string{"number"}, - Enum: []*yaml.Node{utils.CreateIntNode("1")}, - Const: utils.CreateIntNode("1"), - })) - - components.Schemas.Set("connect-timeout-header", base.CreateSchemaProxy(&base.Schema{ - Title: "Connect-Timeout-Ms", - Description: "Define the timeout, in ms", - Type: []string{"number"}, - })) - if hasGetRequests { components.Schemas.Set("encoding", base.CreateSchemaProxy(&base.Schema{ Title: "encoding", @@ -91,43 +79,58 @@ func fileToComponents(opts options.Options, fd protoreflect.FileDescriptor) (*hi }, })) } - connectErrorProps := orderedmap.New[string, *base.SchemaProxy]() - connectErrorProps.Set("code", base.CreateSchemaProxy(&base.Schema{ - Description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", - Type: []string{"string"}, - Examples: []*yaml.Node{utils.CreateStringNode("CodeNotFound")}, - Enum: []*yaml.Node{ - utils.CreateStringNode("CodeCanceled"), - utils.CreateStringNode("CodeUnknown"), - utils.CreateStringNode("CodeInvalidArgument"), - utils.CreateStringNode("CodeDeadlineExceeded"), - utils.CreateStringNode("CodeNotFound"), - utils.CreateStringNode("CodeAlreadyExists"), - utils.CreateStringNode("CodePermissionDenied"), - utils.CreateStringNode("CodeResourceExhausted"), - utils.CreateStringNode("CodeFailedPrecondition"), - utils.CreateStringNode("CodeAborted"), - utils.CreateStringNode("CodeOutOfRange"), - utils.CreateStringNode("CodeInternal"), - utils.CreateStringNode("CodeUnavailable"), - utils.CreateStringNode("CodeDataLoss"), - utils.CreateStringNode("CodeUnauthenticated"), - }, - })) - connectErrorProps.Set("message", base.CreateSchemaProxy(&base.Schema{ - Description: "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", - Type: []string{"string"}, - })) - connectErrorProps.Set("detail", base.CreateSchemaProxyRef("#/components/schemas/google.protobuf.Any")) - components.Schemas.Set("connect.error", base.CreateSchemaProxy(&base.Schema{ - Title: "Connect Error", - Description: `Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation`, - Properties: connectErrorProps, - Type: []string{"object"}, - AdditionalProperties: &base.DynamicValue[*base.SchemaProxy, bool]{N: 1, B: true}, - })) - anyPair := util.NewGoogleAny() - components.Schemas.Set(anyPair.ID, base.CreateSchemaProxy(anyPair.Schema)) + if hasMethods { + components.Schemas.Set("connect-protocol-version", base.CreateSchemaProxy(&base.Schema{ + Title: "Connect-Protocol-Version", + Description: "Define the version of the Connect protocol", + Type: []string{"number"}, + Enum: []*yaml.Node{utils.CreateIntNode("1")}, + Const: utils.CreateIntNode("1"), + })) + + components.Schemas.Set("connect-timeout-header", base.CreateSchemaProxy(&base.Schema{ + Title: "Connect-Timeout-Ms", + Description: "Define the timeout, in ms", + Type: []string{"number"}, + })) + connectErrorProps := orderedmap.New[string, *base.SchemaProxy]() + connectErrorProps.Set("code", base.CreateSchemaProxy(&base.Schema{ + Description: "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", + Type: []string{"string"}, + Examples: []*yaml.Node{utils.CreateStringNode("CodeNotFound")}, + Enum: []*yaml.Node{ + utils.CreateStringNode("CodeCanceled"), + utils.CreateStringNode("CodeUnknown"), + utils.CreateStringNode("CodeInvalidArgument"), + utils.CreateStringNode("CodeDeadlineExceeded"), + utils.CreateStringNode("CodeNotFound"), + utils.CreateStringNode("CodeAlreadyExists"), + utils.CreateStringNode("CodePermissionDenied"), + utils.CreateStringNode("CodeResourceExhausted"), + utils.CreateStringNode("CodeFailedPrecondition"), + utils.CreateStringNode("CodeAborted"), + utils.CreateStringNode("CodeOutOfRange"), + utils.CreateStringNode("CodeInternal"), + utils.CreateStringNode("CodeUnavailable"), + utils.CreateStringNode("CodeDataLoss"), + utils.CreateStringNode("CodeUnauthenticated"), + }, + })) + connectErrorProps.Set("message", base.CreateSchemaProxy(&base.Schema{ + Description: "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + Type: []string{"string"}, + })) + connectErrorProps.Set("detail", base.CreateSchemaProxyRef("#/components/schemas/google.protobuf.Any")) + components.Schemas.Set("connect.error", base.CreateSchemaProxy(&base.Schema{ + Title: "Connect Error", + Description: `Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation`, + Properties: connectErrorProps, + Type: []string{"object"}, + AdditionalProperties: &base.DynamicValue[*base.SchemaProxy, bool]{N: 1, B: true}, + })) + anyPair := util.NewGoogleAny() + components.Schemas.Set(anyPair.ID, base.CreateSchemaProxy(anyPair.Schema)) + } return components, nil } diff --git a/internal/converter/converter.go b/internal/converter/converter.go index 4ab3495..ebd7fd9 100644 --- a/internal/converter/converter.go +++ b/internal/converter/converter.go @@ -181,11 +181,6 @@ func ConvertWithOptions(req *pluginpb.CodeGeneratorRequest, opts options.Options } func specToFile(opts options.Options, spec *v3.Document) (string, error) { - if opts.TrimUnusedTypes { - if err := trimUnusedTypes(spec); err != nil { - return "", err - } - } switch opts.Format { case "yaml": return string(spec.RenderWithIndention(2)), nil @@ -200,32 +195,6 @@ func specToFile(opts options.Options, spec *v3.Document) (string, error) { } } -func trimUnusedTypes(spec *v3.Document) error { - slog.Debug("trimming unused types") - b, err := spec.Render() - if err != nil { - return err - } - doc, err := libopenapi.NewDocument(b) - if err != nil { - return err - } - model, errs := doc.BuildV3Model() - if errs != nil { - return errors.Join(errs...) - } - model.Index.BuildIndex() - references := model.Model.Rolodex.GetRootIndex().GetAllReferences() - for pair := spec.Components.Schemas.First(); pair != nil; pair = pair.Next() { - ref := fmt.Sprintf("#/components/schemas/%s", pair.Key()) - if _, ok := references[ref]; !ok { - slog.Debug("trimming unused type", "name", pair.Key()) - spec.Components.Schemas.Delete(pair.Key()) - } - } - return nil -} - func appendToSpec(opts options.Options, spec *v3.Document, fd protoreflect.FileDescriptor) error { gnostic.SpecWithFileAnnotations(spec, fd) components, err := fileToComponents(opts, fd) diff --git a/internal/converter/schema.go b/internal/converter/schema.go index d6d443a..5a33756 100644 --- a/internal/converter/schema.go +++ b/internal/converter/schema.go @@ -34,16 +34,19 @@ func NewState(opts options.Options) *State { func (st *State) CollectFile(tt protoreflect.FileDescriptor) { st.CurrentFile = tt - // Files can have enums - enums := tt.Enums() - for i := 0; i < enums.Len(); i++ { - st.CollectEnum(enums.Get(i)) - } + // Only collect types from the root if TrimUnusedTypes is off + if !st.Opts.TrimUnusedTypes { + // Files can have enums + enums := tt.Enums() + for i := 0; i < enums.Len(); i++ { + st.CollectEnum(enums.Get(i)) + } - // Files can have messages - messages := tt.Messages() - for i := 0; i < messages.Len(); i++ { - st.CollectMessage(messages.Get(i)) + // Files can have messages + messages := tt.Messages() + for i := 0; i < messages.Len(); i++ { + st.CollectMessage(messages.Get(i)) + } } // Also make sure to pick up messages referenced in service methods diff --git a/internal/converter/testdata/fileset.binpb b/internal/converter/testdata/fileset.binpb index a85806d..245996e 100644 Binary files a/internal/converter/testdata/fileset.binpb and b/internal/converter/testdata/fileset.binpb differ diff --git a/internal/converter/testdata/proto_names/output/proto_names.openapi.json b/internal/converter/testdata/proto_names/output/proto_names.openapi.json index bc1eeb9..1959084 100644 --- a/internal/converter/testdata/proto_names/output/proto_names.openapi.json +++ b/internal/converter/testdata/proto_names/output/proto_names.openapi.json @@ -32,77 +32,6 @@ }, "title": "Message", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/proto_names/output/proto_names.openapi.yaml b/internal/converter/testdata/proto_names/output/proto_names.openapi.yaml index 135c555..be73749 100644 --- a/internal/converter/testdata/proto_names/output/proto_names.openapi.yaml +++ b/internal/converter/testdata/proto_names/output/proto_names.openapi.yaml @@ -24,60 +24,4 @@ components: title: UPPER_SNAKE_CASE title: Message additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/array_of_enums.openapi.json b/internal/converter/testdata/standard/output/array_of_enums.openapi.json index 89dee80..eac9fd9 100644 --- a/internal/converter/testdata/standard/output/array_of_enums.openapi.json +++ b/internal/converter/testdata/standard/output/array_of_enums.openapi.json @@ -31,77 +31,6 @@ }, "title": "ArrayOfEnums", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/array_of_enums.openapi.yaml b/internal/converter/testdata/standard/output/array_of_enums.openapi.yaml index f781a29..8a6387f 100644 --- a/internal/converter/testdata/standard/output/array_of_enums.openapi.yaml +++ b/internal/converter/testdata/standard/output/array_of_enums.openapi.yaml @@ -23,60 +23,4 @@ components: title: stuff title: ArrayOfEnums additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/array_of_messages.openapi.json b/internal/converter/testdata/standard/output/array_of_messages.openapi.json index c9a64f0..8e47a9c 100644 --- a/internal/converter/testdata/standard/output/array_of_messages.openapi.json +++ b/internal/converter/testdata/standard/output/array_of_messages.openapi.json @@ -34,77 +34,6 @@ }, "title": "Thing", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/array_of_messages.openapi.yaml b/internal/converter/testdata/standard/output/array_of_messages.openapi.yaml index 2e8c1bb..7ddc7e2 100644 --- a/internal/converter/testdata/standard/output/array_of_messages.openapi.yaml +++ b/internal/converter/testdata/standard/output/array_of_messages.openapi.yaml @@ -25,60 +25,4 @@ components: title: name title: Thing additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/editions_2023.openapi.json b/internal/converter/testdata/standard/output/editions_2023.openapi.json index 18bdd50..45e1620 100644 --- a/internal/converter/testdata/standard/output/editions_2023.openapi.json +++ b/internal/converter/testdata/standard/output/editions_2023.openapi.json @@ -49,77 +49,6 @@ }, "title": "Person", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/editions_2023.openapi.yaml b/internal/converter/testdata/standard/output/editions_2023.openapi.yaml index ce47f2c..e5a0d6e 100644 --- a/internal/converter/testdata/standard/output/editions_2023.openapi.yaml +++ b/internal/converter/testdata/standard/output/editions_2023.openapi.yaml @@ -34,60 +34,4 @@ components: - $ref: '#/components/schemas/editions.Person.Employment' title: Person additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/gnostic.openapi.json b/internal/converter/testdata/standard/output/gnostic.openapi.json index 85f1add..8003fa8 100644 --- a/internal/converter/testdata/standard/output/gnostic.openapi.json +++ b/internal/converter/testdata/standard/output/gnostic.openapi.json @@ -237,20 +237,6 @@ "additionalProperties": false, "description": "Custom description for a message" }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, "encoding": { "title": "encoding", "enum": [ @@ -273,6 +259,20 @@ ], "description": "Which compression algorithm to use for this request" }, + "connect-protocol-version": { + "type": "number", + "title": "Connect-Protocol-Version", + "enum": [ + 1 + ], + "description": "Define the version of the Connect protocol", + "const": 1 + }, + "connect-timeout-header": { + "type": "number", + "title": "Connect-Timeout-Ms", + "description": "Define the timeout, in ms" + }, "connect.error": { "type": "object", "properties": { diff --git a/internal/converter/testdata/standard/output/gnostic.openapi.yaml b/internal/converter/testdata/standard/output/gnostic.openapi.yaml index e073392..317eff2 100644 --- a/internal/converter/testdata/standard/output/gnostic.openapi.yaml +++ b/internal/converter/testdata/standard/output/gnostic.openapi.yaml @@ -151,17 +151,6 @@ components: title: Custom title for a message additionalProperties: false description: Custom description for a message - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms encoding: title: encoding enum: @@ -179,6 +168,17 @@ components: - gzip - br description: Which compression algorithm to use for this request + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms connect.error: type: object properties: diff --git a/internal/converter/testdata/standard/output/googleapi.openapi.json b/internal/converter/testdata/standard/output/googleapi.openapi.json index 438251a..8daee1c 100644 --- a/internal/converter/testdata/standard/output/googleapi.openapi.json +++ b/internal/converter/testdata/standard/output/googleapi.openapi.json @@ -42,20 +42,6 @@ "type": "object", "description": "A generic empty message that you can re-use to avoid defining duplicated\n empty messages in your APIs. A typical example is to use it as the request\n or the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }" }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, "encoding": { "title": "encoding", "enum": [ @@ -78,6 +64,20 @@ ], "description": "Which compression algorithm to use for this request" }, + "connect-protocol-version": { + "type": "number", + "title": "Connect-Protocol-Version", + "enum": [ + 1 + ], + "description": "Define the version of the Connect protocol", + "const": 1 + }, + "connect-timeout-header": { + "type": "number", + "title": "Connect-Timeout-Ms", + "description": "Define the timeout, in ms" + }, "connect.error": { "type": "object", "properties": { diff --git a/internal/converter/testdata/standard/output/googleapi.openapi.yaml b/internal/converter/testdata/standard/output/googleapi.openapi.yaml index dfb659c..9f0cc2e 100644 --- a/internal/converter/testdata/standard/output/googleapi.openapi.yaml +++ b/internal/converter/testdata/standard/output/googleapi.openapi.yaml @@ -33,17 +33,6 @@ components: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms encoding: title: encoding enum: @@ -61,6 +50,17 @@ components: - gzip - br description: Which compression algorithm to use for this request + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms connect.error: type: object properties: diff --git a/internal/converter/testdata/standard/output/helloworld.openapi.json b/internal/converter/testdata/standard/output/helloworld.openapi.json index 6eb0ca5..0551aad 100644 --- a/internal/converter/testdata/standard/output/helloworld.openapi.json +++ b/internal/converter/testdata/standard/output/helloworld.openapi.json @@ -251,20 +251,6 @@ "additionalProperties": false, "description": "The request message containing the user's name." }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, "encoding": { "title": "encoding", "enum": [ @@ -287,6 +273,20 @@ ], "description": "Which compression algorithm to use for this request" }, + "connect-protocol-version": { + "type": "number", + "title": "Connect-Protocol-Version", + "enum": [ + 1 + ], + "description": "Define the version of the Connect protocol", + "const": 1 + }, + "connect-timeout-header": { + "type": "number", + "title": "Connect-Timeout-Ms", + "description": "Define the timeout, in ms" + }, "connect.error": { "type": "object", "properties": { diff --git a/internal/converter/testdata/standard/output/helloworld.openapi.yaml b/internal/converter/testdata/standard/output/helloworld.openapi.yaml index 0ca8bd8..c1ef506 100644 --- a/internal/converter/testdata/standard/output/helloworld.openapi.yaml +++ b/internal/converter/testdata/standard/output/helloworld.openapi.yaml @@ -153,17 +153,6 @@ components: title: HelloRequest additionalProperties: false description: The request message containing the user's name. - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms encoding: title: encoding enum: @@ -181,6 +170,17 @@ components: - gzip - br description: Which compression algorithm to use for this request + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms connect.error: type: object properties: diff --git a/internal/converter/testdata/standard/output/json_name.openapi.json b/internal/converter/testdata/standard/output/json_name.openapi.json index d75d753..33d5f44 100644 --- a/internal/converter/testdata/standard/output/json_name.openapi.json +++ b/internal/converter/testdata/standard/output/json_name.openapi.json @@ -31,77 +31,6 @@ }, "title": "Message", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/json_name.openapi.yaml b/internal/converter/testdata/standard/output/json_name.openapi.yaml index 03906af..834c008 100644 --- a/internal/converter/testdata/standard/output/json_name.openapi.yaml +++ b/internal/converter/testdata/standard/output/json_name.openapi.yaml @@ -23,60 +23,4 @@ components: title: stuff title: Message additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/petstore.openapi.json b/internal/converter/testdata/standard/output/petstore.openapi.json index fa9e3b0..9b90fa3 100644 --- a/internal/converter/testdata/standard/output/petstore.openapi.json +++ b/internal/converter/testdata/standard/output/petstore.openapi.json @@ -707,20 +707,6 @@ "title": "UploadFileReq", "additionalProperties": false }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, "encoding": { "title": "encoding", "enum": [ @@ -743,6 +729,20 @@ ], "description": "Which compression algorithm to use for this request" }, + "connect-protocol-version": { + "type": "number", + "title": "Connect-Protocol-Version", + "enum": [ + 1 + ], + "description": "Define the version of the Connect protocol", + "const": 1 + }, + "connect-timeout-header": { + "type": "number", + "title": "Connect-Timeout-Ms", + "description": "Define the timeout, in ms" + }, "connect.error": { "type": "object", "properties": { diff --git a/internal/converter/testdata/standard/output/petstore.openapi.yaml b/internal/converter/testdata/standard/output/petstore.openapi.yaml index 17fc06a..bc733a6 100644 --- a/internal/converter/testdata/standard/output/petstore.openapi.yaml +++ b/internal/converter/testdata/standard/output/petstore.openapi.yaml @@ -458,17 +458,6 @@ components: title: file title: UploadFileReq additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms encoding: title: encoding enum: @@ -486,6 +475,17 @@ components: - gzip - br description: Which compression algorithm to use for this request + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms connect.error: type: object properties: diff --git a/internal/converter/testdata/standard/output/protovalidate-and-googleapi.openapi.json b/internal/converter/testdata/standard/output/protovalidate-and-googleapi.openapi.json index eef9f27..9d4d6ae 100644 --- a/internal/converter/testdata/standard/output/protovalidate-and-googleapi.openapi.json +++ b/internal/converter/testdata/standard/output/protovalidate-and-googleapi.openapi.json @@ -109,20 +109,6 @@ ], "additionalProperties": false }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, "encoding": { "title": "encoding", "enum": [ @@ -145,6 +131,20 @@ ], "description": "Which compression algorithm to use for this request" }, + "connect-protocol-version": { + "type": "number", + "title": "Connect-Protocol-Version", + "enum": [ + 1 + ], + "description": "Define the version of the Connect protocol", + "const": 1 + }, + "connect-timeout-header": { + "type": "number", + "title": "Connect-Timeout-Ms", + "description": "Define the timeout, in ms" + }, "connect.error": { "type": "object", "properties": { diff --git a/internal/converter/testdata/standard/output/protovalidate-and-googleapi.openapi.yaml b/internal/converter/testdata/standard/output/protovalidate-and-googleapi.openapi.yaml index b5ce71f..fe3f57a 100644 --- a/internal/converter/testdata/standard/output/protovalidate-and-googleapi.openapi.yaml +++ b/internal/converter/testdata/standard/output/protovalidate-and-googleapi.openapi.yaml @@ -63,17 +63,6 @@ components: required: - name additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms encoding: title: encoding enum: @@ -91,6 +80,17 @@ components: - gzip - br description: Which compression algorithm to use for this request + connect-protocol-version: + type: number + title: Connect-Protocol-Version + enum: + - 1 + description: Define the version of the Connect protocol + const: 1 + connect-timeout-header: + type: number + title: Connect-Timeout-Ms + description: Define the timeout, in ms connect.error: type: object properties: diff --git a/internal/converter/testdata/standard/output/protovalidate.custom.openapi.json b/internal/converter/testdata/standard/output/protovalidate.custom.openapi.json index 5fb161a..ccb7e49 100644 --- a/internal/converter/testdata/standard/output/protovalidate.custom.openapi.json +++ b/internal/converter/testdata/standard/output/protovalidate.custom.openapi.json @@ -18,77 +18,6 @@ }, "title": "User", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/protovalidate.custom.openapi.yaml b/internal/converter/testdata/standard/output/protovalidate.custom.openapi.yaml index 1c26a8a..88f27c4 100644 --- a/internal/converter/testdata/standard/output/protovalidate.custom.openapi.yaml +++ b/internal/converter/testdata/standard/output/protovalidate.custom.openapi.yaml @@ -19,60 +19,4 @@ components: title: User additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/protovalidate.fields.openapi.json b/internal/converter/testdata/standard/output/protovalidate.fields.openapi.json index 57d0938..6e823a9 100644 --- a/internal/converter/testdata/standard/output/protovalidate.fields.openapi.json +++ b/internal/converter/testdata/standard/output/protovalidate.fields.openapi.json @@ -16,77 +16,6 @@ }, "title": "User", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/protovalidate.fields.openapi.yaml b/internal/converter/testdata/standard/output/protovalidate.fields.openapi.yaml index e8d26e0..2b76678 100644 --- a/internal/converter/testdata/standard/output/protovalidate.fields.openapi.yaml +++ b/internal/converter/testdata/standard/output/protovalidate.fields.openapi.yaml @@ -13,60 +13,4 @@ components: format: int32 title: User additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/protovalidate.message.openapi.json b/internal/converter/testdata/standard/output/protovalidate.message.openapi.json index 503269f..085a106 100644 --- a/internal/converter/testdata/standard/output/protovalidate.message.openapi.json +++ b/internal/converter/testdata/standard/output/protovalidate.message.openapi.json @@ -37,77 +37,6 @@ "title": "Allocation", "additionalProperties": false, "description": "Used should be less or equal to the total size:\n```\nthis.used \u003c= this.total_size\n```\n\n" - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/protovalidate.message.openapi.yaml b/internal/converter/testdata/standard/output/protovalidate.message.openapi.yaml index 2c334ae..26ff1e4 100644 --- a/internal/converter/testdata/standard/output/protovalidate.message.openapi.yaml +++ b/internal/converter/testdata/standard/output/protovalidate.message.openapi.yaml @@ -28,60 +28,4 @@ components: this.used <= this.total_size ``` - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/protovalidate.numbers.openapi.json b/internal/converter/testdata/standard/output/protovalidate.numbers.openapi.json index ebfedd9..d733399 100644 --- a/internal/converter/testdata/standard/output/protovalidate.numbers.openapi.json +++ b/internal/converter/testdata/standard/output/protovalidate.numbers.openapi.json @@ -3398,77 +3398,6 @@ }, "title": "UInt64NotIn", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/protovalidate.numbers.openapi.yaml b/internal/converter/testdata/standard/output/protovalidate.numbers.openapi.yaml index 1606a0d..d48aa0d 100644 --- a/internal/converter/testdata/standard/output/protovalidate.numbers.openapi.yaml +++ b/internal/converter/testdata/standard/output/protovalidate.numbers.openapi.yaml @@ -2313,60 +2313,4 @@ components: title: val title: UInt64NotIn additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/protovalidate.strings.openapi.json b/internal/converter/testdata/standard/output/protovalidate.strings.openapi.json index 3f21c91..d880c61 100644 --- a/internal/converter/testdata/standard/output/protovalidate.strings.openapi.json +++ b/internal/converter/testdata/standard/output/protovalidate.strings.openapi.json @@ -756,77 +756,6 @@ }, "title": "StringUUIDIgnore", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/protovalidate.strings.openapi.yaml b/internal/converter/testdata/standard/output/protovalidate.strings.openapi.yaml index fe4b47c..228564d 100644 --- a/internal/converter/testdata/standard/output/protovalidate.strings.openapi.yaml +++ b/internal/converter/testdata/standard/output/protovalidate.strings.openapi.yaml @@ -547,60 +547,4 @@ components: format: uuid title: StringUUIDIgnore additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/standard/output/test.openapi.json b/internal/converter/testdata/standard/output/test.openapi.json index cbab4ef..8637cc9 100644 --- a/internal/converter/testdata/standard/output/test.openapi.json +++ b/internal/converter/testdata/standard/output/test.openapi.json @@ -2784,77 +2784,6 @@ }, "title": "StringValueMapEntry", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/standard/output/test.openapi.yaml b/internal/converter/testdata/standard/output/test.openapi.yaml index a6bc635..f8ba0be 100644 --- a/internal/converter/testdata/standard/output/test.openapi.yaml +++ b/internal/converter/testdata/standard/output/test.openapi.yaml @@ -1994,60 +1994,4 @@ components: - $ref: '#/components/schemas/google.protobuf.StringValue' title: StringValueMapEntry additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: [] diff --git a/internal/converter/testdata/trim_unused_type/has_unused.proto b/internal/converter/testdata/trim_unused_type/has_unused.proto index 87959db..6720152 100644 --- a/internal/converter/testdata/trim_unused_type/has_unused.proto +++ b/internal/converter/testdata/trim_unused_type/has_unused.proto @@ -25,4 +25,19 @@ message UsedType { message Unused { string unused_field = 1; + UnusedChild unused_child = 2; + UnusedChild2 unused_child2 = 3; +} + +message UnusedChild { + string unused_child_field = 1; + UnusedChild3 unused_child3 = 2; +} + +message UnusedChild2 { + string unused_child_field = 1; +} + +message UnusedChild3 { + string unused_child_field = 1; } diff --git a/internal/converter/testdata/with_base/output/empty.openapi.json b/internal/converter/testdata/with_base/output/empty.openapi.json index 101f7d3..bfe500c 100644 --- a/internal/converter/testdata/with_base/output/empty.openapi.json +++ b/internal/converter/testdata/with_base/output/empty.openapi.json @@ -11,70 +11,6 @@ "scheme": "bearer", "bearerFormat": "JWT" } - }, - "schemas": { - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." - } } }, "security": [ diff --git a/internal/converter/testdata/with_base/output/empty.openapi.yaml b/internal/converter/testdata/with_base/output/empty.openapi.yaml index da94b35..60cab00 100644 --- a/internal/converter/testdata/with_base/output/empty.openapi.yaml +++ b/internal/converter/testdata/with_base/output/empty.openapi.yaml @@ -8,56 +8,6 @@ components: type: http scheme: bearer bearerFormat: JWT - schemas: - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: - bearerAuth: [] paths: {} diff --git a/internal/converter/testdata/with_proto_annotations/output/test.openapi.json b/internal/converter/testdata/with_proto_annotations/output/test.openapi.json index 268ec32..831499b 100644 --- a/internal/converter/testdata/with_proto_annotations/output/test.openapi.json +++ b/internal/converter/testdata/with_proto_annotations/output/test.openapi.json @@ -3020,77 +3020,6 @@ }, "title": "StringValueMapEntry", "additionalProperties": false - }, - "connect-protocol-version": { - "type": "number", - "title": "Connect-Protocol-Version", - "enum": [ - 1 - ], - "description": "Define the version of the Connect protocol", - "const": 1 - }, - "connect-timeout-header": { - "type": "number", - "title": "Connect-Timeout-Ms", - "description": "Define the timeout, in ms" - }, - "connect.error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "examples": [ - "CodeNotFound" - ], - "enum": [ - "CodeCanceled", - "CodeUnknown", - "CodeInvalidArgument", - "CodeDeadlineExceeded", - "CodeNotFound", - "CodeAlreadyExists", - "CodePermissionDenied", - "CodeResourceExhausted", - "CodeFailedPrecondition", - "CodeAborted", - "CodeOutOfRange", - "CodeInternal", - "CodeUnavailable", - "CodeDataLoss", - "CodeUnauthenticated" - ], - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "detail": { - "$ref": "#/components/schemas/google.protobuf.Any" - } - }, - "title": "Connect Error", - "additionalProperties": true, - "description": "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" - }, - "google.protobuf.Any": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "value": { - "type": "string", - "format": "binary" - }, - "debug": { - "type": "object", - "additionalProperties": true - } - }, - "additionalProperties": true, - "description": "Contains an arbitrary serialized message along with a @type that describes the type of the serialized message." } } }, diff --git a/internal/converter/testdata/with_proto_annotations/output/test.openapi.yaml b/internal/converter/testdata/with_proto_annotations/output/test.openapi.yaml index 8e3065d..8753c89 100644 --- a/internal/converter/testdata/with_proto_annotations/output/test.openapi.yaml +++ b/internal/converter/testdata/with_proto_annotations/output/test.openapi.yaml @@ -2230,60 +2230,4 @@ components: - $ref: '#/components/schemas/google.protobuf.StringValue' title: StringValueMapEntry additionalProperties: false - connect-protocol-version: - type: number - title: Connect-Protocol-Version - enum: - - 1 - description: Define the version of the Connect protocol - const: 1 - connect-timeout-header: - type: number - title: Connect-Timeout-Ms - description: Define the timeout, in ms - connect.error: - type: object - properties: - code: - type: string - examples: - - CodeNotFound - enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated - description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - message: - type: string - description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - detail: - $ref: '#/components/schemas/google.protobuf.Any' - title: Connect Error - additionalProperties: true - description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' - google.protobuf.Any: - type: object - properties: - type: - type: string - value: - type: string - format: binary - debug: - type: object - additionalProperties: true - additionalProperties: true - description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. security: []