Skip to content

Commit 8c6a903

Browse files
committed
fix(openapi-serverless): fix yaml generation
1 parent 727b2c0 commit 8c6a903

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

package-lock.json

Lines changed: 20 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/serverless-openapi/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { customProperties } from './lib/custom.properties';
44
import { OpenAPIV3 } from 'openapi-types';
55
import { writeFileSync } from 'fs';
66
import { HttpMethod } from 'serverless/plugins/aws/package/compile/events/apiGateway/lib/validate';
7-
import { dump } from 'js-yaml';
87
import { functioneventProperties } from './lib/functionEvent.properties';
8+
import { dump } from 'js-yaml';
99

1010
type CommandsDefinition = Record<
1111
string,
@@ -200,7 +200,7 @@ export class ServerlessPlugin {
200200

201201
let output = JSON.stringify(openApi, undefined, ' ');
202202
if (out.endsWith('.yaml') || out.endsWith('.yml')) {
203-
output = dump(openApi);
203+
output = dump(JSON.parse(output));
204204
}
205205

206206
writeFileSync(out, output);

0 commit comments

Comments
 (0)