Skip to content

OpenAPI 3.1 Pet Store example schema validates correctly but fails to generate SDK for Typescript #361

Closed
@RichardJECooke

Description

@RichardJECooke

The example schema from the Swagger Editor validates without error in Speakeasy, but fails both in the CLI and the web/github:

speakeasy generate sdk --schema /app/pet.yaml --lang typescript --out /app/sdk;
ERROR	failed to generate output -- failed to run script GoError: failed to execute template: template: sdk.ts.stmpl:33:8: executing "sdk.ts.stmpl" at <templateFile "subsdk.ts.stmpl" (print "src/sdk/" (lower (sanitizeFileName $subName)) ".ts") .>: error calling templateFile: failed to write file src/sdk/pet.ts: SyntaxError: Declaration or statement expected. (853:5)
  851 |     
  852 |     
> 853 |     else {
      |     ^
  854 |       const responseBody = await response.text();
  855 |       throw new errors.SDKError(
  856 |         "Unexpected API response", at D (entrypoint.js:1:548239(17))
	at github.com/speakeasy-api/easytemplate.(*Engine).init.(*Engine).init.func1.func6 (native)
	at main.ts:6:13:*(15)
: script runtime failure

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions