From dba14f5ac6a85e3074f2bf0c437836ed3bab9a86 Mon Sep 17 00:00:00 2001 From: QP Hou Date: Sun, 26 Jul 2020 00:36:19 -0700 Subject: [PATCH] [Go] support problem details HTTP API (#6793) Based on https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00, the content-type would be `application/problem+json` --- modules/openapi-generator/src/main/resources/go/client.mustache | 2 +- samples/client/petstore/go/go-petstore-withXml/client.go | 2 +- samples/client/petstore/go/go-petstore/client.go | 2 +- samples/openapi3/client/petstore/go/go-petstore/client.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index f760f337113..8dcefae5f86 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -32,7 +32,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go index 6fffa78f8ff..00f4296fa6f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ b/samples/client/petstore/go/go-petstore-withXml/client.go @@ -37,7 +37,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 19297c80fb8..769e38acab3 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -36,7 +36,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index c33a4967d82..838b6e9d0e0 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -36,7 +36,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) )