Skip to content

Commit 5b8f35f

Browse files
committed
Only $ref is present if especified
1 parent 3bfe517 commit 5b8f35f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

build.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,19 +247,19 @@ func makeComponentSchemasMap(schemas *Schemas) map[string]interface{} {
247247

248248
for _, s := range *schemas {
249249
scheme := make(map[string]interface{})
250-
scheme[keyType] = s.Type
251250

252251
if s.Ref != "" {
252+
scheme[keyType] = s.Type
253253
scheme[keyRef] = s.Ref
254+
schemesMap[s.Name] = scheme
255+
256+
if s.XML.Name != "" {
257+
scheme[keyXML] = s.XML
258+
}
259+
254260
} else {
255261
scheme[keyProperties] = makePropertiesMap(&s.Properties)
256262
}
257-
258-
if s.XML.Name != "" {
259-
scheme[keyXML] = s.XML
260-
}
261-
262-
schemesMap[s.Name] = scheme
263263
}
264264

265265
return schemesMap

0 commit comments

Comments
 (0)