待测试
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user