Reference

Configuration

Every key of config/openapi.php, its type and its default.

config/openapi.php is published with php artisan vendor:publish --tag=openapi-config and documented key by key in the file. It is read when a command runs, never when the application boots: an unknown top-level key or an invalid value fails the command with the key, the expected value and the received one.

documents

One entry per document; the key is its name (--document=v1, {document} in the file name). The published file declares v1. A key a document leaves out takes the default below.

openapi
string
The version written: 3.0.0 to 3.0.4, 3.1.0 to 3.1.2, 3.2.0. Default 3.1.2.
strict
bool
true: what the version cannot write fails the document. false: dropped with a warning. Default true.
vendor_extensions
none|redoc
redoc: x-webhooks before 3.1, x-tagGroups before 3.2. Default none.
info
array
title, version, summary (3.1), description, terms_of_service, contact (name, url, email), license (name, identifier (3.1), url).
self
?string
The public URI of the document, $self (3.2). Default null.
external_docs
?array
url and description. Default null.
servers
list<array>
The servers of the document; the global servers when empty. Default [].
routes.include
list<string>|array<string, list<string>>
Shell masks on the URI, or a map of masks by uri, name, domain, middleware. null or []: every route. Default ['api/*'].
routes.exclude
list<string>|array<string, list<string>>
Same form; a route matching one mask is left out. Default [].
routes.ignored_methods
list<string>
HTTP methods never documented. Default ['HEAD'].
routes.internal
list<string>
URI masks of Laravel and common packages, always left out. Default RouteFilterConfiguration::INTERNAL (up, sanctum/csrf-cookie, telescope/*, horizon/*, livewire/*…).
routes.order
registration|path
The order of the paths. Default registration.
strategies.summary
array
by: doc (default), name, uri, controller, or a SummaryStrategy class; optional pattern, whose first group is kept.
strategies.tags
array
by: controller (default), uri, name, or a TagStrategy class; optional pattern. Published: /^App\\Http\\Controllers\\(.+)Controller$/.
strategies.groups
?array
null (default), or like tags: the parent tag of each tag. GroupStrategy class accepted.
strategies.operation_id
array
by: name (default when the key is missing), action, method_path, method_name (published), or an OperationIdStrategy class.
strategies.query
array
by: all (default), last, none, querystring (3.2), or a QueryStrategy class.
security_schemes
array<string, array>
Security Scheme Objects by name (OpenAPI field names, camelCase), completing or replacing those of the middlewares. Default [].
security
list<string>
Schemes required by default on every operation. Default [].
use_references
bool
Resources and enums as components.schemas referenced by $ref. Default true.
output
array
Overrides of the global output. Published: ['file' => 'openapi-{document}.json'].
extensions
array<string, mixed>
x-* extensions of the document root. Default [].
integrations
array<string, array>
Settings of the integrations for this document, by key; a key no available integration reads is a warning. json_api.revision with ark4ne/laravel-json-api 3.x. Default [].
webhooks
array
Overrides of the global webhooks, key by key Since 1.3. ['paths' => []]: no payload webhook found by scanning.

webhooks Since 1.3

Where the payload webhooks are found: the JsonResource classes marked #[Webhook]. A document overrides these keys in its own webhooks. See Webhooks & callbacks.

paths
list<string>
Directories scanned recursively, or PHP files; only the files that mention Webhook are read. Published: [app_path()]. Without the key: [].
classes
list<class-string>
Payload classes listed as given. A class that is not a concrete JsonResource marked #[Webhook] fails the command. Default [].
include
list<string>
Shell masks on the names of the webhooks kept, route webhooks included (article.*). Default []: every webhook.
exclude
list<string>
Shell masks on the names of the webhooks left out, over include. Default [].

servers

The default servers of every document. Default: APP_URL, described by APP_NAME.

url
string required
The URL; parts may be variables: https://{env}.example.com.
description
?string
Its description.
name
?string
Its name (3.2).
variables
array<string, array>
By name: default, enum, description.

output

disk
?string
A filesystem disk; null: the default disk.
directory
string
Default openapi.
file
string
{document} and {locale} are replaced. Default {document}.json.
format
json|yaml
yaml needs symfony/yaml. Default json.

sampling

transactions
bool
Factories create() inside a transaction rolled back at the end; false: make() only. Default true.
connections
list<string>
The drivers a transaction is opened for. Default ['mariadb', 'mysql', 'pgsql', 'sqlite', 'sqlsrv'].
collection_size
int
The number of items of a sampled collection. Default 2.
seed
int
The seed of the fake values. Default 1.
examples
bool
Write the sampled scalars as example. Default true.

date_formats

PHP date format → OpenAPI format (date, date-time), for date_format: and the sampled values. Default: Y-m-d → date, Y-m-d H:i:s → date-time, DateTimeInterface::ATOM → date-time.

middlewares

Middleware name or class → list of MiddlewareMapper classes, replacing the built-in mappers of that middleware. Default []. See Middleware mappers.

extensions

Classes added to the registries, built through the container. See Extending.

operation_extractors
list<class-string>
OperationExtractor classes.
request_extractors
list<class-string>
RequestExtractor classes.
rule_mappers
list<class-string>
RuleMapper classes.
response_extractors
list<class-string>
ResponseExtractor classes.
samplers
list<class-string>
Sampler classes.
passes
list<class-string>
Pass classes.

integrations

json_api.errors
bool
Error responses as JSON:API error documents, with ark4ne/laravel-json-api. Default false.

exceptions

read_throws
bool
Read the @throws of the actions. Default true.
map
array<class-string, int|array>
Exception class → status, or ['status' => …, 'description' => …]. The exception or its closest parent wins. Default [].

languages

list<string>: one document per locale; summaries, descriptions and tags may be translation keys. Default []: one document in the application locale. See Translations.