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

Function GenerateTypeDefinitionWithName

http/codegen/openapi/json_schema.go:297–306  ·  view source on GitHub ↗

GenerateTypeDefinitionWithName produces the JSON schema corresponding to the given type with provided type name.

(api *expr.APIExpr, ut *expr.UserTypeExpr, typeName string)

Source from the content-addressed store, hash-verified

295// GenerateTypeDefinitionWithName produces the JSON schema corresponding to the given
296// type with provided type name.
297func GenerateTypeDefinitionWithName(api *expr.APIExpr, ut *expr.UserTypeExpr, typeName string) {
298 if _, ok := Definitions[typeName]; ok {
299 return
300 }
301 s := NewSchema()
302
303 s.Title = typeName
304 Definitions[typeName] = s
305 buildAttributeSchema(api, s, ut.AttributeExpr)
306}
307
308// TypeSchema produces the JSON schema corresponding to the given data type.
309func TypeSchema(api *expr.APIExpr, t expr.DataType) *Schema {

Callers 2

TypeRefWithPrefixFunction · 0.85
GenerateTypeDefinitionFunction · 0.85

Calls 2

NewSchemaFunction · 0.85
buildAttributeSchemaFunction · 0.85

Tested by

no test coverage detected