待测试

This commit is contained in:
2026-07-28 07:58:26 +08:00
parent 1e9e25fe67
commit 6fbcf21024
22 changed files with 1294 additions and 264 deletions
+8 -1
View File
@@ -58,7 +58,14 @@ if (($avatar.type -join ',') -ne 'string,null' -or $avatar.pattern -ne '^[1-9][0
foreach ($field in @('birthLunar', 'deathLunar', 'personStatus', 'sex')) {
$schema = $body.properties.$field
if ($schema.type -ne 'string') { throw "LineagePersonBody.$field must be a dictionary string" }
if ($schema.enum) { throw "LineagePersonBody.$field enum changed; update the T-series selector contract" }
}
if ((@($body.properties.sex.enum) -join ',') -ne '0,1,2') { throw 'LineagePersonBody.sex must use 0,1,2' }
if ((@($body.properties.birthLunar.enum) -join ',') -ne '0,1') { throw 'LineagePersonBody.birthLunar must use 0,1' }
if ((@($body.properties.deathLunar.enum) -join ',') -ne '0,1') { throw 'LineagePersonBody.deathLunar must use 0,1' }
if ((@($body.properties.personStatus.enum) -join ',') -ne '0,1,2') { throw 'LineagePersonBody.personStatus must use 0,1,2' }
if ((@($body.required) -notcontains 'bindingMode' -or (@($body.properties.bindingMode.enum) -join ',') -ne 'NONE,SELF,SPECIFIED')) {
throw 'LineagePersonBody.bindingMode must be required and use NONE,SELF,SPECIFIED'
}
Write-Output 'LINEAGE-OPENAPI-CONTRACT PASS'