Commit 2fcf4658 authored by Walter Featherstone's avatar Walter Featherstone

grantTypes enum array. Updated jenkins script to use swagger-cli and speccy

parent 7e21cc6e
Pipeline #955 passed with stage
in 0 seconds
#!/bin/bash #!/bin/bash
specfiles=$(ls | egrep -i "^Mp1.(json|yaml)") specfiles=$(ls | egrep "^[^.]*.(json|yaml)")
fres=0 fres=0
for i in $specfiles ; do for i in $specfiles ; do
echo "-- Validating OpenAPI file $i..." echo "-- Validating and linting OpenAPI file $i..."
swagger-tools validate $i swagger-cli validate "$i"
res=$? res=$?
fres=$(($fres||$res)) speccy lint "$i"
echo -e "-- Validator returned $res.\n" res2=$?
fres=$(($fres||$res||$res2))
echo "--- Validator returned $res, linter returned $res2."
done done
echo "-- Final validator returns $fres." echo "-- Final validation returns $fres."
exit $fres
exit $fres
\ No newline at end of file
...@@ -992,7 +992,13 @@ ...@@ -992,7 +992,13 @@
], ],
"properties": { "properties": {
"grantTypes": { "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": { "tokenEndpoint": {
"$ref": "#/components/schemas/SecurityInfo.OAuth2Info.TokenEndpoint" "$ref": "#/components/schemas/SecurityInfo.OAuth2Info.TokenEndpoint"
...@@ -2409,7 +2415,9 @@ ...@@ -2409,7 +2415,9 @@
}, },
"security": { "security": {
"oAuth2Info": { "oAuth2Info": {
"grantTypes": "OAUTH2_CLIENT_CREDENTIALS", "grantTypes": [
"OAUTH2_CLIENT_CREDENTIALS"
],
"tokenEndpoint": "/meMp1/security/TokenEndPoint" "tokenEndpoint": "/meMp1/security/TokenEndPoint"
} }
} }
...@@ -2447,7 +2455,9 @@ ...@@ -2447,7 +2455,9 @@
}, },
"security": { "security": {
"oAuth2Info": { "oAuth2Info": {
"grantTypes": "OAUTH2_CLIENT_CREDENTIALS", "grantTypes": [
"OAUTH2_CLIENT_CREDENTIALS"
],
"tokenEndpoint": "/meMp1/security/TokenEndPoint" "tokenEndpoint": "/meMp1/security/TokenEndPoint"
} }
} }
...@@ -2516,4 +2526,4 @@ ...@@ -2516,4 +2526,4 @@
} }
} }
} }
} }
\ No newline at end of file
...@@ -742,7 +742,13 @@ components: ...@@ -742,7 +742,13 @@ components:
- tokenEndpoint - tokenEndpoint
properties: properties:
grantTypes: 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: tokenEndpoint:
$ref: '#/components/schemas/SecurityInfo.OAuth2Info.TokenEndpoint' $ref: '#/components/schemas/SecurityInfo.OAuth2Info.TokenEndpoint'
type: object type: object
...@@ -1836,7 +1842,8 @@ components: ...@@ -1836,7 +1842,8 @@ components:
- '/meMp1/service/EntryPoint' - '/meMp1/service/EntryPoint'
security: security:
oAuth2Info: oAuth2Info:
grantTypes: 'OAUTH2_CLIENT_CREDENTIALS' grantTypes:
- 'OAUTH2_CLIENT_CREDENTIALS'
tokenEndpoint: '/meMp1/security/TokenEndPoint' tokenEndpoint: '/meMp1/security/TokenEndPoint'
serializer: 'JSON' serializer: 'JSON'
ServiceInfoList: ServiceInfoList:
...@@ -1863,7 +1870,8 @@ components: ...@@ -1863,7 +1870,8 @@ components:
port: 8080 port: 8080
security: security:
oAuth2Info: oAuth2Info:
grantTypes: 'OAUTH2_CLIENT_CREDENTIALS' grantTypes:
- 'OAUTH2_CLIENT_CREDENTIALS'
tokenEndpoint: '/meMp1/security/TokenEndPoint' tokenEndpoint: '/meMp1/security/TokenEndPoint'
serializer: 'JSON' serializer: 'JSON'
TrafficRule: TrafficRule:
......
...@@ -5,8 +5,8 @@ This repository contains OpenAPIs descriptions for the interfaces specified in E ...@@ -5,8 +5,8 @@ This repository contains OpenAPIs descriptions for the interfaces specified in E
## Online resources ## Online resources
* [Specification document](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/011/01.01.01_60/gs_mec011v010101p.pdf) * [Specification document](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/011/01.01.01_60/gs_mec011v010101p.pdf)
* [Navigate the API in the browser](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/mec/gs011-app-enablement-api/raw/develop/Mp1.yaml). * [Navigate the API in the browser](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/mec/gs011-app-enablement-api/raw/master/Mp1.yaml).
* [Edit the API online](https://forge.etsi.org/swagger/editor/?url=https://forge.etsi.org/gitlab/mec/gs011-app-enablement-api/raw/develop/Mp1.yaml). * [Edit the API online](https://forge.etsi.org/swagger/editor/?url=https://forge.etsi.org/gitlab/mec/gs011-app-enablement-api/raw/master/Mp1.yaml).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment