From e1ecf112e53d01ccd5be05901c06318d5b4ed0ec Mon Sep 17 00:00:00 2001 From: Christoph Petrausch Date: Fri, 27 Jan 2023 11:28:00 +0100 Subject: [PATCH] fix: Use helper function to detect general JSON responses With out this fix, there are no responses generated if for example the response type is 'application/vnd.api+json' --- pkg/codegen/operations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/codegen/operations.go b/pkg/codegen/operations.go index 314e89462d..7c464daff7 100644 --- a/pkg/codegen/operations.go +++ b/pkg/codegen/operations.go @@ -293,7 +293,7 @@ func (o *OperationDefinition) GetResponseTypeDefinitions() ([]ResponseTypeDefini var typeName string switch { - case StringInArray(contentTypeName, contentTypesJSON): + case StringInArray(contentTypeName, contentTypesJSON) || util.IsMediaTypeJson(contentTypeName): typeName = fmt.Sprintf("JSON%s", ToCamelCase(responseName)) // YAML: case StringInArray(contentTypeName, contentTypesYAML):