1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

Updates to swagger tests

This commit is contained in:
Eldad Fux 2021-06-13 18:01:56 +03:00
parent 01ba5a0738
commit 9f81790761
5 changed files with 23 additions and 8 deletions

View file

@ -233,6 +233,7 @@ App::get('/specs/:format')
->groups(['web', 'home'])
->label('scope', 'public')
->label('docs', false)
->label('origin', '*')
->param('format', 'swagger2', new WhiteList(['swagger2', 'open-api3'], true), 'Spec format.', true)
->param('platform', APP_PLATFORM_CLIENT, new WhiteList([APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER, APP_PLATFORM_CONSOLE], true), 'Choose target platform.', true)
->param('tests', 0, function () {return new Range(0, 1);}, 'Include only test services.', true)

8
composer.lock generated
View file

@ -1607,7 +1607,7 @@
"source": {
"type": "git",
"url": "https://github.com/lohanidamodar/abuse",
"reference": "a7de2639b107af742c21ddd80b54e9edfb540fce"
"reference": "351dba60714321fabcd5028fdf7325f18f343018"
},
"require": {
"ext-pdo": "*",
@ -1641,7 +1641,7 @@
"upf",
"utopia"
],
"time": "2021-06-10T11:05:08+00:00"
"time": "2021-06-13T07:41:20+00:00"
},
{
"name": "utopia-php/analytics",
@ -1704,7 +1704,7 @@
"source": {
"type": "git",
"url": "https://github.com/lohanidamodar/audit",
"reference": "6a3a3cc60e9240f2e8997755b4b8e0f9b8c557aa"
"reference": "b3ca9fa928fdec8c966596cbd85ee1141c79b6eb"
},
"require": {
"ext-pdo": "*",
@ -1738,7 +1738,7 @@
"upf",
"utopia"
],
"time": "2021-06-10T11:05:17+00:00"
"time": "2021-06-13T07:41:15+00:00"
},
{
"name": "utopia-php/cache",

View file

@ -476,6 +476,17 @@ services:
networks:
- appwrite
swagger-validator:
image: 'swaggerapi/swagger-validator-v2:v2.0.5'
container_name: appwrite-swagger-validator
ports:
- '9506:8080'
environment:
- REJECT_LOCAL=false
- REJECT_REDIRECT=false
networks:
- appwrite
# redis-commander:
# image: rediscommander/redis-commander:latest
# restart: unless-stopped

View file

@ -96,7 +96,7 @@ class HTTPTest extends Scope
public function testSpecSwagger2()
{
$response = $this->client->call(Client::METHOD_GET, '/specs/swagger2?platform=client', [
$response = $this->client->call(Client::METHOD_GET, '/specs/swagger2?platform=console', [
'content-type' => 'application/json',
], []);
@ -105,11 +105,13 @@ class HTTPTest extends Scope
}
$client = new Client();
$client->setEndpoint('https://validator.swagger.io');
$client->setEndpoint('http://appwrite-swagger-validator:8080');
/**
* Test for SUCCESS
*/
http://localhost:9506/validator?url=http://petstore.swagger.io/v2/swagger.json
$response = $client->call(Client::METHOD_POST, '/validator/debug', [
'content-type' => 'application/json',
], json_decode(file_get_contents(realpath(__DIR__ . '/../../resources/swagger2.json')), true));
@ -124,7 +126,7 @@ class HTTPTest extends Scope
public function testSpecOpenAPI3()
{
$response = $this->client->call(Client::METHOD_GET, '/specs/open-api3?platform=client', [
$response = $this->client->call(Client::METHOD_GET, '/specs/open-api3?platform=console', [
'content-type' => 'application/json',
], []);
@ -133,7 +135,7 @@ class HTTPTest extends Scope
}
$client = new Client();
$client->setEndpoint('https://validator.swagger.io');
$client->setEndpoint('http://appwrite-swagger-validator:8080');
/**
* Test for SUCCESS

File diff suppressed because one or more lines are too long