diff --git a/linter/testcases/servers-empty/expected-output.txt b/linter/testcases/servers-empty/expected-output.txt new file mode 100644 index 00000000..866834c1 --- /dev/null +++ b/linter/testcases/servers-empty/expected-output.txt @@ -0,0 +1,5 @@ + +/testcases/servers-empty/openapi.json + 13:15 error oas3-api-servers OpenAPI "servers" must be present and non-empty array. servers + +✖ 1 problem (1 error, 0 warnings, 0 infos, 0 hints) diff --git a/linter/testcases/servers-empty/openapi.json b/linter/testcases/servers-empty/openapi.json new file mode 100644 index 00000000..ed9d662f --- /dev/null +++ b/linter/testcases/servers-empty/openapi.json @@ -0,0 +1,76 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Baseline", + "description": "Deze OpenAPI specification bevat het minimale om aan alle regels te voldoen.", + "contact": { + "name": "Beheerder", + "url": "https://www.example.com", + "email": "mail@example.com" + }, + "version": "1.0.0" + }, + "servers": [], + "security": [ + { + "default": [] + } + ], + "tags": [ + { + "name": "openapi" + } + ], + "paths": { + "/openapi.json": { + "get": { + "tags": [ + "openapi" + ], + "description": "OpenAPI document", + "operationId": "getOpenapiJSON", + "parameters": [], + "responses": { + "200": { + "description": "OK", + "headers": { + "API-Version": { + "description": "De huidige versie van de applicatie", + "style": "simple", + "schema": { + "type": "string" + } + }, + "access-control-allow-origin": { + "description": "Alle origins mogen bij deze resource", + "schema": { + "type": "string" + } + } + } + } + }, + "security": [ + { + "default": [] + } + ] + } + } + }, + "components": { + "schemas": { + }, + "securitySchemes": { + "default": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "https://test.com", + "scopes": {} + } + } + } + } + } +} \ No newline at end of file diff --git a/linter/testcases/servers-missing/expected-output.txt b/linter/testcases/servers-missing/expected-output.txt index 224036f0..3ffa138d 100644 --- a/linter/testcases/servers-missing/expected-output.txt +++ b/linter/testcases/servers-missing/expected-output.txt @@ -1,5 +1,5 @@ /testcases/servers-missing/openapi.json - 13:15 error oas3-api-servers OpenAPI "servers" must be present and non-empty array. servers + 1:1 error oas3-api-servers OpenAPI "servers" must be present and non-empty array. ✖ 1 problem (1 error, 0 warnings, 0 infos, 0 hints) diff --git a/linter/testcases/servers-missing/openapi.json b/linter/testcases/servers-missing/openapi.json index ed9d662f..5676b64e 100644 --- a/linter/testcases/servers-missing/openapi.json +++ b/linter/testcases/servers-missing/openapi.json @@ -10,7 +10,6 @@ }, "version": "1.0.0" }, - "servers": [], "security": [ { "default": []