Skip to content

Commit

Permalink
Merge branch 'main' of github.com:seamapi/blueprint into issue-111
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-balitskyi committed Oct 9, 2024
2 parents bc90b3d + 2c2329e commit 9235ef8
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 117 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seamapi/blueprint",
"version": "0.27.0",
"version": "0.27.1",
"description": "Build tools for the Seam API using this blueprint.",
"type": "module",
"main": "index.js",
Expand Down
21 changes: 1 addition & 20 deletions src/lib/code-sample/csharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,4 @@ const formatCsharpObject = (value: Record<string, Json>): string => {
return `new { ${formattedEntries} }`
}

export const createCsharpResponse = (
codeSampleDefinition: CodeSampleDefinition,
context: Context,
): string => {
const { response, title } = codeSampleDefinition
const { endpoint } = context

if (endpoint.response.responseType === 'void') return 'null'

const { responseKey, resourceType } = endpoint.response
const responseValue = response?.body?.[responseKey]

if (responseValue == null) {
throw new Error(`Missing ${responseKey} for '${title}'`)
}

return Array.isArray(responseValue)
? `System.Collections.Generic.List\`1[Seam.Model.${pascalCase(resourceType)}]`
: createJsonResponse(codeSampleDefinition, context)
}
export const createCsharpResponse = createJsonResponse
2 changes: 1 addition & 1 deletion src/lib/code-sample/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const createCodeSample = async (
request: createGoRequest(codeSampleDefinition, context),
response: createGoResponse(codeSampleDefinition, context),
request_syntax: 'go',
response_syntax: 'json',
response_syntax: 'go',
},
java: {
title: 'Java',
Expand Down
Loading

0 comments on commit 9235ef8

Please sign in to comment.