Skip to content

Conversation

tkow
Copy link
Contributor

@tkow tkow commented Dec 6, 2021

Summary

Nest.jsなどのspec json生成ツールと連携を簡単にするために、ファイル出力をせずにjsonフォーマットを直接受け入れられるようにしました。
server reload時の自動クライアント生成などを行うユースケースに有用です。

Test Plan

constructor(private readonly entryPoint: string, private option?: Option) {
this.rootSchema = Api.FileSystem.loadJsonOrYaml(entryPoint);
this.resolvedReferenceDocument = Api.ResolveReference.resolve(entryPoint, entryPoint, JSON.parse(JSON.stringify(this.rootSchema)));
constructor(private readonly entryPointOrDocument: string | Types.OpenApi.Document, private option?: Option) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Himenon TOOD update interface

@tkow tkow force-pushed the feat/accept-json-format branch from c660039 to 3f9de3a Compare December 6, 2021 08:28
@tkow tkow changed the title feat: json formatを実行可能にする feat: CodeGeneratorのentryPointに直接OpenApi.Documentを指定可能にする Dec 6, 2021
apiClientGeneratorTemplate,
]);

expect(code).toMatchSnapshot();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

既存の手続きで生成したコードと比較するだけで良さそうです。

@tkow tkow force-pushed the feat/accept-json-format branch from 8f77c93 to e5755e9 Compare December 6, 2021 09:16
apiClientGeneratorTemplate,
]);

expect(code1).toBe(code2);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@Himenon Himenon merged commit 53065b2 into Himenon:main Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants