(t reflect.Type)
| 322 | } |
| 323 | |
| 324 | func modelFromType(t reflect.Type) Model { |
| 325 | m := Model{ |
| 326 | Type: t, |
| 327 | } |
| 328 | if sm, ok := reflect.New(t).Interface().(CustomSchemaApplier); ok { |
| 329 | m.s = sm.ApplyCustomSchema |
| 330 | } |
| 331 | return m |
| 332 | } |
| 333 | |
| 334 | // CustomSchemaApplier is a type that customises its OpenAPI schema. |
| 335 | type CustomSchemaApplier interface { |