Commit 25bf05ec authored by André Costa's avatar André Costa
Browse files

new script to test develop branch

parent 54b17a5d
......@@ -5,6 +5,7 @@
"main": "index.js",
"scripts": {
"test": "./scripts/validate_all.sh",
"test-develop": "./scripts/validate_all_develop.sh",
"validate-examples": "./scripts/validate_examples.sh",
"validate-locally": "./scripts/validate_locally.sh",
"validate-online": "./scripts/validate_online.sh",
......
#!/bin/bash
echo 'Validating everything...'
echo '-------->Validating Examples...'
sh ./scripts/validate_examples.sh
echo '-------->Validating locally...'
sh ./scripts/validate_locally_develop.sh
echo '-------->Validating online...'
sh ./scripts/validate_online_develop.sh
echo '-------->Validating schema...'
sh ./scripts/validate_schema.sh
echo 'Done'
\ No newline at end of file
#!/bin/bash
#
# Requires install swagger-cli: npm install -g swagger-cli
#
# Validate locally the definition using the swagger-cli validate option
swagger-cli validate ./spec/updated/ngsi-ld-spec-open-api-develop.json
#!/bin/bash
#
# Requires install swagger-cli: npm install -g swagger-cli
#
# Merge the swagger definition into an unified and de-referenced file (use this file will avoid reference resolution problems during the validation)
swagger-cli bundle --dereference ./spec/updated/ngsi-ld-spec-open-api-develop.json -o ./bundle/ngsild_swagger_combined_dereferenced.json &&
# modified version to allow circular ref
# ~/work/swagger-cli/bin/swagger-cli.js bundle --dereference="ignore" ./spec/updated/ngsi-ld-spec-open-api.json -o ./bundle/ngsild_swagger_combined_dereferenced.json &&
echo '--> Sending to validator.swagger.io' &&
# Validate the swagger definition against the official online swagger validation service
curl -X POST -d @bundle/ngsild_swagger_combined_dereferenced.json -H 'Content-Type:application/json' https://validator.swagger.io/validator/debug
{
"openapi": "3.0.3",
"info": {
"description": "This OAS file describes the NGSI-LD API defined by the ETSI ISG CIM group. This Cross-domain Context Information Management API allows to provide, consume and subscribe to context information in multiple scenarios and involving multiple stakeholders",
"version": "latest",
"title": "ETSI ISG CIM / NGSI-LD API",
"contact": {
"email": "NGSI-LD@etsi.org"
}
},
"externalDocs": {
"description": "Find out more about the ETSI ISG Context Information Management",
"url": "https://portal.etsi.org/tb.aspx?tbid=854&SubTB=854"
},
"tags": [
{
"name": "ETSI",
"description": "European Telecommunications Standards Institute",
"externalDocs": {
"description": "Find out more",
"url": "http://www.etsi.org"
}
},
{
"name": "CIM",
"description": "Context Information Management",
"externalDocs": {
"description": "Find out more",
"url": "https://portal.etsi.org/tb.aspx?tbid=854&SubTB=854"
}
},
{
"name": "JSON-LD",
"description": "JSON for Linked Data",
"externalDocs": {
"description": "Find out more",
"url": "https://json-ld.org/"
}
},
{
"name": "NGSI-LD API",
"description": "API defined by the ETSI ISG CIM",
"externalDocs": {
"description": "Preliminary Specification",
"url": "http://www.etsi.org/deliver/etsi_gs/CIM/001_099/004/01.01.01_60/gs_CIM004v010101p.pdf"
}
}
],
"paths": {
"/entities/": {
"$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/spec/updated/entities-spec.json#/paths/%2Fentities%2F"
},
"/entities/{entityId}": {
"$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/spec/updated/entity-by-id-spec.json#/paths/%2Fentities%2F%7BentityId%7D"
},
"/entities/{entityId}/attrs/": {
"$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/spec/updated/entity-attrs-spec.json#/paths/%2Fentities%2F%7BentityId%7D%2Fattrs%2F"
},
"/entities/{entityId}/attrs/{attrId}": {
"$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/spec/updated/entity-attrs-spec.json#/paths/%2Fentities%2F%7BentityId%7D%2Fattrs%2F%7BattrId%7D"
},
"/temporal/entities/": {
"$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/spec/updated/temporal/temporal-entities-spec.json#/paths/%2Ftemporal%2Fentities%2F"
},
"/temporal/entities/{entityId}": {
"$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/spec/updated/temporal/temporal-entity-by-id-spec.json#/paths/%2Ftemporal%2Fentities%2F%7BentityId%7D"
},
"/temporal/entities/{entityId}/attrs/": {
"$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/spec/updated/temporal/temporal-entity-attrs-spec.json#/paths/%2Ftemporal%2Fentities%2F%7BentityId%7D%2Fattrs%2F"
},
"/temporal/entities/{entityId}/attrs/{attrId}": {
"$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/spec/updated/temporal/temporal-entity-attrs-spec.json#/paths/%2Ftemporal%2Fentities%2F%7BentityId%7D%2Fattrs%2F%7BattrId%7D"
},
"/temporal/entities/{entityId}/attrs/{attrId}/{instanceId}": {
"$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/spec/updated/temporal/temporal-entity-attrs-spec.json#/paths/%2Ftemporal%2Fentities%2F%7BentityId%7D%2Fattrs%2F%7BattrId%7D%2F%7BinstanceId%7D"
}
}
}
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