Merge pull request #3373 from mattstein/api-project-description
feat: Expose project description in API response
This commit is contained in:
@@ -86,7 +86,7 @@ class DeployController extends Controller
|
|||||||
],
|
],
|
||||||
tags: ['Deployments'],
|
tags: ['Deployments'],
|
||||||
parameters: [
|
parameters: [
|
||||||
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Deployment Uuid', schema: new OA\Schema(type: 'string')),
|
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Deployment UUID', schema: new OA\Schema(type: 'string')),
|
||||||
],
|
],
|
||||||
responses: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
@@ -150,7 +150,7 @@ class DeployController extends Controller
|
|||||||
responses: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
response: 200,
|
response: 200,
|
||||||
description: 'Get deployment(s) Uuid\'s',
|
description: 'Get deployment(s) UUID\'s',
|
||||||
content: [
|
content: [
|
||||||
new OA\MediaType(
|
new OA\MediaType(
|
||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class ProjectController extends Controller
|
|||||||
{
|
{
|
||||||
#[OA\Get(
|
#[OA\Get(
|
||||||
summary: 'List',
|
summary: 'List',
|
||||||
description: 'list projects.',
|
description: 'List projects.',
|
||||||
path: '/projects',
|
path: '/projects',
|
||||||
operationId: 'list-projects',
|
operationId: 'list-projects',
|
||||||
security: [
|
security: [
|
||||||
@@ -47,7 +47,7 @@ class ProjectController extends Controller
|
|||||||
if (is_null($teamId)) {
|
if (is_null($teamId)) {
|
||||||
return invalidTokenResponse();
|
return invalidTokenResponse();
|
||||||
}
|
}
|
||||||
$projects = Project::whereTeamId($teamId)->select('id', 'name', 'uuid')->get();
|
$projects = Project::whereTeamId($teamId)->select('id', 'name', 'description', 'uuid')->get();
|
||||||
|
|
||||||
return response()->json(serializeApiResponse($projects),
|
return response()->json(serializeApiResponse($projects),
|
||||||
);
|
);
|
||||||
@@ -55,7 +55,7 @@ class ProjectController extends Controller
|
|||||||
|
|
||||||
#[OA\Get(
|
#[OA\Get(
|
||||||
summary: 'Get',
|
summary: 'Get',
|
||||||
description: 'Get project by Uuid.',
|
description: 'Get project by UUID.',
|
||||||
path: '/projects/{uuid}',
|
path: '/projects/{uuid}',
|
||||||
operationId: 'get-project-by-uuid',
|
operationId: 'get-project-by-uuid',
|
||||||
security: [
|
security: [
|
||||||
@@ -139,7 +139,7 @@ class ProjectController extends Controller
|
|||||||
return invalidTokenResponse();
|
return invalidTokenResponse();
|
||||||
}
|
}
|
||||||
if (! $request->uuid) {
|
if (! $request->uuid) {
|
||||||
return response()->json(['message' => 'Uuid is required.'], 422);
|
return response()->json(['message' => 'UUID is required.'], 422);
|
||||||
}
|
}
|
||||||
if (! $request->environment_name) {
|
if (! $request->environment_name) {
|
||||||
return response()->json(['message' => 'Environment name is required.'], 422);
|
return response()->json(['message' => 'Environment name is required.'], 422);
|
||||||
@@ -341,7 +341,7 @@ class ProjectController extends Controller
|
|||||||
}
|
}
|
||||||
$uuid = $request->uuid;
|
$uuid = $request->uuid;
|
||||||
if (! $uuid) {
|
if (! $uuid) {
|
||||||
return response()->json(['message' => 'Uuid is required.'], 422);
|
return response()->json(['message' => 'UUID is required.'], 422);
|
||||||
}
|
}
|
||||||
|
|
||||||
$project = Project::whereTeamId($teamId)->whereUuid($uuid)->first();
|
$project = Project::whereTeamId($teamId)->whereUuid($uuid)->first();
|
||||||
@@ -417,7 +417,7 @@ class ProjectController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! $request->uuid) {
|
if (! $request->uuid) {
|
||||||
return response()->json(['message' => 'Uuid is required.'], 422);
|
return response()->json(['message' => 'UUID is required.'], 422);
|
||||||
}
|
}
|
||||||
$project = Project::whereTeamId($teamId)->whereUuid($request->uuid)->first();
|
$project = Project::whereTeamId($teamId)->whereUuid($request->uuid)->first();
|
||||||
if (! $project) {
|
if (! $project) {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class SecurityController extends Controller
|
|||||||
],
|
],
|
||||||
tags: ['Private Keys'],
|
tags: ['Private Keys'],
|
||||||
parameters: [
|
parameters: [
|
||||||
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Private Key Uuid', schema: new OA\Schema(type: 'string')),
|
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Private Key UUID', schema: new OA\Schema(type: 'string')),
|
||||||
],
|
],
|
||||||
responses: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
@@ -323,7 +323,7 @@ class SecurityController extends Controller
|
|||||||
],
|
],
|
||||||
tags: ['Private Keys'],
|
tags: ['Private Keys'],
|
||||||
parameters: [
|
parameters: [
|
||||||
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Private Key Uuid', schema: new OA\Schema(type: 'string')),
|
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Private Key UUID', schema: new OA\Schema(type: 'string')),
|
||||||
],
|
],
|
||||||
responses: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class ServersController extends Controller
|
|||||||
],
|
],
|
||||||
tags: ['Servers'],
|
tags: ['Servers'],
|
||||||
parameters: [
|
parameters: [
|
||||||
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server\'s Uuid', schema: new OA\Schema(type: 'string')),
|
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server\'s UUID', schema: new OA\Schema(type: 'string')),
|
||||||
],
|
],
|
||||||
responses: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
@@ -185,7 +185,7 @@ class ServersController extends Controller
|
|||||||
],
|
],
|
||||||
tags: ['Servers'],
|
tags: ['Servers'],
|
||||||
parameters: [
|
parameters: [
|
||||||
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server\'s Uuid', schema: new OA\Schema(type: 'string')),
|
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server\'s UUID', schema: new OA\Schema(type: 'string')),
|
||||||
],
|
],
|
||||||
responses: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
@@ -263,7 +263,7 @@ class ServersController extends Controller
|
|||||||
],
|
],
|
||||||
tags: ['Servers'],
|
tags: ['Servers'],
|
||||||
parameters: [
|
parameters: [
|
||||||
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server\'s Uuid', schema: new OA\Schema(type: 'string')),
|
new OA\Parameter(name: 'uuid', in: 'path', required: true, description: 'Server\'s UUID', schema: new OA\Schema(type: 'string')),
|
||||||
],
|
],
|
||||||
responses: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ class ServicesController extends Controller
|
|||||||
responses: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
response: 200,
|
response: 200,
|
||||||
description: 'Get a service by Uuid.',
|
description: 'Get a service by UUID.',
|
||||||
content: [
|
content: [
|
||||||
new OA\MediaType(
|
new OA\MediaType(
|
||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
@@ -436,7 +436,7 @@ class ServicesController extends Controller
|
|||||||
responses: [
|
responses: [
|
||||||
new OA\Response(
|
new OA\Response(
|
||||||
response: 200,
|
response: 200,
|
||||||
description: 'Delete a service by Uuid',
|
description: 'Delete a service by UUID',
|
||||||
content: [
|
content: [
|
||||||
new OA\MediaType(
|
new OA\MediaType(
|
||||||
mediaType: 'application/json',
|
mediaType: 'application/json',
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use OpenApi\Attributes as OA;
|
|||||||
'id' => ['type' => 'integer'],
|
'id' => ['type' => 'integer'],
|
||||||
'uuid' => ['type' => 'string'],
|
'uuid' => ['type' => 'string'],
|
||||||
'name' => ['type' => 'string'],
|
'name' => ['type' => 'string'],
|
||||||
|
'description' => ['type' => 'string'],
|
||||||
'environments' => new OA\Property(
|
'environments' => new OA\Property(
|
||||||
property: 'environments',
|
property: 'environments',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
|||||||
Reference in New Issue
Block a user