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

Function newObj

http/codegen/openapi/v3/types_test.go:637–646  ·  view source on GitHub ↗
(n string, req bool)

Source from the content-addressed store, hash-verified

635}
636
637func newObj(n string, req bool) *expr.AttributeExpr {
638 attr := &expr.AttributeExpr{
639 Type: &expr.Object{{Name: n, Attribute: &expr.AttributeExpr{Type: expr.String}}},
640 Validation: &expr.ValidationExpr{},
641 }
642 if req {
643 attr.Validation.Required = []string{n}
644 }
645 return attr
646}
647
648func newObj2Meta(n, o string, t, u expr.DataType, l, m expr.MetaExpr, reqs ...string) *expr.AttributeExpr {
649 attr := &expr.AttributeExpr{

Callers 2

TestHashAttributeFunction · 0.85
TestIsPrimitivePointerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected