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)
| 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. |
| 15 | func 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 | |
| 24 | func mergeSchemas(allOf []*openapi3.SchemaRef, path []string) (Schema, error) { |
| 25 | n := len(allOf) |
no test coverage detected