GenerateResultTypeDefinition produces the JSON schema corresponding to the given media type and given view.
(api *expr.APIExpr, mt *expr.ResultTypeExpr, view string)
| 277 | // GenerateResultTypeDefinition produces the JSON schema corresponding to the |
| 278 | // given media type and given view. |
| 279 | func 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. |
no test coverage detected