Commit df701604 authored by Elian Kraja's avatar Elian Kraja
Browse files

Minor fixes on validation

parent 64b3f3de
#!/bin/bash
specfiles=$(ls | egrep "^[^.]*.(json|yaml)")
fres=0
for i in $specfiles ; do
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
{ {
"info": { "info": {
"title": "ETSI GS MEC 010-2 - Part 2: Application lifecycle, rules and requirements management", "title": "ETSI GS MEC 010-2 - Part 2: Application lifecycle, rules and requirements management",
"version": "2.1.1", "version": "2.1.1",
"description": "ETSI GS MEC 010-2 - Part 2: Application lifecycle, rules and requirements management described using OpenAPI.", "description": "ETSI GS MEC 010-2 - Part 2: Application lifecycle, rules and requirements management described using OpenAPI.",
"license": { "license": {
"name": "BSD-3-Clause", "name": "BSD-3-Clause",
"url": "https://forge.etsi.org/legal-matters" "url": "https://forge.etsi.org/legal-matters"
} },
}, "contact": {
"externalDocs": { "url": "https://forge.etsi.org/rep/mec/gs010-2-app-pkg-lcm-api"
"description": "ETSI GS MEC 010-2 - Part 2: Application lifecycle, rules and requirements management, v2.1.1", }
"url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/01002/02.01.01_60/gs_MEC01002v020101p.pdf" },
}, "externalDocs": {
"servers": [ "description": "ETSI GS MEC 010-2 - Part 2: Application lifecycle, rules and requirements management, v2.1.1",
{ "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/01002/02.01.01_60/gs_MEC01002v020101p.pdf"
"url": "https://localhost/granting/v1" },
} "servers": [
], {
"openapi": "3.0.0", "url": "https://localhost/granting/v1"
"tags": [ }
{ ],
"name": "granting", "openapi": "3.0.0",
"description": "Grant operations" "tags": [
} {
], "name": "granting",
"paths": { "description": "Grant operations"
"/grants": { }
"post": { ],
"tags": [ "paths": {
"granting" "/grants": {
], "post": {
"summary": "requests a grant for a particular application lifecycle operation", "tags": [
"description": "requests a grant for a particular application lifecycle operation", "granting"
"operationId": "grantPOST", ],
"requestBody": { "summary": "requests a grant for a particular application lifecycle operation",
"required": true, "description": "requests a grant for a particular application lifecycle operation",
"content": { "operationId": "grantPOST",
"application/json": { "requestBody": {
"schema": { "required": true,
"$ref": "#/components/schemas/GrantRequest"
}
}
}
},
"responses": {
"201": {
"description": "grant was created successfully (synchronous mode)",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Grant" "$ref": "#/components/schemas/GrantRequest"
} }
} }
} }
}, },
"202": { "responses": {
"description": "the request was accepted for processing" "201": {
}, "description": "grant was created successfully (synchronous mode)",
"400": { "content": {
"$ref": "#/components/responses/400" "application/json": {
}, "schema": {
"401": { "$ref": "#/components/schemas/Grant"
"$ref": "#/components/responses/401" }
}, }
"403": { }
"$ref": "#/components/responses/403" },
}, "202": {
"404": { "description": "the request was accepted for processing"
"$ref": "#/components/responses/404" },
}, "400": {
"406": { "$ref": "#/components/responses/400"
"$ref": "#/components/responses/406" },
}, "401": {
"429": { "$ref": "#/components/responses/401"
"$ref": "#/components/responses/429" },
"403": {
"$ref": "#/components/responses/403"
},
"404": {
"$ref": "#/components/responses/404"
},
"406": {
"$ref": "#/components/responses/406"
},
"429": {
"$ref": "#/components/responses/429"
}
} }
} }
} },
}, "/grants/{grantId}": {
"/grants/{grantId}": { "parameters": [
"parameters": [ {
{ "in": "path",
"in": "path", "name": "grantId",
"name": "grantId", "description": "Identifier of the individual grant.",
"schema": { "schema": {
"type": "string" "type": "string"
}, },
"required": true "required": true
} }
],
"get": {
"tags": [
"granting"
], ],
"summary": "read the grant", "get": {
"description": "read the grant", "tags": [
"operationId": "GrantGET", "granting"
"responses": { ],
"200": { "summary": "read the grant",
"description": "IA representation of the \"individual grant\" resource ", "description": "read the grant",
"content": { "operationId": "GrantGET",
"application/json": { "responses": {
"schema": { "200": {
"$ref": "#/components/schemas/Grant" "description": "IA representation of the \"individual grant\" resource ",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Grant"
}
} }
} }
},
"202": {
"description": "returned when the process of creating the grant is ongoing, no grant is available yet"
},
"400": {
"$ref": "#/components/responses/400"
},
"401": {
"$ref": "#/components/responses/401"
},
"403": {
"$ref": "#/components/responses/403"
},
"404": {
"$ref": "#/components/responses/404"
},
"406": {
"$ref": "#/components/responses/406"
},
"429": {
"$ref": "#/components/responses/429"
} }
},
"202": {
"description": "returned when the process of creating the grant is ongoing, no grant is available yet"
},
"400": {
"$ref": "#/components/responses/400"
},
"401": {
"$ref": "#/components/responses/401"
},
"403": {
"$ref": "#/components/responses/403"
},
"404": {
"$ref": "#/components/responses/404"
},
"406": {
"$ref": "#/components/responses/406"
},
"429": {
"$ref": "#/components/responses/429"
} }
} }
} }
} },
}, "components": {
"components": { "schemas": {
"schemas": { "AppExtCpConfig": {
"AppExtCpConfig": { "properties": {
"properties": { "cpInstanceId": {
"cpInstanceId": { "description": "Identifier of the external CP instance to which this set of configuration parameters is requested to be applied. \n\nShall be present if this instance has already been created. ",
"description": "Identifier of the external CP instance to which this set of configuration parameters is requested to be applied. \n\nShall be present if this instance has already been created. ", "type": "string",
"type": "string", "x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String"
"x-etsi-mec-origin-type": "String" },
}, "cpProtocolData": {
"cpProtocolData": { "description": "Parameters for configuring the network protocols on the link port that connects the CP to a VL. See note.",
"description": "Parameters for configuring the network protocols on the link port that connects the CP to a VL. See note.", "items": {
"items": { "$ref": "#/components/schemas/CpProtocolData"
"$ref": "#/components/schemas/CpProtocolData" },
}, "minItems": 0,
"minItems": 0, "type": "array",
"type": "array", "x-etsi-mec-cardinality": "0..N",
"x-etsi-mec-cardinality": "0..N", "x-etsi-mec-origin-type": "CpProtocolData"
"x-etsi-mec-origin-type": "CpProtocolData" },
"linkPortId": {
"description": "Identifier of a pre-configured link port to which the external CP will be associated. See note.",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
}
}, },
"linkPortId": { "type": "object",
"description": "Identifier of a pre-configured link port to which the external CP will be associated. See note.", "x-etsi-notes": "NOTE:\tThe following conditions apply to the attributes \"linkPortId\" and \" cpProtocolData\": \nThe \"linkPortId\" and \"cpProtocolData\" attributes shall both be absent for the deletion of an existing external CP instance addressed by cpInstanceId. \nAt least one of these attributes shall be present for a to-be-created external CP instance or an existing external CP instance.\nIf the \"linkPortId\" attribute is absent, the MEPM shall create a link port.\nIf the \"cpProtocolData\" attribute is absent, the \"linkPortId\" attribute shall be provided referencing a pre-created link port, and the MEPM can use means outside the scope of the present document to obtain the pre-configured address information for the connection point from the resource representing the link port.\nIf both \"cpProtocolData\" and \"linkportId\" are provided, the API consumer shall ensure that the cpProtocolData can be used with the pre-created link port referenced by \"linkPortId\".",
"type": "string", "x-etsi-ref": "6.2.4.13"
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
}
}, },
"type": "object", "AppExtCpData": {
"x-etsi-notes": "NOTE:\tThe following conditions apply to the attributes \"linkPortId\" and \" cpProtocolData\": \nThe \"linkPortId\" and \"cpProtocolData\" attributes shall both be absent for the deletion of an existing external CP instance addressed by cpInstanceId. \nAt least one of these attributes shall be present for a to-be-created external CP instance or an existing external CP instance.\nIf the \"linkPortId\" attribute is absent, the MEPM shall create a link port.\nIf the \"cpProtocolData\" attribute is absent, the \"linkPortId\" attribute shall be provided referencing a pre-created link port, and the MEPM can use means outside the scope of the present document to obtain the pre-configured address information for the connection point from the resource representing the link port.\nIf both \"cpProtocolData\" and \"linkportId\" are provided, the API consumer shall ensure that the cpProtocolData can be used with the pre-created link port referenced by \"linkPortId\".", "properties": {
"x-etsi-ref": "6.2.4.13" "cpConfig": {
}, "description": "List of instance data that need to be configured on the CP instances created from the respective CPD.",
"AppExtCpData": { "items": {
"properties": { "$ref": "#/components/schemas/AppExtCpConfig"
"cpConfig": { },
"description": "List of instance data that need to be configured on the CP instances created from the respective CPD.", "minItems": 1,
"items": { "type": "array",
"$ref": "#/components/schemas/AppExtCpConfig" "x-etsi-mec-cardinality": "1..N",
}, "x-etsi-mec-origin-type": "AppExtCpConfig"
"minItems": 1, },
"type": "array", "cpdId": {
"x-etsi-mec-cardinality": "1..N", "description": "The identifier of the CPD in the AppD.",
"x-etsi-mec-origin-type": "AppExtCpConfig" "type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
}
}, },
"cpdId": { "required": [
"description": "The identifier of the CPD in the AppD.", "cpdId",
"type": "string", "cpConfig"
"x-etsi-mec-cardinality": "1", ],
"x-etsi-mec-origin-type": "String" "type": "object",
} "x-etsi-ref": "6.2.4.12"
}, },
"required": [ "AppInstanceId": {
"cpdId", "description": "Identifier of application instance.",
"cpConfig" "type": "string"
],
"type": "object",
"x-etsi-ref": "6.2.4.12"
},
"AppInstanceId": {
"description": "Identifier of application instance.",
"type": "string"
},
"AppDId": {
"description": "Identifier of this MEC application descriptor. This attribute shall be globally unique.",
"type": "string"
},
"AppLcmOpOccId": {
"description": "Identifier of application lifecycle management operation occurrence.",
"type": "string"
},
"KeyValuePairs": {
"description": "'This data type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key-value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 8259'",
"type": "object",
"additionalProperties": true
},
"ResourceDefinition.Type": {
"description": "Type of the resource definition referenced.",
"type": "string",
"format": "enum",
"enum": [
"COMPUTE",
"VL",
"STORAGE",
"LINKPORT"
]
},
"CpProtocolData": {
"properties": {
"ipOverEthernet": {
"$ref": "#/components/schemas/IpOverEthernetAddressData"
},
"layerProtocol": {
"$ref": "#/components/schemas/IpOverEthernetAddressData"
}
}, },
"required": [ "AppDId": {
"layerProtocol" "description": "Identifier of this MEC application descriptor. This attribute shall be globally unique.",
], "type": "string"
"type": "object",
"x-etsi-notes": "NOTE:\tThis attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.",
"x-etsi-ref": "6.2.4.14"
},
"ExtLinkPortData": {
"properties": {
"id": {
"description": "Identifier of this link port as provided by the entity that has created the link port.",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
},
"resourceHandle": {
"$ref": "#/components/schemas/ResourceHandle"
}
}, },
"required": [ "AppLcmOpOccId": {
"id", "description": "Identifier of application lifecycle management operation occurrence.",
"resourceHandle" "type": "string"
],
"type": "object",
"x-etsi-ref": "6.2.4.9"
},
"ExtVirtualLinkData": {
"properties": {
"extCps": {
"description": "External CPs of the application instance to be connected to this external VL.",
"items": {
"$ref": "#/components/schemas/AppExtCpData"
},
"minItems": 1,
"type": "array",
"x-etsi-mec-cardinality": "1..N",
"x-etsi-mec-origin-type": "AppExtCpData"
},
"extLinkPorts": {
"description": "Externally provided link ports to be used to connect external connection points to this external VL. If this attribute is not present, the MEPM shall create the link ports on the external VL.",
"items": {
"$ref": "#/components/schemas/ExtLinkPortData"
},
"minItems": 0,
"type": "array",
"x-etsi-mec-cardinality": "0..N",
"x-etsi-mec-origin-type": "ExtLinkPortData"
},
"id": {
"description": "The identifier of the external VL instance. The identifier is assigned by the MEC entity that manages this VL instance.",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
},
"resourceId": {
"description": "The identifier of the resource in the scope of the VIM.",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
},
"vimConnectionId": {
"description": "Identifier of the VIM connection to manage this resource. ",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
}
}, },
"required": [ "KeyValuePairs": {
"id", "description": "'This data type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of key-value pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 8259'",
"resourceId", "type": "object",
"extCps" "additionalProperties": true
], },
"type": "object", "ResourceDefinition.Type": {
"x-etsi-ref": "6.2.4.8" "description": "Type of the resource definition referenced.",
}, "type": "string",
"Grant": { "format": "enum",
"description": "'This type represents a grant. Refer to clause 9.5.2.3 of ETSI GS NFV-SOL 003 '", "enum": [
"type": "object", "COMPUTE",
"required": [ "VL",
"id", "STORAGE",
"appInstanceId", "LINKPORT"
"appLcmOpOccId", ]
"_links" },
], "CpProtocolData": {
"properties": { "properties": {
"id": { "ipOverEthernet": {
"$ref": "#/components/schemas/Grant.Id" "$ref": "#/components/schemas/IpOverEthernetAddressData"
}, },
"appInstanceId": { "layerProtocol": {
"$ref": "#/components/schemas/AppInstanceId" "$ref": "#/components/schemas/IpOverEthernetAddressData"
},
"appLcmOpOccId": {
"$ref": "#/components/schemas/AppLcmOpOccId"
},
"vimConnections": {
"type": "array",
"items": {
"$ref": "#/components/schemas/VimConnectionInfo"
}
},
"zones": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ZoneInfo"
}
},
"zoneGroups": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ZoneGroupInfo"
}
},
"addResources": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GrantInfo"
}
},
"tempResources": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GrantInfo"
} }
}, },
"removeResources": { "required": [
"type": "array", "layerProtocol"
"items": { ],
"$ref": "#/components/schemas/GrantInfo" "type": "object",
"x-etsi-notes": "NOTE:\tThis attribute allows to signal the addition of further types of layer and protocol in future versions of the present document in a backwards-compatible way. In the current version of the present document, only IP over Ethernet is supported.",
"x-etsi-ref": "6.2.4.14"
},
"ExtLinkPortData": {
"properties": {
"id": {
"description": "Identifier of this link port as provided by the entity that has created the link port.",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
},
"resourceHandle": {
"$ref": "#/components/schemas/ResourceHandle"
} }
}, },
"updateResources": { "required": [
"type": "array", "id",
"items": { "resourceHandle"
"$ref": "#/components/schemas/GrantInfo" ],
"type": "object",
"x-etsi-ref": "6.2.4.9"
},
"ExtVirtualLinkData": {
"properties": {
"extCps": {
"description": "External CPs of the application instance to be connected to this external VL.",
"items": {
"$ref": "#/components/schemas/AppExtCpData"
},
"minItems": 1,
"type": "array",
"x-etsi-mec-cardinality": "1..N",
"x-etsi-mec-origin-type": "AppExtCpData"
},