Skip to content

LuminousOpenAPI from your Laravel code

Generate OpenAPI 3.2 docs from PHP 8 Attributes. No YAML files to maintain. No docblocks to parse.

Luminous

From attributes to a spec

The controller you already have, and the OpenAPI it becomes.

php
#[ApiTag('Payments')]
class PaymentController extends Controller
{
    #[ApiOperation('Create a payment')]
    #[ApiResponse(201, PaymentResource::class, 'Payment created')]
    #[ApiResponse(422, ErrorResource::class, 'Validation failed')]
    public function store(CreatePaymentRequest $request): JsonResponse
    {
        // ...
    }
}
yaml
/api/payments:
  post:
    tags: [Payments]
    summary: Create a payment
    requestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreatePaymentRequest'
    responses:
      '201':
        description: Payment created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentResource'
      '422':
        description: Validation failed
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ErrorResource'