[{"data":1,"prerenderedAt":1198},["ShallowReactive",2],{"libs":3,"navigation-laravel-openapi-generator":115,"\u002Flaravel-openapi-generator\u002Fextending\u002Foverview":296,"\u002Flaravel-openapi-generator\u002Fextending\u002Foverview-surround":1193},[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":220,"body":298,"description":1187,"experimental":119,"extension":1188,"links":118,"meta":1189,"navigation":663,"path":221,"rawbody":1190,"seo":1191,"since":118,"stem":222,"__hash__":1192},"laravel_openapi_generator\u002Flaravel-openapi-generator\u002F5.extending\u002F1.overview.md",{"type":299,"value":300,"toc":1181},"minimark",[301,305,310,469,476,480,491,714,717,825,903,906,910,921,974,988,992,1177],[302,303,304],"p",{},"When the generator does not know something your application does (a custom validation rule, a return type, a\nmiddleware, a convention of your API), extend it rather than declaring the same attribute everywhere. Each extension\npoint is an interface; your class joins a registry of built-in ones.",[306,307,309],"h2",{"id":308},"extension-points","Extension points",[311,312,313,329],"table",{},[314,315,316],"thead",{},[317,318,319,323,326],"tr",{},[320,321,322],"th",{},"You want to describe",[320,324,325],{},"Implement",[320,327,328],{},"Page",[330,331,332,353,369,384,398,412,427,441,455],"tbody",{},[317,333,334,343,348],{},[335,336,337,338,342],"td",{},"a validation rule registered by name (",[339,340,341],"code",{},"phone",")",[335,344,345],{},[339,346,347],{},"Extraction\\Rules\\RuleMapper",[335,349,350],{},[351,352,224],"a",{"href":225},[317,354,355,358,364],{},[335,356,357],{},"a rule object of your application",[335,359,360,363],{},[339,361,362],{},"Extraction\\Rules\\DescribesRule"," on the rule",[335,365,366],{},[351,367,150],{"href":368},"\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Frequests#a-rule-that-describes-itself",[317,370,371,374,379],{},[335,372,373],{},"a return type the package does not know",[335,375,376],{},[339,377,378],{},"Extraction\\Responses\\ResponseExtractor",[335,380,381],{},[351,382,383],{"href":229},"Extractors",[317,385,386,389,394],{},[335,387,388],{},"another source of parameters or bodies",[335,390,391],{},[339,392,393],{},"Extraction\\Requests\\RequestExtractor",[335,395,396],{},[351,397,383],{"href":229},[317,399,400,403,408],{},[335,401,402],{},"other metadata of the operations",[335,404,405],{},[339,406,407],{},"Extraction\\Operations\\OperationExtractor",[335,409,410],{},[351,411,232],{"href":233},[317,413,414,417,423],{},[335,415,416],{},"your own naming of summaries, tags, operation ids, query parameters",[335,418,419,420],{},"a strategy of ",[339,421,422],{},"Extraction\\Strategies",[335,424,425],{},[351,426,232],{"href":233},[317,428,429,432,437],{},[335,430,431],{},"how the samples of a model are built",[335,433,434],{},[339,435,436],{},"Sampling\\Sampler",[335,438,439],{},[351,440,236],{"href":237},[317,442,443,446,451],{},[335,444,445],{},"a change over the whole document",[335,447,448],{},[339,449,450],{},"Generation\\Pass",[335,452,453],{},[351,454,240],{"href":241},[317,456,457,460,465],{},[335,458,459],{},"what a middleware means",[335,461,462],{},[339,463,464],{},"Generation\\MiddlewareMapper",[335,466,467],{},[351,468,240],{"href":241},[302,470,471,472,475],{},"All namespaces are under ",[339,473,474],{},"Ark4ne\\OpenApi\\",".",[306,477,479],{"id":478},"register-an-extension","Register an extension",[302,481,482,483,486,487,490],{},"An application lists its classes in ",[339,484,485],{},"extensions"," of ",[339,488,489],{},"config\u002Fopenapi.php",":",[492,493,498],"pre",{"className":494,"code":495,"filename":489,"language":496,"meta":497,"style":497},"language-php shiki shiki-themes material-theme-lighter github-light github-dark","'extensions' => [\n    'operation_extractors' => [],\n    'request_extractors' => [],\n    'rule_mappers' => [App\\Docs\\PhoneRuleMapper::class],\n    'response_extractors' => [],\n    'samplers' => [],\n    'passes' => [App\\Docs\\ApiVersionPass::class],\n],\n\n'middlewares' => [\n    'tenant' => [App\\Docs\\TenantMiddlewareMapper::class],\n],\n","php","",[339,499,500,522,538,552,594,608,622,653,658,665,678,709],{"__ignoreMap":497},[501,502,505,509,512,514,518],"span",{"class":503,"line":504},"line",1,[501,506,508],{"class":507},"sjJ54","'",[501,510,485],{"class":511},"s_sjI",[501,513,508],{"class":507},[501,515,517],{"class":516},"smGrS"," =>",[501,519,521],{"class":520},"sP7_E"," [\n",[501,523,525,528,531,533,535],{"class":503,"line":524},2,[501,526,527],{"class":507},"    '",[501,529,530],{"class":511},"operation_extractors",[501,532,508],{"class":507},[501,534,517],{"class":516},[501,536,537],{"class":520}," [],\n",[501,539,541,543,546,548,550],{"class":503,"line":540},3,[501,542,527],{"class":507},[501,544,545],{"class":511},"request_extractors",[501,547,508],{"class":507},[501,549,517],{"class":516},[501,551,537],{"class":520},[501,553,555,557,560,562,564,567,571,575,578,580,584,587,591],{"class":503,"line":554},4,[501,556,527],{"class":507},[501,558,559],{"class":511},"rule_mappers",[501,561,508],{"class":507},[501,563,517],{"class":516},[501,565,566],{"class":520}," [",[501,568,570],{"class":569},"s_hVV","App",[501,572,574],{"class":573},"s39Yj","\\",[501,576,577],{"class":569},"Docs",[501,579,574],{"class":573},[501,581,583],{"class":582},"sZMiF","PhoneRuleMapper",[501,585,586],{"class":516},"::",[501,588,590],{"class":589},"sw1J6","class",[501,592,593],{"class":520},"],\n",[501,595,597,599,602,604,606],{"class":503,"line":596},5,[501,598,527],{"class":507},[501,600,601],{"class":511},"response_extractors",[501,603,508],{"class":507},[501,605,517],{"class":516},[501,607,537],{"class":520},[501,609,611,613,616,618,620],{"class":503,"line":610},6,[501,612,527],{"class":507},[501,614,615],{"class":511},"samplers",[501,617,508],{"class":507},[501,619,517],{"class":516},[501,621,537],{"class":520},[501,623,625,627,630,632,634,636,638,640,642,644,647,649,651],{"class":503,"line":624},7,[501,626,527],{"class":507},[501,628,629],{"class":511},"passes",[501,631,508],{"class":507},[501,633,517],{"class":516},[501,635,566],{"class":520},[501,637,570],{"class":569},[501,639,574],{"class":573},[501,641,577],{"class":569},[501,643,574],{"class":573},[501,645,646],{"class":582},"ApiVersionPass",[501,648,586],{"class":516},[501,650,590],{"class":589},[501,652,593],{"class":520},[501,654,656],{"class":503,"line":655},8,[501,657,593],{"class":520},[501,659,661],{"class":503,"line":660},9,[501,662,664],{"emptyLinePlaceholder":663},true,"\n",[501,666,667,669,672,674,676],{"class":503,"line":29},[501,668,508],{"class":507},[501,670,671],{"class":511},"middlewares",[501,673,508],{"class":507},[501,675,517],{"class":516},[501,677,521],{"class":520},[501,679,681,683,686,688,690,692,694,696,698,700,703,705,707],{"class":503,"line":680},11,[501,682,527],{"class":507},[501,684,685],{"class":511},"tenant",[501,687,508],{"class":507},[501,689,517],{"class":516},[501,691,566],{"class":520},[501,693,570],{"class":569},[501,695,574],{"class":573},[501,697,577],{"class":569},[501,699,574],{"class":573},[501,701,702],{"class":582},"TenantMiddlewareMapper",[501,704,586],{"class":516},[501,706,590],{"class":589},[501,708,593],{"class":520},[501,710,712],{"class":503,"line":711},12,[501,713,593],{"class":520},[302,715,716],{},"A package tags its classes in the container, in its service provider:",[492,718,721],{"className":494,"code":719,"filename":720,"language":496,"meta":497,"style":497},"public function register(): void\n{\n    $this->app->tag([PhoneRuleMapper::class], 'openapi.rule-mappers');\n    $this->app->tag([ApiVersionPass::class], 'openapi.passes');\n}\n","src\u002FMyPackageServiceProvider.php",[339,722,723,744,749,789,820],{"__ignoreMap":497},[501,724,725,729,732,736,739,741],{"class":503,"line":504},[501,726,728],{"class":727},"sbsja","public",[501,730,731],{"class":727}," function",[501,733,735],{"class":734},"sGLFI"," register",[501,737,738],{"class":520},"()",[501,740,490],{"class":516},[501,742,743],{"class":589}," void\n",[501,745,746],{"class":503,"line":524},[501,747,748],{"class":520},"{\n",[501,750,751,754,757,761,763,766,769,771,773,775,778,781,784,786],{"class":503,"line":540},[501,752,753],{"class":573},"    $this",[501,755,756],{"class":516},"->",[501,758,760],{"class":759},"su5hD","app",[501,762,756],{"class":516},[501,764,765],{"class":734},"tag",[501,767,768],{"class":520},"([",[501,770,583],{"class":582},[501,772,586],{"class":516},[501,774,590],{"class":589},[501,776,777],{"class":520},"],",[501,779,780],{"class":507}," '",[501,782,783],{"class":511},"openapi.rule-mappers",[501,785,508],{"class":507},[501,787,788],{"class":520},");\n",[501,790,791,793,795,797,799,801,803,805,807,809,811,813,816,818],{"class":503,"line":554},[501,792,753],{"class":573},[501,794,756],{"class":516},[501,796,760],{"class":759},[501,798,756],{"class":516},[501,800,765],{"class":734},[501,802,768],{"class":520},[501,804,646],{"class":582},[501,806,586],{"class":516},[501,808,590],{"class":589},[501,810,777],{"class":520},[501,812,780],{"class":507},[501,814,815],{"class":511},"openapi.passes",[501,817,508],{"class":507},[501,819,788],{"class":520},[501,821,822],{"class":503,"line":596},[501,823,824],{"class":520},"}\n",[311,826,827,837],{},[314,828,829],{},[317,830,831,834],{},[320,832,833],{},"Configuration key",[320,835,836],{},"Container tag",[330,838,839,850,861,871,882,893],{},[317,840,841,845],{},[335,842,843],{},[339,844,530],{},[335,846,847],{},[339,848,849],{},"openapi.operation-extractors",[317,851,852,856],{},[335,853,854],{},[339,855,545],{},[335,857,858],{},[339,859,860],{},"openapi.request-extractors",[317,862,863,867],{},[335,864,865],{},[339,866,559],{},[335,868,869],{},[339,870,783],{},[317,872,873,877],{},[335,874,875],{},[339,876,601],{},[335,878,879],{},[339,880,881],{},"openapi.response-extractors",[317,883,884,888],{},[335,885,886],{},[339,887,615],{},[335,889,890],{},[339,891,892],{},"openapi.samplers",[317,894,895,899],{},[335,896,897],{},[339,898,629],{},[335,900,901],{},[339,902,815],{},[302,904,905],{},"Every extension is built through the container: its constructor dependencies are injected. A class of the wrong kind\nfails the command with its key or its tag.",[306,907,909],{"id":908},"priorities","Priorities",[302,911,912,913,916,917,920],{},"Extractors and samplers declare their priority with ",[339,914,915],{},"priority()",", by convention returning a public ",[339,918,919],{},"PRIORITY","\nconstant:",[311,922,923,933],{},[314,924,925],{},[317,926,927,930],{},[320,928,929],{},"Registry",[320,931,932],{},"Order",[330,934,935,947,959,966],{},[317,936,937,940],{},[335,938,939],{},"Operation and request extractors",[335,941,942,946],{},[943,944,945],"strong",{},"every"," supporting extractor runs, by increasing priority: each one refines what the previous ones gave",[317,948,949,952],{},[335,950,951],{},"Response extractors and samplers",[335,953,954,955,958],{},"the ",[943,956,957],{},"first"," supporting one, by decreasing priority, is used",[317,960,961,963],{},[335,962,224],{},[335,964,965],{},"one per rule name: yours replaces the built-in mapper of its rules",[317,967,968,971],{},[335,969,970],{},"Passes",[335,972,973],{},"in their order, after the built-in passes, before the removal of unused components and the cleanup",[302,975,976,977,979,980,983,984,987],{},"The priorities of the built-in classes are in their ",[339,978,919],{}," constants; for example, the attributes\n(",[339,981,982],{},"AttributeOperationExtractor",", 200) run after the PHPDoc (",[339,985,986],{},"PhpDocOperationExtractor",", 100), and translation runs last\n(1000).",[306,989,991],{"id":990},"rules-every-extension-follows","Rules every extension follows",[993,994,995,1017,1035,1167],"ul",{},[996,997,998,1001,1002,1005,1006,1005,1009,1012,1013,1016],"li",{},[943,999,1000],{},"Descriptions are immutable."," ",[339,1003,1004],{},"OperationDescription",", ",[339,1007,1008],{},"RequestDescription",[339,1010,1011],{},"FieldDescription"," and the others return\na copy from every method: always use the return value (",[339,1014,1015],{},"$field = $field->schema(…)",").",[996,1018,1019,1022,1023,1026,1027,1030,1031,1034],{},[943,1020,1021],{},"Schemas are writer schemas."," They are ",[339,1024,1025],{},"Ark4ne\\OpenApiWriter\\Objects\\Schema"," objects, written in the version of the\ndocument by ",[351,1028,105],{"href":1029},"\u002Fopenapi-writer\u002Fbuilding-documents\u002Fthe-object-model",": describe the latest model\n(",[339,1032,1033],{},"Schema::string()->nullable()","), never a version.",[996,1036,1037,1040,1041],{},[943,1038,1039],{},"Never throw on application code."," An extension that does not understand what it reads adds a diagnostic and\nreturns what it was given:",[492,1042,1044],{"className":494,"code":1043,"language":496,"meta":497,"style":497},"use Ark4ne\\OpenApi\\Context\\Stage;\n\n$context->diagnostics->warning(\n    Stage::Request,\n    \"the phone rule of {$rule->field} has no region\",\n    $operation->route->label(),\n);\n",[339,1045,1046,1072,1076,1097,1110,1142,1163],{"__ignoreMap":497},[501,1047,1048,1051,1054,1056,1059,1061,1064,1066,1069],{"class":503,"line":504},[501,1049,1050],{"class":589},"use",[501,1052,1053],{"class":569}," Ark4ne",[501,1055,574],{"class":573},[501,1057,1058],{"class":569},"OpenApi",[501,1060,574],{"class":573},[501,1062,1063],{"class":569},"Context",[501,1065,574],{"class":573},[501,1067,1068],{"class":569},"Stage",[501,1070,1071],{"class":520},";\n",[501,1073,1074],{"class":503,"line":524},[501,1075,664],{"emptyLinePlaceholder":663},[501,1077,1078,1081,1084,1086,1089,1091,1094],{"class":503,"line":540},[501,1079,1080],{"class":520},"$",[501,1082,1083],{"class":759},"context",[501,1085,756],{"class":516},[501,1087,1088],{"class":759},"diagnostics",[501,1090,756],{"class":516},[501,1092,1093],{"class":734},"warning",[501,1095,1096],{"class":520},"(\n",[501,1098,1099,1102,1104,1107],{"class":503,"line":554},[501,1100,1101],{"class":582},"    Stage",[501,1103,586],{"class":516},[501,1105,1106],{"class":569},"Request",[501,1108,1109],{"class":520},",\n",[501,1111,1112,1115,1118,1121,1123,1126,1128,1131,1134,1137,1140],{"class":503,"line":596},[501,1113,1114],{"class":507},"    \"",[501,1116,1117],{"class":511},"the phone rule of ",[501,1119,1120],{"class":507},"{",[501,1122,1080],{"class":520},[501,1124,1125],{"class":759},"rule",[501,1127,756],{"class":516},[501,1129,1130],{"class":759},"field",[501,1132,1133],{"class":507},"}",[501,1135,1136],{"class":511}," has no region",[501,1138,1139],{"class":507},"\"",[501,1141,1109],{"class":520},[501,1143,1144,1147,1150,1152,1155,1157,1160],{"class":503,"line":610},[501,1145,1146],{"class":520},"    $",[501,1148,1149],{"class":759},"operation",[501,1151,756],{"class":516},[501,1153,1154],{"class":759},"route",[501,1156,756],{"class":516},[501,1158,1159],{"class":734},"label",[501,1161,1162],{"class":520},"(),\n",[501,1164,1165],{"class":503,"line":624},[501,1166,788],{"class":520},[996,1168,1169,1172,1173,1176],{},[943,1170,1171],{},"No state between documents."," Each document is generated with its own ",[339,1174,1175],{},"GenerationContext","; keep what you learn in\nit, not in a static property.",[1178,1179,1180],"style",{},"html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}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 .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}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 .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--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 .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":497,"searchDepth":540,"depth":540,"links":1182},[1183,1184,1185,1186],{"id":308,"depth":524,"text":309},{"id":478,"depth":524,"text":479},{"id":908,"depth":524,"text":909},{"id":990,"depth":524,"text":991},"The extension points of the generator, how to register an extension, and the rules every extension follows.","md",{},"---\ntitle: Overview\ndescription: The extension points of the generator, how to register an extension, and the rules every extension follows.\n---\n\nWhen the generator does not know something your application does (a custom validation rule, a return type, a\nmiddleware, a convention of your API), extend it rather than declaring the same attribute everywhere. Each extension\npoint is an interface; your class joins a registry of built-in ones.\n\n## Extension points\n\n| You want to describe | Implement | Page |\n| --- | --- | --- |\n| a validation rule registered by name (`phone`) | `Extraction\\Rules\\RuleMapper` | [Rule mappers](\u002Flaravel-openapi-generator\u002Fextending\u002Frule-mappers) |\n| a rule object of your application | `Extraction\\Rules\\DescribesRule` on the rule | [Requests](\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Frequests#a-rule-that-describes-itself) |\n| a return type the package does not know | `Extraction\\Responses\\ResponseExtractor` | [Extractors](\u002Flaravel-openapi-generator\u002Fextending\u002Frequest-and-response-extractors) |\n| another source of parameters or bodies | `Extraction\\Requests\\RequestExtractor` | [Extractors](\u002Flaravel-openapi-generator\u002Fextending\u002Frequest-and-response-extractors) |\n| other metadata of the operations | `Extraction\\Operations\\OperationExtractor` | [Operations & strategies](\u002Flaravel-openapi-generator\u002Fextending\u002Foperations-and-strategies) |\n| your own naming of summaries, tags, operation ids, query parameters | a strategy of `Extraction\\Strategies` | [Operations & strategies](\u002Flaravel-openapi-generator\u002Fextending\u002Foperations-and-strategies) |\n| how the samples of a model are built | `Sampling\\Sampler` | [Samplers](\u002Flaravel-openapi-generator\u002Fextending\u002Fsamplers) |\n| a change over the whole document | `Generation\\Pass` | [Passes & middlewares](\u002Flaravel-openapi-generator\u002Fextending\u002Fpasses-and-middlewares) |\n| what a middleware means | `Generation\\MiddlewareMapper` | [Passes & middlewares](\u002Flaravel-openapi-generator\u002Fextending\u002Fpasses-and-middlewares) |\n\nAll namespaces are under `Ark4ne\\OpenApi\\`.\n\n## Register an extension\n\nAn application lists its classes in `extensions` of `config\u002Fopenapi.php`:\n\n```php [config\u002Fopenapi.php]\n'extensions' => [\n    'operation_extractors' => [],\n    'request_extractors' => [],\n    'rule_mappers' => [App\\Docs\\PhoneRuleMapper::class],\n    'response_extractors' => [],\n    'samplers' => [],\n    'passes' => [App\\Docs\\ApiVersionPass::class],\n],\n\n'middlewares' => [\n    'tenant' => [App\\Docs\\TenantMiddlewareMapper::class],\n],\n```\n\nA package tags its classes in the container, in its service provider:\n\n```php [src\u002FMyPackageServiceProvider.php]\npublic function register(): void\n{\n    $this->app->tag([PhoneRuleMapper::class], 'openapi.rule-mappers');\n    $this->app->tag([ApiVersionPass::class], 'openapi.passes');\n}\n```\n\n| Configuration key | Container tag |\n| --- | --- |\n| `operation_extractors` | `openapi.operation-extractors` |\n| `request_extractors` | `openapi.request-extractors` |\n| `rule_mappers` | `openapi.rule-mappers` |\n| `response_extractors` | `openapi.response-extractors` |\n| `samplers` | `openapi.samplers` |\n| `passes` | `openapi.passes` |\n\nEvery extension is built through the container: its constructor dependencies are injected. A class of the wrong kind\nfails the command with its key or its tag.\n\n## Priorities\n\nExtractors and samplers declare their priority with `priority()`, by convention returning a public `PRIORITY`\nconstant:\n\n| Registry | Order |\n| --- | --- |\n| Operation and request extractors | **every** supporting extractor runs, by increasing priority: each one refines what the previous ones gave |\n| Response extractors and samplers | the **first** supporting one, by decreasing priority, is used |\n| Rule mappers | one per rule name: yours replaces the built-in mapper of its rules |\n| Passes | in their order, after the built-in passes, before the removal of unused components and the cleanup |\n\nThe priorities of the built-in classes are in their `PRIORITY` constants; for example, the attributes\n(`AttributeOperationExtractor`, 200) run after the PHPDoc (`PhpDocOperationExtractor`, 100), and translation runs last\n(1000).\n\n## Rules every extension follows\n\n- **Descriptions are immutable.** `OperationDescription`, `RequestDescription`, `FieldDescription` and the others return\n  a copy from every method: always use the return value (`$field = $field->schema(…)`).\n- **Schemas are writer schemas.** They are `Ark4ne\\OpenApiWriter\\Objects\\Schema` objects, written in the version of the\n  document by [OpenAPI Writer](\u002Fopenapi-writer\u002Fbuilding-documents\u002Fthe-object-model): describe the latest model\n  (`Schema::string()->nullable()`), never a version.\n- **Never throw on application code.** An extension that does not understand what it reads adds a diagnostic and\n  returns what it was given:\n\n  ```php\n  use Ark4ne\\OpenApi\\Context\\Stage;\n\n  $context->diagnostics->warning(\n      Stage::Request,\n      \"the phone rule of {$rule->field} has no region\",\n      $operation->route->label(),\n  );\n  ```\n\n- **No state between documents.** Each document is generated with its own `GenerationContext`; keep what you learn in\n  it, not in a static property.\n",{"title":220,"description":1187},"lmwDEjLKCS8HEAN27GBe99H8oa7nfBEUkTbt7qbp0Gw",[1194,1196],{"title":210,"path":211,"stem":212,"description":1195,"children":-1},"The skills shipped with the package, to let a coding agent document endpoints and migrate from 0.6.",{"title":224,"path":225,"stem":226,"description":1197,"children":-1},"Describe a validation rule the generator does not know, or change how a built-in rule is described.",1795438904114]