Back to list
RulesJson — Laravel 検証規則を一瞬で JSON リクエストボディへ変換
RulesJson — Convert Laravel Validation Rules to a JSON Request Body Instantly
Translated: 2026/4/25 5:14:45 翻訳信頼度: 95.2%
Japanese Translation
全ての Laravel 開発者は一度だけ体験したことだろう:FormRequest を書き終え、API クライアントに切り替わり、その後数分間、テスト用の JSON ボディを手動で再構築する必要があった。RulesJson はこの手順を完全に消した。
$rules アレイ(パイプ文字列、PHP の結合配列、Laravel 規則、または単純な JS オブジェクトのいずれか)を貼り付け、すぐに完全に満たされた、構文強調付きの JSON ボディを取得できる。フィールドは名前を認識しており、email フィールドは本当のメールアドレス、UUID フィールドは有効な UUID、slug フィールドはスラグ、in 規則は自動的に最初の有効な列挙値を選択する。address.city などの点区切り notation フィールドは正しくネストされたオブジェクトを生み出し、tags.* などのワイルドカード配列はタイピングされた単一要素の配列を生み出す。confirmed 規則は自動で _confirmation の姉妹フィールドを生成し、型が明示されていませんが nullable フィールドは null に解決される。
Vanilla JS と Tailwind CSS で構築され、依存関係はゼロ。全てはブラウザ上を実行し、データはどこにも送信されない。MIT ライセンスで、貢献歓迎。
🌐ライブで試す: https://rules-json.msaied.com
https://github.com/EG-Mohamed/RulesJson
https://msaied.com
Original Content
Every Laravel developer has been there: you finish writing a FormRequest, switch to your API client, and spend the next few minutes manually reconstructing the JSON body to test it. RulesJson eliminates that step entirely.
Paste your $rules array in any format — pipe strings, PHP associative arrays, Laravel array rules, or plain JS objects — and get a fully populated, syntax-highlighted JSON body instantly. Fields are named-aware, so email fields get real email addresses, UUID fields get valid UUIDs, slug fields get slugs, and in: rules pick the first valid enum value automatically. Dot-notation fields like address.city produce properly nested objects. Wildcard arrays like tags.* produce typed single-item arrays. The confirmed rule auto-generates the _confirmation sibling. nullable fields without an explicit type resolve to null.
Built with vanilla JS and Tailwind CSS. Zero dependencies. Everything runs in the browser — no data is ever sent anywhere. MIT licensed and open to contributions.
🌐 Try it live: https://rules-json.msaied.com
https://github.com/EG-Mohamed/RulesJson
https://msaied.com