MCPcopy Create free account
hub / github.com/goadesign/goa / validateAdditionalProperties

Function validateAdditionalProperties

http/codegen/openapi/v3/types_test.go:403–417  ·  view source on GitHub ↗
(t *testing.T, ctx string, addProps any, types map[string]*openapi.Schema, expected *additionalPropsType, prefix string)

Source from the content-addressed store, hash-verified

401}
402
403func validateAdditionalProperties(t *testing.T, ctx string, addProps any, types map[string]*openapi.Schema, expected *additionalPropsType, prefix string) {
404 if addProps == nil {
405 t.Errorf("%s: %sexpected additionalProperties to be set", ctx, prefix)
406 return
407 }
408
409 // Check if additionalProperties is a schema
410 schema, ok := addProps.(*openapi.Schema)
411 if !ok {
412 t.Errorf("%s: %sexpected additionalProperties to be schema, got %T", ctx, prefix, addProps)
413 return
414 }
415
416 validateAdditionalPropsSchema(t, ctx, schema, types, expected, prefix+"additionalProperties: ")
417}
418
419func validateAdditionalPropsSchema(t *testing.T, ctx string, schema *openapi.Schema, types map[string]*openapi.Schema, expected *additionalPropsType, prefix string) {
420 // Handle reference case

Callers 1

matchesSchemaWithPrefixFunction · 0.85

Calls 1

Tested by

no test coverage detected