轻松聘AI开发
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

32 lines
1.1 KiB

import json
from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parents[1]
p = PROJECT_ROOT / 'docs' / 'openapi-rc.json'
d = json.load(open(p, encoding='utf-8'))
print('paths:', len(d['paths']))
assert len(d['paths']) == 81, f"Expected 81 paths, got {len(d['paths'])}"
paths = d['paths']
required = [
'/review-weight-templates',
'/profile/me/review-weights',
'/jobs/{jobId}/personalized-review-score',
]
for path in required:
assert path in paths, f"Missing path: {path}"
print(f" Found: {path}")
assert 'get' in paths['/review-weight-templates'], "Missing GET /review-weight-templates"
assert 'get' in paths['/profile/me/review-weights'], "Missing GET /profile/me/review-weights"
assert 'put' in paths['/profile/me/review-weights'], "Missing PUT /profile/me/review-weights"
assert 'get' in paths['/jobs/{jobId}/personalized-review-score'], "Missing GET /jobs/{jobId}/personalized-review-score"
print(" 4 operations all present")
data = json.dumps(d)
assert '"" : "#/components/schemas/' not in data, "Found empty ref key"
print("No empty ref keys found")
print("Valid JSON: True")
print("All checks passed!")