Skip to content

Commit 399f1ec

Browse files
matiasperronematiasperrone-exo
authored andcommitted
chore: Initial setup for OpenAPI 3.1 documentation
1 parent 13cff1e commit 399f1ec

File tree

7 files changed

+825
-3
lines changed

7 files changed

+825
-3
lines changed

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,8 @@ OTEL_TRACES_SAMPLER_PARENT=false
149149
# OTEL_INSTRUMENTATION_VIEW=true
150150
# OTEL_INSTRUMENTATION_LIVEWIRE=true
151151
# OTEL_INSTRUMENTATION_CONSOLE=true
152+
153+
# OpenAPI CONFIG
154+
# L5_FORMAT_TO_USE_FOR_DOCS=yaml
155+
L5_SWAGGER_GENERATE_ALWAYS=true # Dev setting
156+
L5_SWAGGER_OPEN_API_SPEC_VERSION=3.1.0

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Homestead.yaml
1515
Homestead.json
1616
.env
1717
.env.*
18-
storage/proxies
18+
storage/*
1919
/public/assets/jquery-cookie/
2020
/public/assets/crypto-js/
2121
/public/assets/bootstrap-tagsinput/

app/Swagger/GenericSchemas.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
#[OA\Schema(
9+
schema: 'PaginateDataSchemaResponse',
10+
type: 'object',
11+
properties: [
12+
new OA\Property(property: 'total', type: 'integer', example: 6),
13+
new OA\Property(property: 'per_page', type: 'integer', example: 5),
14+
new OA\Property(property: 'current_page', type: 'integer', example: 1),
15+
new OA\Property(property: 'last_page', type: 'integer', example: 2),
16+
],
17+
description: 'Base pagination metadata'
18+
)]
19+
class PaginateDataSchemaResponseSchema
20+
{
21+
}

app/Swagger/OpenApiInfo.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace App\Swagger;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Info(
8+
version: "1.0.0",
9+
title: "OpenStackID API",
10+
description: "OpenStackID IDP API Documentation - OAuth2, OpenID Connect, and User Management",
11+
contact: new OA\Contact(
12+
name: "OpenStack Foundation",
13+
email: "support@openstack.org"
14+
),
15+
license: new OA\License(
16+
name: "MIT",
17+
url: "https://opensource.org/licenses/MIT"
18+
)
19+
)]
20+
#[OA\Server(
21+
url: "/",
22+
description: "IDP API Server"
23+
)]
24+
#[OA\SecurityScheme(
25+
securityScheme: "bearerAuth",
26+
type: "http",
27+
scheme: "bearer",
28+
bearerFormat: "JWT"
29+
)]
30+
#[OA\Tag(name: "Users", description: "User management endpoints")]
31+
#[OA\Tag(name: "Groups", description: "Group management endpoints")]
32+
class OpenApiInfo
33+
{
34+
}
35+

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"ext-pdo": "*",
2525
"beberlei/doctrineextensions": "1.5.0",
2626
"behat/transliterator": "1.5.0",
27+
"darkaonline/l5-swagger": "^9.0",
2728
"ezyang/htmlpurifier": "v4.17.0",
2829
"firebase/php-jwt": "6.11.1",
2930
"get-stream/stream-chat": "^3.10.0",
@@ -59,7 +60,8 @@
5960
"socialiteproviders/okta": "^4.5.0",
6061
"socialiteproviders/zoho": "^4.1",
6162
"sokil/php-isocodes": "^3.0",
62-
"vladimir-yuldashev/laravel-queue-rabbitmq": "v14.2.0"
63+
"vladimir-yuldashev/laravel-queue-rabbitmq": "v14.2.0",
64+
"zircote/swagger-php": "^5.8"
6365
},
6466
"require-dev": {
6567
"fakerphp/faker": "^1.23",

0 commit comments

Comments
 (0)