GenerateTypeDefinitionWithName produces the JSON schema corresponding to the given type with provided type name.
(api *expr.APIExpr, ut *expr.UserTypeExpr, typeName string)
| 295 | // GenerateTypeDefinitionWithName produces the JSON schema corresponding to the given |
| 296 | // type with provided type name. |
| 297 | func 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. |
| 309 | func TypeSchema(api *expr.APIExpr, t expr.DataType) *Schema { |
no test coverage detected