diff --git a/src/lib/code-sample/go.ts b/src/lib/code-sample/go.ts index 19517f3..6d731be 100644 --- a/src/lib/code-sample/go.ts +++ b/src/lib/code-sample/go.ts @@ -24,13 +24,16 @@ export const createGoRequest = ( goPackageName, requestStructName, }) - const goSdkRequestArgs = `context.Background()${isReqWithParams ? `, ${goPackageName}.${requestStructName}(${formattedArgs})` : ''}` + const goSdkRequestArgs = `context.Background()${isReqWithParams ? `, ${goPackageName}.${requestStructName}{${formattedArgs}}` : ''}` const pathParts = request.path.split('/') - return `${goSdkImports} + return `package main + ${goSdkImports} + func main() { client${pathParts.map((p) => pascalCase(p)).join('.')}(${goSdkRequestArgs}) + } `.trim() } diff --git a/test/snapshots/blueprint.test.ts.md b/test/snapshots/blueprint.test.ts.md index bb4f637..1cb214a 100644 --- a/test/snapshots/blueprint.test.ts.md +++ b/test/snapshots/blueprint.test.ts.md @@ -268,9 +268,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: 'api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}', response_syntax: 'go', @@ -387,9 +390,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: 'api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}', response_syntax: 'go', @@ -506,9 +512,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: '[]api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}', response_syntax: 'go', @@ -626,9 +635,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: '[]api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}', response_syntax: 'go', @@ -746,9 +758,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: 'api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}', response_syntax: 'go', @@ -865,9 +880,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: 'api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}', response_syntax: 'go', @@ -984,9 +1002,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: '[]api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}', response_syntax: 'go', @@ -1104,9 +1125,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: '[]api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}', response_syntax: 'go', @@ -1224,9 +1248,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: 'api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}', response_syntax: 'go', @@ -1343,9 +1370,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: 'api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}', response_syntax: 'go', @@ -1462,9 +1492,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: '[]api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}', response_syntax: 'go', @@ -1582,9 +1615,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: `import api "github.com/seamapi/go"␊ + request: `package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: '[]api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}', response_syntax: 'go', @@ -1713,7 +1749,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: 'client.Transport.Air.Planes.List(context.Background())', + request: `package main␊ + ␊ + ␊ + func main() {␊ + client.Transport.Air.Planes.List(context.Background())␊ + }`, request_syntax: 'go', response: '[]api.Plane{api.Plane{PlaneId: "9d3163f9-9185-40d3-a0ce-a03d3c7ce402", Name: "Woosh"}}', response_syntax: 'go', @@ -1818,7 +1859,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: 'client.Transport.Air.Planes.List(context.Background())', + request: `package main␊ + ␊ + ␊ + func main() {␊ + client.Transport.Air.Planes.List(context.Background())␊ + }`, request_syntax: 'go', response: '[]api.Plane{api.Plane{PlaneId: "9d3163f9-9185-40d3-a0ce-a03d3c7ce402", Name: "Woosh"}}', response_syntax: 'go', @@ -1923,7 +1969,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: 'client.Transport.Air.Planes.List(context.Background())', + request: `package main␊ + ␊ + ␊ + func main() {␊ + client.Transport.Air.Planes.List(context.Background())␊ + }`, request_syntax: 'go', response: '[]api.Plane{api.Plane{PlaneId: "9d3163f9-9185-40d3-a0ce-a03d3c7ce402", Name: "Woosh"}}', response_syntax: 'go', @@ -2044,7 +2095,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: 'client.Deprecated.Undocumented.Endpoint(context.Background())', + request: `package main␊ + ␊ + ␊ + func main() {␊ + client.Deprecated.Undocumented.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: 'nil', response_syntax: 'go', @@ -2140,7 +2196,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: 'client.Deprecated.Undocumented.Endpoint(context.Background())', + request: `package main␊ + ␊ + ␊ + func main() {␊ + client.Deprecated.Undocumented.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: 'nil', response_syntax: 'go', @@ -2236,7 +2297,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: 'client.Deprecated.Undocumented.Endpoint(context.Background())', + request: `package main␊ + ␊ + ␊ + func main() {␊ + client.Deprecated.Undocumented.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: 'nil', response_syntax: 'go', @@ -2348,7 +2414,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: 'client.Draft.Endpoint(context.Background())', + request: `package main␊ + ␊ + ␊ + func main() {␊ + client.Draft.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: 'nil', response_syntax: 'go', @@ -2444,7 +2515,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: 'client.Draft.Endpoint(context.Background())', + request: `package main␊ + ␊ + ␊ + func main() {␊ + client.Draft.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: 'nil', response_syntax: 'go', @@ -2540,7 +2616,12 @@ Generated by [AVA](https://avajs.dev). title: 'C#', }, go: { - request: 'client.Draft.Endpoint(context.Background())', + request: `package main␊ + ␊ + ␊ + func main() {␊ + client.Draft.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: 'nil', response_syntax: 'go', @@ -2904,9 +2985,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: `// go␊ api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}`, @@ -3039,9 +3123,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: `// go␊ api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}`, @@ -3174,9 +3261,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: `// go␊ []api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}`, @@ -3310,9 +3400,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: `// go␊ []api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}`, @@ -3446,9 +3539,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: `// go␊ api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}`, @@ -3581,9 +3677,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: `// go␊ api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}`, @@ -3716,9 +3815,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: `// go␊ []api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}`, @@ -3852,9 +3954,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: `// go␊ []api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}`, @@ -3988,9 +4093,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: `// go␊ api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}`, @@ -4123,9 +4231,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.Get(context.Background(), api.FoosGetRequest(FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")))`, + func main() {␊ + client.Foos.Get(context.Background(), api.FoosGetRequest{FooId: api.String("8d7e0b3a-b889-49a7-9164-4b71a0506a33")})␊ + }`, request_syntax: 'go', response: `// go␊ api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar", NestedObjectProp: api.FooObjectPropNestedObjectProp{Foo: "bar"}}, ArrayProp: []string{"foo", "bar"}}`, @@ -4258,9 +4369,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: `// go␊ []api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}`, @@ -4394,9 +4508,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - import api "github.com/seamapi/go"␊ + package main␊ + import api "github.com/seamapi/go"␊ ␊ - client.Foos.List(context.Background(), api.FoosListRequest(ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}))`, + func main() {␊ + client.Foos.List(context.Background(), api.FoosListRequest{ObjectProp: api.FoosListRequestObjectProp{Foo: api.String("bar")}})␊ + }`, request_syntax: 'go', response: `// go␊ []api.Foo{api.Foo{FooId: "8d7e0b3a-b889-49a7-9164-4b71a0506a33", Name: "Best foo", NullableProp: nil, NumberProp: 10, ObjectProp: api.FooObjectProp{Foo: "bar"}, ArrayProp: []string{"foo", "bar"}}}`, @@ -4541,7 +4658,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - client.Transport.Air.Planes.List(context.Background())`, + package main␊ + ␊ + ␊ + func main() {␊ + client.Transport.Air.Planes.List(context.Background())␊ + }`, request_syntax: 'go', response: `// go␊ []api.Plane{api.Plane{PlaneId: "9d3163f9-9185-40d3-a0ce-a03d3c7ce402", Name: "Woosh"}}`, @@ -4662,7 +4784,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - client.Transport.Air.Planes.List(context.Background())`, + package main␊ + ␊ + ␊ + func main() {␊ + client.Transport.Air.Planes.List(context.Background())␊ + }`, request_syntax: 'go', response: `// go␊ []api.Plane{api.Plane{PlaneId: "9d3163f9-9185-40d3-a0ce-a03d3c7ce402", Name: "Woosh"}}`, @@ -4783,7 +4910,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - client.Transport.Air.Planes.List(context.Background())`, + package main␊ + ␊ + ␊ + func main() {␊ + client.Transport.Air.Planes.List(context.Background())␊ + }`, request_syntax: 'go', response: `// go␊ []api.Plane{api.Plane{PlaneId: "9d3163f9-9185-40d3-a0ce-a03d3c7ce402", Name: "Woosh"}}`, @@ -4920,7 +5052,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - client.Deprecated.Undocumented.Endpoint(context.Background())`, + package main␊ + ␊ + ␊ + func main() {␊ + client.Deprecated.Undocumented.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: `// go␊ nil`, @@ -5032,7 +5169,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - client.Deprecated.Undocumented.Endpoint(context.Background())`, + package main␊ + ␊ + ␊ + func main() {␊ + client.Deprecated.Undocumented.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: `// go␊ nil`, @@ -5144,7 +5286,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - client.Deprecated.Undocumented.Endpoint(context.Background())`, + package main␊ + ␊ + ␊ + func main() {␊ + client.Deprecated.Undocumented.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: `// go␊ nil`, @@ -5272,7 +5419,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - client.Draft.Endpoint(context.Background())`, + package main␊ + ␊ + ␊ + func main() {␊ + client.Draft.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: `// go␊ nil`, @@ -5384,7 +5536,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - client.Draft.Endpoint(context.Background())`, + package main␊ + ␊ + ␊ + func main() {␊ + client.Draft.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: `// go␊ nil`, @@ -5496,7 +5653,12 @@ Generated by [AVA](https://avajs.dev). }, go: { request: `// go␊ - client.Draft.Endpoint(context.Background())`, + package main␊ + ␊ + ␊ + func main() {␊ + client.Draft.Endpoint(context.Background())␊ + }`, request_syntax: 'go', response: `// go␊ nil`, diff --git a/test/snapshots/blueprint.test.ts.snap b/test/snapshots/blueprint.test.ts.snap index db4ec02..d34ef1a 100644 Binary files a/test/snapshots/blueprint.test.ts.snap and b/test/snapshots/blueprint.test.ts.snap differ