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

Function StringEnumBodyDSL

http/codegen/openapi/v3/testdata/dsls/types.go:18–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16}
17
18func StringEnumBodyDSL() func() {
19 return func() {
20 var T1 = Type("T1", func() {
21 Attribute("my_attr", String, func() {
22 Enum("a", "b", "c")
23 })
24 })
25
26 var T2 = Type("T2", func() {
27 Attribute("my_attr", String, func() {
28 Enum("d", "e")
29 })
30 })
31
32 var _ = Service("svc_enum_1", func() {
33 Method("method_enum", func() {
34 Payload(func() {
35 Reference(T1)
36 Attribute("my_attr")
37 Required("my_attr")
38 })
39 HTTP(func() {
40 POST("/")
41 })
42 })
43 })
44
45 var _ = Service("svc_enum_2", func() {
46 Method("method_enum", func() {
47 Payload(func() {
48 Reference(T2)
49 Attribute("my_attr")
50 Required("my_attr")
51 })
52
53 HTTP(func() {
54 POST("/other")
55 })
56 })
57 })
58 }
59}
60
61func AliasStringBodyDSL(svcName, metName string) func() {
62 return func() {

Callers 1

Calls 10

AttributeFunction · 0.85
EnumFunction · 0.85
MethodFunction · 0.85
PayloadFunction · 0.85
ReferenceFunction · 0.85
RequiredFunction · 0.85
POSTFunction · 0.85
TypeTypeAlias · 0.50
ServiceFunction · 0.50
HTTPFunction · 0.50

Tested by 1