MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / MergeSchemas

Function MergeSchemas

pkg/codegen/merge_schemas.go:15–22  ·  view source on GitHub ↗

MergeSchemas merges all the fields in the schemas supplied into one giant schema. The idea is that we merge all fields together into one schema.

(allOf []*openapi3.SchemaRef, path []string)

Source from the content-addressed store, hash-verified

13// MergeSchemas merges all the fields in the schemas supplied into one giant schema.
14// The idea is that we merge all fields together into one schema.
15func MergeSchemas(allOf []*openapi3.SchemaRef, path []string) (Schema, error) {
16 // If someone asked for the old way, for backward compatibility, return the
17 // old style result.
18 if globalState.options.Compatibility.OldMergeSchemas {
19 return mergeSchemasV1(allOf, path)
20 }
21 return mergeSchemas(allOf, path)
22}
23
24func mergeSchemas(allOf []*openapi3.SchemaRef, path []string) (Schema, error) {
25 n := len(allOf)

Callers 1

GenerateGoSchemaFunction · 0.85

Calls 2

mergeSchemasV1Function · 0.85
mergeSchemasFunction · 0.85

Tested by

no test coverage detected