Skip to content

Commit d6d182c

Browse files
committed
fix: remove the unnecessary copy loop
Signed-off-by: saltbo <[email protected]>
1 parent bf41aec commit d6d182c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

openapi2conv/openapi2_conv.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -483,14 +483,8 @@ func ToV3SchemaRef(schema *openapi2.SchemaRef) *openapi3.SchemaRef {
483483
}
484484
}
485485

486-
// Copy schema.Value.Extensions to avoid modifying the original
487-
schemaExtensions := make(map[string]interface{})
488-
for k, v := range schema.Value.Extensions {
489-
schemaExtensions[k] = v
490-
}
491-
492486
v3Schema := &openapi3.Schema{
493-
Extensions: schemaExtensions,
487+
Extensions: schema.Value.Extensions,
494488
Type: schema.Value.Type,
495489
Title: schema.Value.Title,
496490
Format: schema.Value.Format,

0 commit comments

Comments
 (0)