- ホーム
- API Enriched
- バリデーション仕様
バリデーション仕様
このドキュメントでは、api-specs-enriched プロジェクトが公開するバリデーション仕様の構造と内容について説明します。
バリデーション仕様は、API バリデーション制約、デフォルト値、および設定メタデータを単一の JSON ファイルに統合したものです。この仕様は、拡充された OpenAPI 仕様から生成され、それらと並行して公開されます。
公開場所: docs/specifications/api/validation.json
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "version": "2.1.0", "generated_at": "2026-01-17T12:00:00Z", "source": "api-specs-enriched",
"required_fields": { ... }, "enum_values": { ... }, "constraints": { ... }, "patterns": [ ... ], "conditional_requirements": { ... }, "minimum_configurations": { ... }, "defaults": { ... }, "extensions": { ... }}required_fields
Section titled “required_fields”リソースごとに各操作タイプに必要なフィールドを指定します。
{ "required_fields": { "common": { "all_operations": ["metadata.name", "metadata.namespace"] }, "resources": { "origin_pool": { "create": ["metadata.name", "metadata.namespace", "spec.origin_servers", "spec.port"], "update": ["metadata.name", "metadata.namespace"], "minimum_config": ["metadata.name", "metadata.namespace", "spec.origin_servers", "spec.port"] } } }}enum_values
Section titled “enum_values”制約のあるフィールドに許可される値を定義します。
{ "enum_values": { "loadbalancer_algorithm": { "description": "Load balancing algorithm for distributing traffic across origin servers", "values": [ {"value": "ROUND_ROBIN", "description": "Each healthy endpoint selected in round robin order"}, {"value": "LEAST_REQUEST", "description": "Endpoint with fewest active requests selected"}, {"value": "RING_HASH", "description": "Consistent hashing using ring hash of endpoint names"}, {"value": "RANDOM", "description": "Random healthy endpoint selection"}, {"value": "LB_OVERRIDE", "description": "Hash policy inherited from parent load balancer"} ], "default": "ROUND_ROBIN" } }}constraints
Section titled “constraints”タイプレベルのバリデーションデフォルトおよびパターンベースのルール。
{ "constraints": { "type_defaults": { "string": {"minLength": 0, "maxLength": 1024}, "integer": {"minimum": 0, "maximum": 2147483647} } }}patterns
Section titled “patterns”信頼スコア付きのフィールド名パターンベースのバリデーションルール。
{ "patterns": [ { "pattern": "\\bport$", "constraints": {"minimum": 1, "maximum": 65535}, "confidence": 0.99, "description": "Valid TCP/UDP port range" }, { "pattern": "\\bname$", "constraints": { "minLength": 1, "maxLength": 63, "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" }, "confidence": 0.90, "description": "Kubernetes-style naming convention" } ]}defaults
Section titled “defaults”リソースタイプ別に統一された構造で整理された全デフォルト値。
{ "defaults": { "description": "All default values organized by resource type", "resources": { "healthcheck": { "server_applied": { "jitter": 0, "jitter_percent": 0 }, "recommended": { "timeout": 3, "interval": 15, "unhealthy_threshold": 1, "healthy_threshold": 3, "jitter_percent": 30 }, "oneof_recommended": { "health_check": "http_health_check" }, "nested_recommended": { "http_health_check": { "path": "/", "use_http2": false, "expected_status_codes": ["200"], "use_origin_server_name": {} } } }, "origin_pool": { "server_applied": { "no_tls": {}, "healthcheck": [], "loadbalancer_algorithm": "ROUND_ROBIN", "endpoint_selection": "DISTRIBUTED" }, "recommended": { "port": 443, "connection_timeout": 2000, "http_idle_timeout": 300000 }, "advanced_options": { "connection_timeout": 2000, "http_idle_timeout": 300000, "same_as_endpoint_port": {}, "default_circuit_breaker": {}, "disable_outlier_detection": {} }, "oneof_choices": { "port_choice": "port", "tls_choice": "no_tls", "circuit_breaker_choice": "default_circuit_breaker" }, "ui_vs_server": { "loadbalancer_algorithm": { "ui_default": "LB_OVERRIDE", "server_default": "ROUND_ROBIN", "note": "UI preselects LB_OVERRIDE but server applies ROUND_ROBIN if omitted" } } }, "app_firewall": { "server_applied": { "allow_all_response_codes": {}, "default_anonymization": {}, "monitoring": {} } } } }}デフォルトカテゴリ
Section titled “デフォルトカテゴリ”| カテゴリ | 説明 | ソース |
|---|---|---|
server_applied | フィールドが省略された場合に API が適用する値 | ライブ API テスト |
recommended | F5 XC ウェブコンソールに事前入力される値 | UI 分析 |
advanced_options | advanced_options オブジェクト内のネストされたデフォルト | API ディスカバリー |
oneof_choices | デフォルトの OneOf バリアント選択 | API の動作 |
oneof_recommended | 推奨される OneOf バリアント | コンソールデフォルト |
nested_recommended | ネストされたスキーマの推奨値 | UI 分析 |
ui_vs_server | UI デフォルトと API デフォルトが異なるケース | 比較分析 |
conditional_requirements
Section titled “conditional_requirements”相互に排他的なフィールドと条件付き依存関係。
{ "conditional_requirements": { "resources": { "healthcheck": { "mutually_exclusive": [ { "fields": ["spec.http_health_check", "spec.tcp_health_check", "spec.udp_icmp_health_check"], "reason": "Choose exactly one health check type" } ], "conditional": [] } } }}minimum_configurations
Section titled “minimum_configurations”動作する例を含む最小限の実行可能な設定。
{ "minimum_configurations": { "resources": { "origin_pool": { "description": "Backend origin servers for load balancing", "example": { "metadata": {"name": "backend-pool", "namespace": "default"}, "spec": { "origin_servers": [{"public_name": {"dns_name": "backend1.example.com"}}], "port": 8080 } } } } }}OpenAPI 拡張マッピング
Section titled “OpenAPI 拡張マッピング”拡充された OpenAPI 仕様は、以下の拡張機能を使用してバリデーションメタデータを埋め込みます。
| 拡張機能 | 用途 | 場所 |
|---|---|---|
x-f5xc-required-for | コンテキスト固有の必須フィールド | スキーマプロパティ |
x-f5xc-server-default | サーバー適用デフォルトのマーク | スキーマプロパティ |
x-f5xc-recommended-value | 推奨デフォルト値 | スキーマプロパティ |
x-f5xc-recommended-oneof-variant | 推奨 OneOf バリアント | スキーマ定義 |
x-f5xc-conditions | 条件付き要件 | スキーマプロパティ |
x-f5xc-minimum-configuration | 最小設定例 | スキーマ定義 |
x-f5xc-validation | ディスカバリーから導出された制約 | スキーマプロパティ |
データアクセス
Section titled “データアクセス”公開 URL
Section titled “公開 URL”| ソース | URL |
|---|---|
| GitHub Pages | https://f5-sales-demo.github.io/api-specs-enriched/specifications/api/validation.json |
| Raw GitHub | https://raw.githubusercontent.com/f5-sales-demo/api-specs-enriched/main/docs/specifications/api/validation.json |
ローカルパス
Section titled “ローカルパス”パイプライン実行後: docs/specifications/api/validation.json
バージョン管理
Section titled “バージョン管理”バリデーション仕様は version フィールドでセマンティックバージョニングに従います。
| 変更タイプ | バージョン変更 | 例 |
|---|---|---|
| 破壊的な構造変更 | メジャー | フィールド名の変更、セクションの削除 |
| 新しいバリデーションルールまたはリソース | マイナー | 新しいリソースのデフォルト |
| バグ修正または説明の更新 | パッチ | タイポの修正 |
調整の優先順位
Section titled “調整の優先順位”複数のソースが制約を提供する場合、調整の優先順位は以下のとおりです。
- 既存 - 元の OpenAPI 仕様にある制約(最高優先度)
- ディスカバリー - ライブ API ディスカバリーからの制約
- 推論 - パターンマッチングからの制約(最低優先度)
関連ドキュメント
Section titled “関連ドキュメント”- Healthcheck Enhancements - ヘルスチェックスキーマの拡充
- Origin Pool Enhancements - オリジンプールスキーマの拡充
- CLAUDE.md - AI アシスタントの手順
- DEVELOPMENT.md - 開発者ガイド
| バージョン | 日付 | 変更内容 |
|---|---|---|
| 2.1.2 | 2026-01-18 | 純粋な API リファレンスとして書き直し。oneof_recommended および nested_recommended カテゴリを追加 |
| 2.1.0 | 2026-01-18 | 断片化されたセクションを置き換える統一デフォルト構造 |
| 2.0.0 | 2026-01-15 | バリデーション仕様の初版 |