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

Function GenerateResultTypeDefinition

http/codegen/openapi/json_schema.go:279–287  ·  view source on GitHub ↗

GenerateResultTypeDefinition produces the JSON schema corresponding to the given media type and given view.

(api *expr.APIExpr, mt *expr.ResultTypeExpr, view string)

Source from the content-addressed store, hash-verified

277// GenerateResultTypeDefinition produces the JSON schema corresponding to the
278// given media type and given view.
279func GenerateResultTypeDefinition(api *expr.APIExpr, mt *expr.ResultTypeExpr, view string) {
280 if _, ok := Definitions[mt.TypeName]; ok {
281 return
282 }
283 s := NewSchema()
284 s.Title = fmt.Sprintf("Mediatype identifier: %s", mt.Identifier)
285 Definitions[mt.TypeName] = s
286 buildResultTypeSchema(api, mt, view, s)
287}
288
289// GenerateTypeDefinition produces the JSON schema corresponding to the given
290// type.

Callers 1

ResultTypeRefWithPrefixFunction · 0.85

Calls 2

NewSchemaFunction · 0.85
buildResultTypeSchemaFunction · 0.85

Tested by

no test coverage detected