{"record":{"id":"51bef5e98e432137","repo":"grpc-ecosystem/grpc-gateway","slug":"the-provided-default-value-q-does-not-match-provi","errorCode":null,"errorMessage":"the provided default value %q does not match provider type %q, or is not properly quoted with escaped quotations","messagePattern":"the provided default value %q does not match provider type %q, or is not properly quoted with escaped quotations","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"protoc-gen-openapiv2/internal/genopenapi/template.go","lineNumber":2758,"sourceCode":"\t\t\t\"int16\",\n\t\t\t\"int32\",\n\t\t\t\"int64\",\n\t\t\t\"\":\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"the provided format %q is not a valid extension of the type %q\", format, headerType)\n\t\t}\n\tcase \"boolean\":\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"the provided header type %q is not supported\", headerType)\n}\n\nfunc validateDefaultValueTypeAndFormat(headerType string, defaultValue string, format string) error {\n\tswitch headerType {\n\tcase \"string\":\n\t\tif !isQuotedString(defaultValue) {\n\t\t\treturn fmt.Errorf(\"the provided default value %q does not match provider type %q, or is not properly quoted with escaped quotations\", defaultValue, headerType)\n\t\t}\n\t\tswitch format {\n\t\tcase \"date-time\":\n\t\t\tunquoteTime := strings.Trim(defaultValue, `\"`)\n\t\t\tif _, err := time.Parse(time.RFC3339, unquoteTime); err != nil {\n\t\t\t\treturn fmt.Errorf(\"the provided default value %q is not a valid RFC3339 date-time string\", defaultValue)\n\t\t\t}\n\t\tcase \"date\":\n\t\t\tconst layoutRFC3339Date = \"2006-01-02\"\n\t\t\tunquoteDate := strings.Trim(defaultValue, `\"`)\n\t\t\tif _, err := time.Parse(layoutRFC3339Date, unquoteDate); err != nil {\n\t\t\t\treturn fmt.Errorf(\"the provided default value %q is not a valid RFC3339 date-time string\", defaultValue)\n\t\t\t}\n\t\t}\n\tcase \"number\":\n\t\tif err := isJSONNumber(defaultValue, headerType); err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":2740,"sourceCodeEnd":2776,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/protoc-gen-openapiv2/internal/genopenapi/template.go#L2740-L2776","documentation":"Validation error from validateDefaultValueTypeAndFormat for string-typed header parameters: the default value is not a properly quoted JSON string (isQuotedString failed) — it may be unquoted, single-quoted, or contain unescaped quotes. The offending inputs are the default value and its declared type from the openapiv2 options.","triggerScenarios":"Thrown at protoc-gen-openapiv2/internal/genopenapi/template.go:2758 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wrap the default value in escaped double quotes, e.g. \"\\\"value\\\"\".","Escape any inner double quotes in the value."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a58a4436a376a4bcc7d8f10c4d4f919a8438bba9","analyzedAt":"2026-09-02T10:28:31.537Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}