0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

jsonのリアルなテストデータを大量に作れるアプリを作った話

Posted at

リポジトリ(ほぼAIで作成)↓

作成の経緯

昨年開発のインターンにて、DjangoRESTフレームワークを使用した。
その際に、複数回テストケースを作成したが面倒だった

🚀 主な機能

  1. AIによるデータ生成(OpenAI API連携)
  2. ランダムデータ生成(UUID/数値/真偽値)
  3. 静的な値の設定
  4. ネストされたオブジェクト生成

入出力例

入力 :

{
    "count": 20,
    "fields": {
      "uuid": {
        "source": "random",
        "type": "uuid"
      },
      "name": {
        "source": "ai",
        "prompt": "ありそうなユニークな日本人の名前"
      },
      "company": {
        "source": "object",
        "fields": {
          "name": {
            "source": "ai",
            "prompt": "ありそうな日本の会社名"
          },
          "address": {
            "source": "ai",
            "prompt": "日本のありそうな住所"
          }
        }
      },
      "売上": {
        "source": "random",
        "type": "num",
        "range": [1, 500]
      },
      "is_active": {
        "source": "random",
        "type": "bool"
      },
      "launch_year": {
        "source": "random",
        "type": "num",
        "range": [2010, 2025]
      },
      "メモ(固定値)": {
        "source": "static",
        "value": "めもめも"
      }
    }
  }

出力例:

output.json - テストデータ生成AI - Visual Studio Code 2025_03_13 9_15_47.png

countの個数分データを作成します!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?