ข้ามไปยังเนื้อหา

ข้อกำหนดการตรวจสอบ

เอกสารนี้อธิบายโครงสร้างและเนื้อหาของข้อกำหนดการตรวจสอบที่เผยแพร่โดยโปรเจกต์ api-specs-enriched

ข้อกำหนดการตรวจสอบรวบรวมข้อจำกัดการตรวจสอบ API ค่าเริ่มต้น และข้อมูลเมตาของการกำหนดค่าไว้ในไฟล์ JSON เดียว ข้อกำหนดนี้ถูกสร้างจาก OpenAPI specs ที่เพิ่มประสิทธิภาพแล้วและเผยแพร่ควบคู่กัน

ตำแหน่งที่เผยแพร่: 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": {
"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": {
"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": {
"type_defaults": {
"string": {"minLength": 0, "maxLength": 1024},
"integer": {"minimum": 0, "maximum": 2147483647}
}
}
}

กฎการตรวจสอบที่อิงตามรูปแบบชื่อฟิลด์พร้อมคะแนนความน่าเชื่อถือ

{
"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": {
"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": {}
}
}
}
}
}
หมวดหมู่คำอธิบายแหล่งที่มา
server_appliedค่าที่ API นำไปใช้เมื่อฟิลด์ถูกละเว้นการทดสอบ API แบบสด
recommendedค่าที่กรอกล่วงหน้าใน F5 XC web consoleการวิเคราะห์ UI
advanced_optionsค่าเริ่มต้นที่ซ้อนกันภายในออบเจกต์ advanced_optionsการค้นพบ API
oneof_choicesการเลือก OneOf variant เริ่มต้นพฤติกรรม API
oneof_recommendedOneOf variants ที่แนะนำค่าเริ่มต้นของคอนโซล
nested_recommendedค่าที่แนะนำสำหรับ schema ที่ซ้อนกันการวิเคราะห์ UI
ui_vs_serverกรณีที่ค่าเริ่มต้นของ UI แตกต่างจากค่าเริ่มต้นของ APIการวิเคราะห์เปรียบเทียบ

ฟิลด์ที่ไม่สามารถใช้ร่วมกันได้และการพึ่งพาตามเงื่อนไข

{
"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": {
"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 specs ที่เพิ่มประสิทธิภาพแล้วฝังข้อมูลเมตาการตรวจสอบโดยใช้ extensions เหล่านี้:

Extensionวัตถุประสงค์ตำแหน่ง
x-f5xc-required-forฟิลด์ที่จำเป็นตามบริบทSchema properties
x-f5xc-server-defaultทำเครื่องหมายค่าเริ่มต้นที่ server นำไปใช้Schema properties
x-f5xc-recommended-valueค่าเริ่มต้นที่แนะนำSchema properties
x-f5xc-recommended-oneof-variantOneOf variant ที่แนะนำSchema definitions
x-f5xc-conditionsข้อกำหนดตามเงื่อนไขSchema properties
x-f5xc-minimum-configurationตัวอย่างการกำหนดค่าขั้นต่ำSchema definitions
x-f5xc-validationข้อจำกัดที่ได้จากการค้นพบSchema properties
แหล่งที่มาURL
GitHub Pageshttps://f5-sales-demo.github.io/api-specs-enriched/specifications/api/validation.json
Raw GitHubhttps://raw.githubusercontent.com/f5-sales-demo/api-specs-enriched/main/docs/specifications/api/validation.json

หลังจากรัน pipeline: docs/specifications/api/validation.json

ข้อกำหนดการตรวจสอบใช้ semantic versioning ในฟิลด์ version:

ประเภทการเปลี่ยนแปลงการเพิ่มเวอร์ชันตัวอย่าง
การเปลี่ยนแปลงโครงสร้างที่ทำให้ระบบเดิมทำงานไม่ได้Majorการเปลี่ยนชื่อฟิลด์, การลบส่วนต่างๆ
กฎการตรวจสอบหรือทรัพยากรใหม่Minorค่าเริ่มต้นทรัพยากรใหม่
การแก้ไขข้อผิดพลาดหรืออัปเดตคำอธิบายPatchการแก้ไขคำผิด

เมื่อแหล่งข้อมูลหลายแหล่งให้ข้อจำกัด ลำดับความสำคัญในการประสานคือ:

  1. Existing - ข้อจำกัดใน OpenAPI spec ต้นฉบับ (ความสำคัญสูงสุด)
  2. Discovery - ข้อจำกัดจากการค้นพบ API แบบสด
  3. Inferred - ข้อจำกัดจากการจับคู่รูปแบบ (ความสำคัญต่ำสุด)
  • Healthcheck Enhancements - การเพิ่มประสิทธิภาพ schema ของ Healthcheck
  • Origin Pool Enhancements - การเพิ่มประสิทธิภาพ schema ของ Origin Pool
  • CLAUDE.md - คำแนะนำสำหรับผู้ช่วย AI
  • DEVELOPMENT.md - คู่มือสำหรับนักพัฒนา
เวอร์ชันวันที่การเปลี่ยนแปลง
2.1.22026-01-18เขียนใหม่เป็น API reference แบบบริสุทธิ์; เพิ่มหมวดหมู่ oneof_recommended และ nested_recommended
2.1.02026-01-18โครงสร้าง defaults แบบรวมที่แทนที่ส่วนที่กระจัดกระจาย
2.0.02026-01-15ข้อกำหนดการตรวจสอบเริ่มต้น