(t *testing.T, ctx string, addProps any, types map[string]*openapi.Schema, expected *additionalPropsType, prefix string)
| 401 | } |
| 402 | |
| 403 | func 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 | |
| 419 | func validateAdditionalPropsSchema(t *testing.T, ctx string, schema *openapi.Schema, types map[string]*openapi.Schema, expected *additionalPropsType, prefix string) { |
| 420 | // Handle reference case |
no test coverage detected