mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 01:18:37 +00:00
commit
7f4e5f0111
2 changed files with 14 additions and 1 deletions
|
|
@ -444,6 +444,19 @@ App::post('/v1/mock/tests/general/nullable')
|
||||||
->action(function (string $required, string $nullable, ?string $optional) {
|
->action(function (string $required, string $nullable, ?string $optional) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
App::post('/v1/mock/tests/general/enum')
|
||||||
|
->desc('Enum Test')
|
||||||
|
->groups(['mock'])
|
||||||
|
->label('scope', 'public')
|
||||||
|
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||||
|
->label('sdk.namespace', 'general')
|
||||||
|
->label('sdk.method', 'enum')
|
||||||
|
->label('sdk.description', 'Mock an enum parameter.')
|
||||||
|
->label('sdk.mock', true)
|
||||||
|
->param('mockType', '', new WhiteList(['first', 'second', 'third']), 'Sample enum param')
|
||||||
|
->action(function (string $mockType) {
|
||||||
|
});
|
||||||
|
|
||||||
App::get('/v1/mock/tests/general/400-error')
|
App::get('/v1/mock/tests/general/400-error')
|
||||||
->desc('400 Error')
|
->desc('400 Error')
|
||||||
->groups(['mock'])
|
->groups(['mock'])
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ class Specs extends Action
|
||||||
->setParam('docs.url', $endpoint . '/docs');
|
->setParam('docs.url', $endpoint . '/docs');
|
||||||
|
|
||||||
if ($mocks) {
|
if ($mocks) {
|
||||||
$path = __DIR__ . '/../config/specs/' . $format . '-mocks-' . $platform . '.json';
|
$path = __DIR__ . '/../../../../app/config/specs/' . $format . '-mocks-' . $platform . '.json';
|
||||||
|
|
||||||
if (!file_put_contents($path, json_encode($specs->parse()))) {
|
if (!file_put_contents($path, json_encode($specs->parse()))) {
|
||||||
throw new Exception('Failed to save mocks spec file: ' . $path);
|
throw new Exception('Failed to save mocks spec file: ' . $path);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue