buildResultTypeSchema initializes s as the JSON schema representing mt for the given view.
(api *expr.APIExpr, mt *expr.ResultTypeExpr, view string, s *Schema)
| 598 | // buildResultTypeSchema initializes s as the JSON schema representing mt for the |
| 599 | // given view. |
| 600 | func buildResultTypeSchema(api *expr.APIExpr, mt *expr.ResultTypeExpr, view string, s *Schema) { |
| 601 | s.Media = &Media{Type: mt.Identifier} |
| 602 | projected, err := expr.Project(mt, view) |
| 603 | if err != nil { |
| 604 | panic(fmt.Sprintf("failed to project media type %#v: %s", mt.Identifier, err)) // bug |
| 605 | } |
| 606 | buildAttributeSchema(api, s, projected.AttributeExpr) |
| 607 | } |
| 608 | |
| 609 | // MustGenerate returns true if the meta indicates that a OpenAPI specification should be |
| 610 | // generated, false otherwise. |
no test coverage detected