From a0317469836436e6bb51ccfdb4c74500988eb68d Mon Sep 17 00:00:00 2001 From: featherstone Date: Mon, 20 May 2019 10:18:16 +0100 Subject: [PATCH] grantTypes enum array. Updated jenkins script to use swagger-cli and speccy --- .jenkins.sh | 19 ++++++++++--------- Mp1.json | 10 ++++++++-- Mp1.yaml | 8 +++++++- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.jenkins.sh b/.jenkins.sh index b24a061..448356c 100644 --- a/.jenkins.sh +++ b/.jenkins.sh @@ -1,17 +1,18 @@ #!/bin/bash -specfiles=$(ls | egrep -i "^Mp1.(json|yaml)") +specfiles=$(ls | egrep "^[^.]*.(json|yaml)") fres=0 for i in $specfiles ; do - echo "-- Validating OpenAPI file $i..." - swagger-tools validate $i - res=$? - fres=$(($fres||$res)) - echo -e "-- Validator returned $res.\n" + echo "-- Validating and linting OpenAPI file $i..." + swagger-cli validate "$i" + res=$? + speccy lint "$i" + res2=$? + fres=$(($fres||$res||$res2)) + echo "--- Validator returned $res, linter returned $res2." done -echo "-- Final validator returns $fres." - -exit $fres +echo "-- Final validation returns $fres." +exit $fres \ No newline at end of file diff --git a/Mp1.json b/Mp1.json index 0e6efe9..1850af1 100644 --- a/Mp1.json +++ b/Mp1.json @@ -890,7 +890,7 @@ "description": "Time to live value", "type": "integer", "format": "uint32", - "example": 300 + "example": "?" }, "DnsRule": { "description": "This type represents the general information of a DNS rule.", @@ -1144,7 +1144,13 @@ ], "properties": { "grantTypes": { - "$ref": "#/components/schemas/SecurityInfo.OAuth2Info.GrantTypes" + "description": "List of supported OAuth 2.0 grant types.", + "type": "array", + "minItems": 1, + "maxItems": 4, + "items": { + "$ref": "#/components/schemas/SecurityInfo.OAuth2Info.GrantTypes" + } }, "tokenEndpoint": { "$ref": "#/components/schemas/SecurityInfo.OAuth2Info.TokenEndpoint" diff --git a/Mp1.yaml b/Mp1.yaml index 1f27a14..eeeb600 100644 --- a/Mp1.yaml +++ b/Mp1.yaml @@ -835,7 +835,13 @@ components: - tokenEndpoint properties: grantTypes: - $ref: '#/components/schemas/SecurityInfo.OAuth2Info.GrantTypes' + description: >- + List of supported OAuth 2.0 grant types. + type: array + minItems: 1 + maxItems: 4 + items: + $ref: '#/components/schemas/SecurityInfo.OAuth2Info.GrantTypes' tokenEndpoint: $ref: '#/components/schemas/SecurityInfo.OAuth2Info.TokenEndpoint' type: object -- GitLab