MCPcopy Create free account
hub / github.com/a-h/rest / modelFromType

Function modelFromType

api.go:324–332  ·  view source on GitHub ↗
(t reflect.Type)

Source from the content-addressed store, hash-verified

322}
323
324func 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.
335type CustomSchemaApplier interface {

Callers 1

RegisterModelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected