[{"data":1,"prerenderedAt":831},["ShallowReactive",2],{"libs":3,"navigation-laravel-openapi-generator":115,"\u002Flaravel-openapi-generator\u002Fworkflow\u002Fdiagnostics":296,"\u002Flaravel-openapi-generator\u002Fworkflow\u002Fdiagnostics-surround":826},[4,45,69,95],{"id":5,"color":6,"compatibility":7,"extension":20,"icon":21,"links":22,"meta":27,"name":28,"order":29,"package":30,"related":31,"stem":34,"tagline":35,"__hash__":36,"slug":37,"repository":38,"branch":39,"path":40,"collection":41,"entry":42,"home":43,"version":44},"laravel_json_api_meta\u002Fdocs\u002Fsite\u002Flib.yml","violet",[8,13,16],{"version":9,"php":10,"laravel":11,"status":12},"3.x","^8.3","^12.46 || ^13.0","active",{"version":14,"php":10,"laravel":11,"status":15},"2.x","eol",{"version":17,"php":18,"laravel":19,"status":15},"1.x","^8.1","^10.0 || ^11.0 || ^12.0 || ^13.0","yml","i-lucide-braces",[23],{"label":24,"to":25,"icon":26},"JSON:API 1.1","https:\u002F\u002Fjsonapi.org\u002Fformat\u002F","i-lucide-book-marked",{},"Laravel JSON:API",10,"ark4ne\u002Flaravel-json-api",[32,33],"laravel-api-revisions","laravel-openapi-generator","docs\u002Fsite\u002Flib","JSON:API 1.1 resources for Laravel, with typed values, validated includes and fieldsets, and API revisions.","ILGoVp9rzKYDQc18VV8kkXy3EQOQ8rv87JblFKXYDrU","laravel-json-api","Ark4ne\u002Flaravel-json-api","master","docs\u002Fsite","laravel_json_api","\u002Flaravel-json-api\u002Fgetting-started\u002Fintroduction","\u002Flaravel-json-api","v3.0.0",{"id":46,"color":47,"compatibility":48,"extension":20,"icon":50,"links":51,"meta":56,"name":57,"order":58,"package":59,"related":60,"stem":34,"tagline":61,"__hash__":62,"slug":32,"repository":63,"branch":64,"path":40,"collection":65,"entry":66,"home":67,"version":68},"laravel_api_revisions_meta\u002Fdocs\u002Fsite\u002Flib.yml","amber",[49],{"version":17,"php":10,"laravel":11,"status":12},"i-lucide-git-branch",[52],{"label":53,"to":54,"icon":55},"Agent skill","https:\u002F\u002Fgithub.com\u002FArk4ne\u002Flaravel-api-revisions\u002Ftree\u002Fmain\u002Fskills\u002Flaravel-api-revisions","i-lucide-bot",{},"Laravel API Revisions",20,"ark4ne\u002Flaravel-api-revisions",[37,33],"Typed schemas for Laravel resources and form requests, evolved through dated API revisions, Stripe-style.","w24MBVK4_XliIZ8nVcfnuT9OgR-m-Ytxz31Pxua_mLM","Ark4ne\u002Flaravel-api-revisions","main","laravel_api_revisions","\u002Flaravel-api-revisions\u002Fgetting-started\u002Fintroduction","\u002Flaravel-api-revisions","v1.0.0",{"id":70,"color":71,"compatibility":72,"extension":20,"icon":77,"links":78,"meta":82,"name":83,"order":84,"package":85,"related":86,"stem":34,"tagline":88,"__hash__":89,"slug":33,"repository":90,"branch":39,"path":40,"collection":91,"entry":92,"home":93,"version":94},"laravel_openapi_generator_meta\u002Fdocs\u002Fsite\u002Flib.yml","emerald",[73,75],{"version":17,"php":10,"laravel":74,"status":12},"^13.0",{"version":76,"php":18,"laravel":19,"status":15},"0.6","i-lucide-file-json",[79],{"label":80,"to":81,"icon":26},"OpenAPI Specification","https:\u002F\u002Fspec.openapis.org\u002Foas\u002Flatest.html",{},"Laravel OpenAPI Generator",30,"ark4ne\u002Flaravel-openapi-generator",[87,37,32],"openapi-writer","Generates OpenAPI 3.0, 3.1 and 3.2 documents from a Laravel application, its routes, form requests and resources.","DTt0SVqegMImLmWmwL8LCW5lxRCWFYcnBFOaquLpVwc","Ark4ne\u002Flaravel-openapi-generator","laravel_openapi_generator","\u002Flaravel-openapi-generator\u002Fgetting-started\u002Fintroduction","\u002Flaravel-openapi-generator","v1.2.0",{"id":96,"color":97,"compatibility":98,"extension":20,"icon":101,"links":102,"meta":104,"name":105,"order":106,"package":107,"related":108,"stem":34,"tagline":109,"__hash__":110,"slug":87,"repository":111,"branch":64,"path":40,"collection":112,"entry":113,"home":114,"version":68},"openapi_writer_meta\u002Fdocs\u002Fsite\u002Flib.yml","sky",[99],{"version":17,"php":100,"status":12},"^8.2","i-lucide-file-pen-line",[103],{"label":80,"to":81,"icon":26},{},"OpenAPI Writer",40,"ark4ne\u002Fopenapi-writer",[33],"Framework-agnostic, fluent and immutable PHP builder for OpenAPI 3.0, 3.1 and 3.2 documents, written as JSON or YAML and validated.","JFQcdQ9GEChOkfRKibLjoxZOfnt6HYNsayX2melOzMk","Ark4ne\u002Fopenapi-writer","openapi_writer","\u002Fopenapi-writer\u002Fgetting-started\u002Fintroduction","\u002Fopenapi-writer",[116,135,169,191,213,243,258,284],{"title":117,"since":118,"experimental":119,"icon":120,"path":121,"stem":122,"children":123,"page":119},"Getting started",null,false,"i-lucide-rocket","\u002Flaravel-openapi-generator\u002Fgetting-started","laravel-openapi-generator\u002F1.getting-started",[124,127,131],{"title":125,"path":92,"stem":126,"since":118,"experimental":119},"Introduction","laravel-openapi-generator\u002F1.getting-started\u002F1.introduction",{"title":128,"path":129,"stem":130,"since":118,"experimental":119},"Installation","\u002Flaravel-openapi-generator\u002Fgetting-started\u002Finstallation","laravel-openapi-generator\u002F1.getting-started\u002F2.installation",{"title":132,"path":133,"stem":134,"since":118,"experimental":119},"Quick start","\u002Flaravel-openapi-generator\u002Fgetting-started\u002Fquick-start","laravel-openapi-generator\u002F1.getting-started\u002F3.quick-start",{"title":136,"since":118,"experimental":119,"icon":137,"path":138,"stem":139,"children":140,"page":119},"Documenting endpoints","i-lucide-route","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints","laravel-openapi-generator\u002F2.documenting-endpoints",[141,145,149,153,157,161,165],{"title":142,"path":143,"stem":144,"since":118,"experimental":119},"How it works","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fhow-it-works","laravel-openapi-generator\u002F2.documenting-endpoints\u002F1.how-it-works",{"title":146,"path":147,"stem":148,"since":118,"experimental":119},"Routes & operations","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Froutes-and-operations","laravel-openapi-generator\u002F2.documenting-endpoints\u002F2.routes-and-operations",{"title":150,"path":151,"stem":152,"since":118,"experimental":119},"Requests","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Frequests","laravel-openapi-generator\u002F2.documenting-endpoints\u002F3.requests",{"title":154,"path":155,"stem":156,"since":118,"experimental":119},"Responses","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fresponses","laravel-openapi-generator\u002F2.documenting-endpoints\u002F4.responses",{"title":158,"path":159,"stem":160,"since":118,"experimental":119},"Sampling","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fsampling","laravel-openapi-generator\u002F2.documenting-endpoints\u002F5.sampling",{"title":162,"path":163,"stem":164,"since":118,"experimental":119},"Security & errors","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fsecurity-and-errors","laravel-openapi-generator\u002F2.documenting-endpoints\u002F6.security-and-errors",{"title":166,"path":167,"stem":168,"since":118,"experimental":119},"Webhooks & callbacks","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fwebhooks-and-callbacks","laravel-openapi-generator\u002F2.documenting-endpoints\u002F7.webhooks-and-callbacks",{"title":170,"since":118,"experimental":119,"icon":171,"path":172,"stem":173,"children":174,"page":119},"Documents","i-lucide-files","\u002Flaravel-openapi-generator\u002Fdocuments","laravel-openapi-generator\u002F3.documents",[175,179,183,187],{"title":176,"path":177,"stem":178,"since":118,"experimental":119},"Configuring a document","\u002Flaravel-openapi-generator\u002Fdocuments\u002Fconfiguring-a-document","laravel-openapi-generator\u002F3.documents\u002F1.configuring-a-document",{"title":180,"path":181,"stem":182,"since":118,"experimental":119},"Several documents","\u002Flaravel-openapi-generator\u002Fdocuments\u002Fseveral-documents","laravel-openapi-generator\u002F3.documents\u002F2.several-documents",{"title":184,"path":185,"stem":186,"since":118,"experimental":119},"Output","\u002Flaravel-openapi-generator\u002Fdocuments\u002Foutput","laravel-openapi-generator\u002F3.documents\u002F3.output",{"title":188,"path":189,"stem":190,"since":118,"experimental":119},"Translations","\u002Flaravel-openapi-generator\u002Fdocuments\u002Ftranslations","laravel-openapi-generator\u002F3.documents\u002F4.translations",{"title":192,"since":118,"experimental":119,"icon":193,"path":194,"stem":195,"children":196,"page":119},"Workflow","i-lucide-terminal","\u002Flaravel-openapi-generator\u002Fworkflow","laravel-openapi-generator\u002F4.workflow",[197,201,205,209],{"title":198,"path":199,"stem":200,"since":118,"experimental":119},"Diagnostics","\u002Flaravel-openapi-generator\u002Fworkflow\u002Fdiagnostics","laravel-openapi-generator\u002F4.workflow\u002F1.diagnostics",{"title":202,"path":203,"stem":204,"since":118,"experimental":119},"Continuous integration","\u002Flaravel-openapi-generator\u002Fworkflow\u002Fcontinuous-integration","laravel-openapi-generator\u002F4.workflow\u002F2.continuous-integration",{"title":206,"path":207,"stem":208,"since":118,"experimental":119},"Troubleshooting","\u002Flaravel-openapi-generator\u002Fworkflow\u002Ftroubleshooting","laravel-openapi-generator\u002F4.workflow\u002F3.troubleshooting",{"title":210,"path":211,"stem":212,"since":118,"experimental":119},"Agent skills","\u002Flaravel-openapi-generator\u002Fworkflow\u002Fagent-skills","laravel-openapi-generator\u002F4.workflow\u002F4.agent-skills",{"title":214,"since":118,"experimental":119,"icon":215,"path":216,"stem":217,"children":218,"page":119},"Extending","i-lucide-puzzle","\u002Flaravel-openapi-generator\u002Fextending","laravel-openapi-generator\u002F5.extending",[219,223,227,231,235,239],{"title":220,"path":221,"stem":222,"since":118,"experimental":119},"Overview","\u002Flaravel-openapi-generator\u002Fextending\u002Foverview","laravel-openapi-generator\u002F5.extending\u002F1.overview",{"title":224,"path":225,"stem":226,"since":118,"experimental":119},"Rule mappers","\u002Flaravel-openapi-generator\u002Fextending\u002Frule-mappers","laravel-openapi-generator\u002F5.extending\u002F2.rule-mappers",{"title":228,"path":229,"stem":230,"since":118,"experimental":119},"Request & response extractors","\u002Flaravel-openapi-generator\u002Fextending\u002Frequest-and-response-extractors","laravel-openapi-generator\u002F5.extending\u002F3.request-and-response-extractors",{"title":232,"path":233,"stem":234,"since":118,"experimental":119},"Operations & strategies","\u002Flaravel-openapi-generator\u002Fextending\u002Foperations-and-strategies","laravel-openapi-generator\u002F5.extending\u002F4.operations-and-strategies",{"title":236,"path":237,"stem":238,"since":118,"experimental":119},"Samplers","\u002Flaravel-openapi-generator\u002Fextending\u002Fsamplers","laravel-openapi-generator\u002F5.extending\u002F5.samplers",{"title":240,"path":241,"stem":242,"since":118,"experimental":119},"Passes & middlewares","\u002Flaravel-openapi-generator\u002Fextending\u002Fpasses-and-middlewares","laravel-openapi-generator\u002F5.extending\u002F6.passes-and-middlewares",{"title":244,"since":118,"experimental":119,"icon":245,"path":246,"stem":247,"children":248,"page":119},"Integrations","i-lucide-plug","\u002Flaravel-openapi-generator\u002Fintegrations","laravel-openapi-generator\u002F6.integrations",[249,253],{"title":250,"path":251,"stem":252,"since":118,"experimental":119},"JSON:API","\u002Flaravel-openapi-generator\u002Fintegrations\u002Fjson-api","laravel-openapi-generator\u002F6.integrations\u002F1.json-api",{"title":254,"path":255,"stem":256,"since":257,"experimental":119},"API revisions","\u002Flaravel-openapi-generator\u002Fintegrations\u002Fapi-revisions","laravel-openapi-generator\u002F6.integrations\u002F2.api-revisions","1.2",{"title":259,"since":118,"experimental":119,"icon":260,"path":261,"stem":262,"children":263,"page":119},"Reference","i-lucide-library","\u002Flaravel-openapi-generator\u002Freference","laravel-openapi-generator\u002F7.reference",[264,268,272,276,280],{"title":265,"path":266,"stem":267,"since":118,"experimental":119},"Configuration","\u002Flaravel-openapi-generator\u002Freference\u002Fconfiguration","laravel-openapi-generator\u002F7.reference\u002F1.configuration",{"title":269,"path":270,"stem":271,"since":118,"experimental":119},"Attributes","\u002Flaravel-openapi-generator\u002Freference\u002Fattributes","laravel-openapi-generator\u002F7.reference\u002F2.attributes",{"title":273,"path":274,"stem":275,"since":118,"experimental":119},"Commands","\u002Flaravel-openapi-generator\u002Freference\u002Fcommands","laravel-openapi-generator\u002F7.reference\u002F3.commands",{"title":277,"path":278,"stem":279,"since":118,"experimental":119},"Validation rules","\u002Flaravel-openapi-generator\u002Freference\u002Fvalidation-rules","laravel-openapi-generator\u002F7.reference\u002F4.validation-rules",{"title":281,"path":282,"stem":283,"since":118,"experimental":119},"PHPDoc types","\u002Flaravel-openapi-generator\u002Freference\u002Fphpdoc-types","laravel-openapi-generator\u002F7.reference\u002F5.phpdoc-types",{"title":285,"path":286,"children":287},"Releases","\u002Flaravel-openapi-generator\u002Freleases",[288,292],{"title":289,"path":290,"stem":291,"since":118,"experimental":119},"Upgrade guide","\u002Flaravel-openapi-generator\u002Fupgrade","laravel-openapi-generator\u002FUPGRADE",{"title":293,"path":294,"stem":295,"since":118,"experimental":119},"Changelog","\u002Flaravel-openapi-generator\u002Fchangelog","laravel-openapi-generator\u002FCHANGELOG",{"id":297,"title":198,"body":298,"description":820,"experimental":119,"extension":821,"links":118,"meta":822,"navigation":719,"path":199,"rawbody":823,"seo":824,"since":118,"stem":200,"__hash__":825},"laravel_openapi_generator\u002Flaravel-openapi-generator\u002F4.workflow\u002F1.diagnostics.md",{"type":299,"value":300,"toc":813},"minimark",[301,310,315,388,403,407,436,446,461,508,512,518,524,543,546,552,572,576,671,675,678,804,809],[302,303,304,305,309],"p",{},"The generator never stops on code it does not understand: it leaves the part out and records a ",[306,307,308],"strong",{},"diagnostic",". Reading\nthem is how you find what to fix: a missing return type, a resource that fails on its sample, a rule nobody maps.",[311,312,314],"h2",{"id":313},"levels","Levels",[316,317,318,334],"table",{},[319,320,321],"thead",{},[322,323,324,328,331],"tr",{},[325,326,327],"th",{},"Level",[325,329,330],{},"Meaning",[325,332,333],{},"Shown",[335,336,337,359,372],"tbody",{},[322,338,339,346,353],{},[340,341,342],"td",{},[343,344,345],"code",{},"info",[340,347,348,349,352],{},"something was left out or guessed, the document is still right (an unknown rule, an untyped ",[343,350,351],{},"JsonResponse",")",[340,354,355,356],{},"with ",[343,357,358],{},"-v",[322,360,361,366,369],{},[340,362,363],{},[343,364,365],{},"warning",[340,367,368],{},"the document is incomplete or was changed (a resource that failed, a renamed operation id)",[340,370,371],{},"by default",[322,373,374,379,382],{},[340,375,376],{},[343,377,378],{},"error",[340,380,381],{},"the document cannot be written (a feature its version cannot write, an invalid document)",[340,383,384,385],{},"always, even with ",[343,386,387],{},"-q",[302,389,390,391,394,395,398,399,402],{},"A document with an error is not written, and ",[343,392,393],{},"openapi:generate"," exits with ",[343,396,397],{},"1",". With ",[343,400,401],{},"--strict",", a warning fails the\ndocument too.",[311,404,406],{"id":405},"reading-the-output","Reading the output",[302,408,409,410,413,414,413,417,413,420,413,423,413,426,413,429,413,432,435],{},"Diagnostics are grouped by route, those of the document as a whole first. Each line gives the level, the stage\n(",[343,411,412],{},"discovery",", ",[343,415,416],{},"operation",[343,418,419],{},"request",[343,421,422],{},"response",[343,424,425],{},"sampling",[343,427,428],{},"pass",[343,430,431],{},"writing",[343,433,434],{},"validation",") and the message:",[437,438,444],"pre",{"className":439,"code":441,"language":442,"meta":443},[440],"language-text","$ php artisan openapi:generate\n\n  v1 .................................................................. FAILED\n  Document\n    error writing: [unsupported] \u002Ftags\u002F1\u002Fparent: parent needs 3.2.0\n  GET \u002Fapi\u002Fteams\u002F{team}\u002Fusers\n    warning pass: operationId GET:users.index already used, renamed GET:users.index_2\n","text","",[343,445,441],{"__ignoreMap":443},[302,447,448,449,452,453,456,457,460],{},"Here, a ",[343,450,451],{},"#[Tag(parent: …)]"," cannot be written in a 3.1 strict document (write 3.2, set ",[343,454,455],{},"vendor_extensions: redoc",", or\n",[343,458,459],{},"strict: false","), and two operations had the same id.",[437,462,467],{"className":463,"code":464,"filename":465,"language":466,"meta":443,"style":443},"language-bash shiki shiki-themes material-theme-lighter github-light github-dark","php artisan openapi:generate -v     # infos too\nphp artisan openapi:generate -q     # errors only\n","Terminal","bash",[343,468,469,493],{"__ignoreMap":443},[470,471,474,478,482,485,489],"span",{"class":472,"line":473},"line",1,[470,475,477],{"class":476},"sbgvK","php",[470,479,481],{"class":480},"s_sjI"," artisan",[470,483,484],{"class":480}," openapi:generate",[470,486,488],{"class":487},"stzsN"," -v",[470,490,492],{"class":491},"sutJx","     # infos too\n",[470,494,496,498,500,502,505],{"class":472,"line":495},2,[470,497,477],{"class":476},[470,499,481],{"class":480},[470,501,484],{"class":480},[470,503,504],{"class":487}," -q",[470,506,507],{"class":491},"     # errors only\n",[311,509,511],{"id":510},"inspecting-one-route","Inspecting one route",[302,513,514,517],{},[343,515,516],{},"openapi:inspect"," shows the operation the generator built for one route, after every pass, and every diagnostic about\nit, whatever the verbosity:",[437,519,522],{"className":520,"code":521,"language":442,"meta":443},[440],"$ php artisan openapi:inspect books.store\n\n  POST \u002Fapi\u002Fbooks ............................................................\n  Operation id .............................................. POST:books.store\n  Summary ........................................................ Add a book.\n  Description ......................................... The price is in euros.\n  Tags .................................................................. Book\n  Security .......................................... sanctum | session + xsrf\n  Body (required) ........................................... application\u002Fjson\n  201 Created: application\u002Fjson ..............................................\n  401 Unauthenticated: application\u002Fjson ......................................\n  422 Validation failed: application\u002Fjson ....................................\n",[343,523,521],{"__ignoreMap":443},[302,525,526,527,530,531,534,535,538,539,542],{},"The route is its name (",[343,528,529],{},"books.store","), its URI (",[343,532,533],{},"api\u002Fbooks\u002F{book}",", every method), or its method and URI\n(",[343,536,537],{},"\"GET api\u002Fbooks\"","). ",[343,540,541],{},"--document="," chooses the document, the first one by default.",[302,544,545],{},"A route that is not in the document is reported:",[437,547,550],{"className":548,"code":549,"language":442,"meta":443},[440],"$ php artisan openapi:inspect api\u002Finternal\u002Fstats\n\n   ERROR  api\u002Finternal\u002Fstats is not in the document v1.\n",[343,551,549],{"__ignoreMap":443},[302,553,554,555,558,559,562,563,566,567,571],{},"It is filtered by ",[343,556,557],{},"routes.include"," or ",[343,560,561],{},"routes.exclude",", marked ",[343,564,565],{},"#[Exclude]",", or is a redirect, a view or an internal\nroute; see ",[568,569,146],"a",{"href":570},"\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Froutes-and-operations#choose-the-routes",".",[311,573,575],{"id":574},"common-diagnostics","Common diagnostics",[316,577,578,588],{},[319,579,580],{},[322,581,582,585],{},[325,583,584],{},"Message",[325,586,587],{},"Fix",[335,589,590,603,616,633,645,658],{},[322,591,592,597],{},[340,593,594],{},[343,595,596],{},"no response extractor for …",[340,598,599,600],{},"the return type is not one the generator reads: type the return differently, or declare ",[343,601,602],{},"#[Response]",[322,604,605,610],{},[340,606,607],{},[343,608,609],{},"JsonResponse without #[Response], body described as a free object",[340,611,612,613],{},"declare the body: ",[343,614,615],{},"#[Response(type: 'array{…}')]",[322,617,618,623],{},[340,619,620],{},[343,621,622],{},"cannot run …Resource::toArray(): …",[340,624,625,626,629,630],{},"the resource failed on its sample: give the model a factory, ",[343,627,628],{},"@property"," tags or casts, or a ",[343,631,632],{},"#[ResourceFactory]",[322,634,635,640],{},[340,636,637],{},[343,638,639],{},"the factory of … failed: …",[340,641,642,643],{},"the factory of the model throws: fix it, or give the resource a ",[343,644,632],{},[322,646,647,652],{},[340,648,649],{},[343,650,651],{},"operationId … already used, renamed …_2",[340,653,654,655],{},"two operations have the same id: name the routes, or use ",[343,656,657],{},"method_name",[322,659,660,665],{},[340,661,662],{},[343,663,664],{},"[unsupported] …: … needs 3.2.0",[340,666,667,668],{},"the version of the document cannot write a feature: see ",[568,669,176],{"href":670},"\u002Flaravel-openapi-generator\u002Fdocuments\u002Fconfiguring-a-document#openapi-version",[311,672,674],{"id":673},"in-your-own-extensions","In your own extensions",[302,676,677],{},"An extension adds diagnostics through the context instead of throwing:",[437,679,682],{"className":680,"code":681,"language":477,"meta":443,"style":443},"language-php shiki shiki-themes material-theme-lighter github-light github-dark","use Ark4ne\\OpenApi\\Context\\Stage;\n\n$context->diagnostics->warning(\n    Stage::Request,\n    'the phone rule needs a region',\n    $operation->route->label(),\n);\n",[343,683,684,715,721,746,762,777,798],{"__ignoreMap":443},[470,685,686,690,694,698,701,703,706,708,711],{"class":472,"line":473},[470,687,689],{"class":688},"sw1J6","use",[470,691,693],{"class":692},"s_hVV"," Ark4ne",[470,695,697],{"class":696},"s39Yj","\\",[470,699,700],{"class":692},"OpenApi",[470,702,697],{"class":696},[470,704,705],{"class":692},"Context",[470,707,697],{"class":696},[470,709,710],{"class":692},"Stage",[470,712,714],{"class":713},"sP7_E",";\n",[470,716,717],{"class":472,"line":495},[470,718,720],{"emptyLinePlaceholder":719},true,"\n",[470,722,724,727,731,735,738,740,743],{"class":472,"line":723},3,[470,725,726],{"class":713},"$",[470,728,730],{"class":729},"su5hD","context",[470,732,734],{"class":733},"smGrS","->",[470,736,737],{"class":729},"diagnostics",[470,739,734],{"class":733},[470,741,365],{"class":742},"sGLFI",[470,744,745],{"class":713},"(\n",[470,747,749,753,756,759],{"class":472,"line":748},4,[470,750,752],{"class":751},"sZMiF","    Stage",[470,754,755],{"class":733},"::",[470,757,758],{"class":692},"Request",[470,760,761],{"class":713},",\n",[470,763,765,769,772,775],{"class":472,"line":764},5,[470,766,768],{"class":767},"sjJ54","    '",[470,770,771],{"class":480},"the phone rule needs a region",[470,773,774],{"class":767},"'",[470,776,761],{"class":713},[470,778,780,783,785,787,790,792,795],{"class":472,"line":779},6,[470,781,782],{"class":713},"    $",[470,784,416],{"class":729},[470,786,734],{"class":733},[470,788,789],{"class":729},"route",[470,791,734],{"class":733},[470,793,794],{"class":742},"label",[470,796,797],{"class":713},"(),\n",[470,799,801],{"class":472,"line":800},7,[470,802,803],{"class":713},");\n",[302,805,806,807,571],{},"See ",[568,808,214],{"href":221},[810,811,812],"style",{},"html pre.shiki code .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .stzsN, html code.shiki .stzsN{--shiki-light:#91B859;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}",{"title":443,"searchDepth":723,"depth":723,"links":814},[815,816,817,818,819],{"id":313,"depth":495,"text":314},{"id":405,"depth":495,"text":406},{"id":510,"depth":495,"text":511},{"id":574,"depth":495,"text":575},{"id":673,"depth":495,"text":674},"Read what the generator did not understand, route by route, and inspect the operation it built for one route.","md",{},"---\ntitle: Diagnostics\ndescription: Read what the generator did not understand, route by route, and inspect the operation it built for one route.\n---\n\nThe generator never stops on code it does not understand: it leaves the part out and records a **diagnostic**. Reading\nthem is how you find what to fix: a missing return type, a resource that fails on its sample, a rule nobody maps.\n\n## Levels\n\n| Level | Meaning | Shown |\n| --- | --- | --- |\n| `info` | something was left out or guessed, the document is still right (an unknown rule, an untyped `JsonResponse`) | with `-v` |\n| `warning` | the document is incomplete or was changed (a resource that failed, a renamed operation id) | by default |\n| `error` | the document cannot be written (a feature its version cannot write, an invalid document) | always, even with `-q` |\n\nA document with an error is not written, and `openapi:generate` exits with `1`. With `--strict`, a warning fails the\ndocument too.\n\n## Reading the output\n\nDiagnostics are grouped by route, those of the document as a whole first. Each line gives the level, the stage\n(`discovery`, `operation`, `request`, `response`, `sampling`, `pass`, `writing`, `validation`) and the message:\n\n```text\n$ php artisan openapi:generate\n\n  v1 .................................................................. FAILED\n  Document\n    error writing: [unsupported] \u002Ftags\u002F1\u002Fparent: parent needs 3.2.0\n  GET \u002Fapi\u002Fteams\u002F{team}\u002Fusers\n    warning pass: operationId GET:users.index already used, renamed GET:users.index_2\n```\n\nHere, a `#[Tag(parent: …)]` cannot be written in a 3.1 strict document (write 3.2, set `vendor_extensions: redoc`, or\n`strict: false`), and two operations had the same id.\n\n```bash [Terminal]\nphp artisan openapi:generate -v     # infos too\nphp artisan openapi:generate -q     # errors only\n```\n\n## Inspecting one route\n\n`openapi:inspect` shows the operation the generator built for one route, after every pass, and every diagnostic about\nit, whatever the verbosity:\n\n```text\n$ php artisan openapi:inspect books.store\n\n  POST \u002Fapi\u002Fbooks ............................................................\n  Operation id .............................................. POST:books.store\n  Summary ........................................................ Add a book.\n  Description ......................................... The price is in euros.\n  Tags .................................................................. Book\n  Security .......................................... sanctum | session + xsrf\n  Body (required) ........................................... application\u002Fjson\n  201 Created: application\u002Fjson ..............................................\n  401 Unauthenticated: application\u002Fjson ......................................\n  422 Validation failed: application\u002Fjson ....................................\n```\n\nThe route is its name (`books.store`), its URI (`api\u002Fbooks\u002F{book}`, every method), or its method and URI\n(`\"GET api\u002Fbooks\"`). `--document=` chooses the document, the first one by default.\n\nA route that is not in the document is reported:\n\n```text\n$ php artisan openapi:inspect api\u002Finternal\u002Fstats\n\n   ERROR  api\u002Finternal\u002Fstats is not in the document v1.\n```\n\nIt is filtered by `routes.include` or `routes.exclude`, marked `#[Exclude]`, or is a redirect, a view or an internal\nroute; see [Routes & operations](\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Froutes-and-operations#choose-the-routes).\n\n## Common diagnostics\n\n| Message | Fix |\n| --- | --- |\n| `no response extractor for …` | the return type is not one the generator reads: type the return differently, or declare `#[Response]` |\n| `JsonResponse without #[Response], body described as a free object` | declare the body: `#[Response(type: 'array{…}')]` |\n| `cannot run …Resource::toArray(): …` | the resource failed on its sample: give the model a factory, `@property` tags or casts, or a `#[ResourceFactory]` |\n| `the factory of … failed: …` | the factory of the model throws: fix it, or give the resource a `#[ResourceFactory]` |\n| `operationId … already used, renamed …_2` | two operations have the same id: name the routes, or use `method_name` |\n| `[unsupported] …: … needs 3.2.0` | the version of the document cannot write a feature: see [Configuring a document](\u002Flaravel-openapi-generator\u002Fdocuments\u002Fconfiguring-a-document#openapi-version) |\n\n## In your own extensions\n\nAn extension adds diagnostics through the context instead of throwing:\n\n```php\nuse Ark4ne\\OpenApi\\Context\\Stage;\n\n$context->diagnostics->warning(\n    Stage::Request,\n    'the phone rule needs a region',\n    $operation->route->label(),\n);\n```\n\nSee [Extending](\u002Flaravel-openapi-generator\u002Fextending\u002Foverview).\n",{"title":198,"description":820},"6L5Ydei5rao5gcZg9rETSrEfAhfYB9dipZD-oX6Ia-g",[827,829],{"title":188,"path":189,"stem":190,"description":828,"children":-1},"Generate one document per language, with summaries, descriptions and tags written as translation keys.",{"title":202,"path":203,"stem":204,"description":830,"children":-1},"Fail the build when the documentation degrades, and decide whether to commit the generated documents.",1795438903958]