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

Function buildResultTypeSchema

http/codegen/openapi/json_schema.go:600–607  ·  view source on GitHub ↗

buildResultTypeSchema initializes s as the JSON schema representing mt for the given view.

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

Source from the content-addressed store, hash-verified

598// buildResultTypeSchema initializes s as the JSON schema representing mt for the
599// given view.
600func 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.

Callers 1

Calls 2

ProjectFunction · 0.92
buildAttributeSchemaFunction · 0.85

Tested by

no test coverage detected