LoginSignup
@tomatommy

OASのschema定義をしたTSの型定義がほしい

  • 言語: TypeScript

解決したいこと

  • OAS の schema 定義を型定義して提供しているライブラリがほしい

例えば以下のようなもの

type RequestBody = {
  required?: boolean;
  content: {
    [mediaType: string]: {
      schema: {
        type: string;
        properties?: {
          [key: string]: {
            type: string;
            format?: string;
            items?: {
              type: string;
            };
          };
        };
        required?: string[];
      };
    };
  };
};

上記は ChatGPTで簡単に生成してもらったもの。このような型定義のもっと正式なものを提供しているライブラリを探しています。

漁ったライブラリ

どれも、OASのvalidationや、UI描写のためのライブラリで、型を直接は提供していませんでした。

1

2Answer

これです!
ありがとうございます :bow:

Sign up for free and join this conversation.

Sign Up
If you already have a Qiita account Login