1
0
Fork 0
mirror of synced 2024-09-30 17:26:48 +13:00

Fix mock enum endpoint

This commit is contained in:
Jake Barnby 2023-09-07 19:25:42 -04:00
parent fa01f5d67f
commit d4f6b99ee2
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 6 additions and 6 deletions

View file

@ -445,16 +445,16 @@ App::post('/v1/mock/tests/general/nullable')
});
App::post('/v1/mock/tests/general/enum')
->desc('Nullable Test')
->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', 'nullable')
->label('sdk.description', 'Mock a nullable parameter.')
->label('sdk.method', 'enum')
->label('sdk.description', 'Mock an enum parameter.')
->label('sdk.mock', true)
->param('mockType', '', new WhiteList(['first', 'second', 'third']), 'Sample string param')
->action(function (string $required, string $nullable, ?string $optional) {
->param('mockType', '', new WhiteList(['first', 'second', 'third']), 'Sample enum param')
->action(function (string $mockType) {
});
App::get('/v1/mock/tests/general/400-error')

View file

@ -253,7 +253,7 @@ class Specs extends Action
->setParam('docs.url', $endpoint . '/docs');
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()))) {
throw new Exception('Failed to save mocks spec file: ' . $path);