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

First draft

parent 1e353498
#!/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": {
"title": "ETSI GS MEC 021 Application Mobility Service API",
"version": "2.1.1",
"description": "ETSI GS MEC 021 Application Mobility Service API described using OpenAPI.",
"license": {
"name": "BSD-3-Clause",
"url": "https://forge.etsi.org/legal-matters"
},
"contact": {
"url": "https://forge.etsi.org/rep/mec/gs021-amsi-api"
}
},
"externalDocs": {
"description": "ETSI GS MEC 021 Application Mobility Service API, v2.1.1",
"url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.01.01_60/gs_mec021v020101p.pdf"
},
"servers": [
{
"url": "https://localhost/amsi/v1"
}
],
"openapi": "3.0.0",
"tags": [
{
"name": "adj-app-inst",
"description": "Adjacent App instances"
},
{
"name": "app-mob-ser",
"description": "Application Mobility Services"
},
{
"name": "app-mob-ser-der",
"description": "Application Mobility Services Deregister task"
},
{
"name": "subscriptions",
"description": "Subscription for Application Mobility Service"
}
],
"paths": {
"/app_mobility_services": {
"get": {
"tags": [
"app-mob-ser"
],
"summary": " Retrieve information about the registered application mobility service.",
"description": " Retrieve information about the registered application mobility service.",
"operationId": "app_mobility_serviceGET",
"parameters": [
{
"in": "query",
"name": "filter",
"schema": {
"type": "string"
},
"required": false,
"description": "Attribute-based filtering parameters according to ETSI GS MEC 011"
},
{
"in": "query",
"name": "all_fields",
"schema": {
"type": "string"
},
"required": false,
"description": "Include all complex attributes in the response."
},
{
"in": "query",
"name": "fields",
"schema": {
"type": "string"
},
"required": false,
"description": "Complex attributes to be included into the response. See clause 6.18 in ETSI GS MEC 011"
},
{
"in": "query",
"name": "exclude_fields",
"schema": {
"type": "string"
},
"required": false,
"description": "Complex attributes to be excluded from the response.See clause 6.18 in ETSI GS MEC 011"
},
{
"in": "query",
"name": "exclude_default",
"schema": {
"type": "string"
},
"required": false,
"description": "Indicates to exclude the following complex attributes from the response See clause 6.18 in ETSI GS MEC 011 for details."
}
],
"responses": {
"200": {
"description": "Contains in an array the representations of zero or more application mobility services.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RegistrationInfo"
}
}
}
}
},
"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"
}
}
},
"post": {
"tags": [
"app-mob-ser"
],
"summary": "Create a new application mobility service for the service requester.",
"description": "Create a new application mobility service for the service requester.",
"operationId": "app_mobility_servicePOST",
"requestBody": {
"description": "Application mobility service to be created",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RegistrationInfo"
}
}
}
},
"responses": {
"201": {
"description": "Successful response for application mobility service creation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RegistrationInfo"
}
}
}
},
"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"
}
}
}
},
"/app_mobility_services/{appMobilityServiceId}": {
"parameters": [
{
"in": "path",
"name": "appMobilityServiceId",
"schema": {
"type": "string"
},
"required": true,
"description": "It uniquely identifies the created individual application mobility service"
}
],
"get": {
"tags": [
"app-mob-ser"
],
"summary": "Retrieve information about this individual application mobility service",
"description": "Retrieve information about this individual application mobility service",
"operationId": "app_mobility_service_by_idGET",
"responses": {
"200": {
"description": "Contains a representation of the application mobility service.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RegistrationInfo"
}
}
}
},
"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"
}
}
},
"put": {
"tags": [
"app-mob-ser"
],
"summary": " update the existing individual application mobility service",
"description": " update the existing individual application mobility service",
"operationId": "app_mobility_service_by_idPUT",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RegistrationInfo"
}
}
}
},
"responses": {
"200": {
"description": "Contains a data type describing the updated application mobility service.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RegistrationInfo"
}
}
}
},
"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"
},
"412": {
"$ref": "#/components/responses/412"
},
"422": {
"$ref": "#/components/responses/422"
},
"429": {
"$ref": "#/components/responses/429"
}
}
},
"delete": {
"tags": [
"app-mob-ser"
],
"summary": " deregister the individual application mobility service",
"description": " deregister the individual application mobility service",
"operationId": "app_mobility_service_by_idDELETE",
"responses": {
"204": {
"$ref": "#/components/responses/204"
},
"401": {
"$ref": "#/components/responses/401"
},
"403": {
"$ref": "#/components/responses/403"
},
"404": {
"$ref": "#/components/responses/404"
},
"429": {
"$ref": "#/components/responses/429"
}
}
}
},
"/app_mobility_services/{appMobilityServiceId}/deregister_task": {
"parameters": [
{
"in": "path",
"name": "appMobilityServiceId",
"schema": {
"type": "string"
},
"description": "It uniquely identifies the created individual application mobility service",
"required": true
}
],
"post": {
"tags": [
"app-mob-ser-der"
],
"summary": " deregister the individual application mobility service",
"description": " deregister the individual application mobility service",
"operationId": "app_mobility_service_derPOST",
"responses": {
"204": {
"$ref": "#/components/responses/204"
},
"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"
}
}
}
},
"/subscriptions/": {
"get": {
"tags": [
"subscriptions"
],
"summary": "Retrieve information about the subscriptions for this requestor.",
"description": "Retrieve information about the subscriptions for this requestor.",
"operationId": "subGET",
"parameters": [
{
"in": "query",
"name": "subscriptionType",
"description": "Query parameter to filter on a specific subscription type. Permitted values: mobility_proc or adj_app_info",
"schema": {
"type": "string"
},
"required": true
}
],
"responses": {
"200": {
"description": "Contains the list of links to requestor subscriptions.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubscriptionLinkList"
}
}
}
},
"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"
}
}
},
"post": {
"tags": [
"subscriptions"
],
"summary": "Create a new subscription to Application Mobility Service notifications.",
"description": "Create a new subscription to Application Mobility Service notifications.",
"operationId": "subPOST",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/MobilityProcedureSubscription"
},
{
"$ref": "#/components/schemas/AdjacentAppInfoSubscription"
}
]
}
}
}
},
"responses": {
"201": {
"description": "Created subscription is described using the appropriate data type",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/MobilityProcedureSubscription"
},
{
"$ref": "#/components/schemas/AdjacentAppInfoSubscription"
}
]
}
}
}
},
"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"
},
"415": {
"$ref": "#/components/responses/415"
},
"422": {
"$ref": "#/components/responses/422"
},
"429": {
"$ref": "#/components/responses/429"
}
}
}
},
"/subscriptions/{subscriptionId}": {
"parameters": [
{
"in": "path",
"name": "subscriptionId",
"description": "Refers to created subscription, where the AMS API allocates a unique resource name for this subscription",
"schema": {
"type": "string"
},
"required": true
}
],
"get": {
"tags": [
"subscriptions"
],
"summary": "Retrieve information about this subscription.",
"description": "Retrieve information about this subscription.",
"operationId": "sub_byIdGET",
"responses": {
"200": {
"description": "A response body containing data type describing the specific RNI event subscription",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/MobilityProcedureSubscription"
},
{
"$ref": "#/components/schemas/AdjacentAppInfoSubscription"
}
]
}
}
}
},
"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"
}
}
},
"put": {
"tags": [
"subscriptions"
],
"summary": "update the existing individual subscription.",
"description": "update the existing individual subscription.",
"operationId": "sub_byIdPUT",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/MobilityProcedureSubscription"
},
{
"$ref": "#/components/schemas/AdjacentAppInfoSubscription"
}
]
}
}
}
},
"responses": {
"200": {
"description": " a response body containing data type describing the updated subscription",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/MobilityProcedureSubscription"
},
{
"$ref": "#/components/schemas/AdjacentAppInfoSubscription"
}
]
}
}
}
},
"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"
},
"412": {
"$ref": "#/components/responses/412"
},
"422": {
"$ref": "#/components/responses/422"
},