From b4a74304d462e1c0dea913c879a7435af91b6b87 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Fri, 29 May 2020 01:16:11 +0200 Subject: [PATCH] Move header schemas to a dedicated namespace to avoid conflicting with JSON schemas --- openapi3/reflect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi3/reflect.go b/openapi3/reflect.go index 32f41ed..fe58c7b 100644 --- a/openapi3/reflect.go +++ b/openapi3/reflect.go @@ -225,7 +225,7 @@ func (r *Reflector) parseResponseHeader(output interface{}) (map[string]HeaderOr res := make(map[string]HeaderOrRef) _, err := r.Reflect(output, - jsonschema.DefinitionsPrefix("#/components/schemas/"), + jsonschema.DefinitionsPrefix("#/components/schemas/header"), jsonschema.CollectDefinitions(r.collectDefinition), jsonschema.PropertyNameTag("header"), jsonschema.InterceptProperty(func(name string, field reflect.StructField, propertySchema *jsonschema.Schema) error {