Skip to content

Commit

Permalink
Merge branch 'main' of github.com:seamapi/blueprint into one-endpoint…
Browse files Browse the repository at this point in the history
…-per-path
  • Loading branch information
andrii-balitskyi committed Oct 14, 2024
2 parents 7a7bb3a + aa98630 commit 63f310e
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 41 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seamapi/blueprint",
"version": "0.28.1",
"version": "0.28.2",
"description": "Build tools for the Seam API using this blueprint.",
"type": "module",
"main": "index.js",
Expand Down Expand Up @@ -73,7 +73,7 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@seamapi/types": "1.262.1",
"@seamapi/types": "1.264.2",
"@types/node": "^20.8.10",
"ava": "^6.0.1",
"c8": "^10.1.2",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/code-sample/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ export const createGoRequest = (
goPackageName,
requestStructName,
})
const goSdkRequestArgs = `context.Background()${isReqWithParams ? `, ${goPackageName}.${requestStructName}{${formattedArgs}}` : ''}`
const goSdkRequestArgs = `context.Background()${isReqWithParams ? `,\n${goPackageName}.${requestStructName}{\n${formattedArgs},\n}` : ''}`

const pathParts = request.path.split('/')

return `package main
${goSdkImports}
func main() {
client${pathParts.map((p) => pascalCase(p)).join('.')}(${goSdkRequestArgs})
client${pathParts.map((p) => pascalCase(p)).join('.')}(${isReqWithParams ? '\n' : ''}${goSdkRequestArgs},\n)
}
`.trim()
}
Expand Down Expand Up @@ -105,7 +105,7 @@ const formatGoRequestArgs = (
)
return `${pascalCase(paramKey)}: ${formattedValue}`
})
.join(', ')
.join(',\n')

const formatGoRequestArgValue = (
key: string,
Expand Down
Loading

0 comments on commit 63f310e

Please sign in to comment.