[{"data":1,"prerenderedAt":1880},["ShallowReactive",2],{"libs":3,"navigation-laravel-openapi-generator":115,"\u002Flaravel-openapi-generator\u002Fextending\u002Frequest-and-response-extractors":296,"\u002Flaravel-openapi-generator\u002Fextending\u002Frequest-and-response-extractors-surround":1875},[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":228,"body":298,"description":1869,"experimental":119,"extension":1870,"links":118,"meta":1871,"navigation":373,"path":229,"rawbody":1872,"seo":1873,"since":118,"stem":230,"__hash__":1874},"laravel_openapi_generator\u002Flaravel-openapi-generator\u002F5.extending\u002F3.request-and-response-extractors.md",{"type":299,"value":300,"toc":1864},"minimark",[301,319,324,327,1063,1121,1157,1168,1200,1204,1215,1221,1673,1680,1717,1729,1733,1860],[302,303,304,305,309,310,313,314,318],"p",{},"Extractors read an operation. A ",[306,307,308],"strong",{},"response extractor"," describes the responses of one return type; a ",[306,311,312],{},"request\nextractor"," refines what the operation receives. Both receive an ",[315,316,317],"code",{},"OperationContext",": the route, the HTTP method and path,\nthe reflected action, its PHPDoc and its return type.",[320,321,323],"h2",{"id":322},"response-extractors","Response extractors",[302,325,326],{},"The first response extractor that supports the return type, by decreasing priority, describes its responses. Add one\nfor a type of your application:",[328,329,332,942],"example",{"input":330,"output":331},"app\u002FDocs\u002FCsvExportExtractor.php","responses",[333,334,336],"template",{"v-slot:input":335},"",[337,338,342],"pre",{"className":339,"code":340,"language":341,"meta":335,"style":335},"language-php shiki shiki-themes material-theme-lighter github-light github-dark","namespace App\\Docs;\n\nuse App\\Exports\\CsvExport;\nuse Ark4ne\\OpenApi\\Context\\GenerationContext;\nuse Ark4ne\\OpenApi\\Description\\ResponseDescription;\nuse Ark4ne\\OpenApi\\Extraction\\OperationContext;\nuse Ark4ne\\OpenApi\\Extraction\\Responses\\ResponseExtractor;\nuse Ark4ne\\OpenApi\\Types\\NamedType;\nuse Ark4ne\\OpenApi\\Types\\Type;\nuse Ark4ne\\OpenApiWriter\\Objects\\Schema;\n\nfinal class CsvExportExtractor implements ResponseExtractor\n{\n    public const PRIORITY = 500;\n\n    public function priority(): int\n    {\n        return self::PRIORITY;\n    }\n\n    public function supports(Type $type, OperationContext $operation): bool\n    {\n        return $type instanceof NamedType\n            && is_a($type->name, CsvExport::class, true);\n    }\n\n    public function extract(\n        Type $type,\n        OperationContext $operation,\n        GenerationContext $context,\n    ): array {\n        return [\n            ResponseDescription::ok()\n                ->description('A CSV file')\n                ->content('text\u002Fcsv', Schema::string()),\n        ];\n    }\n}\n","php",[315,343,344,368,375,397,422,445,467,493,516,538,561,566,585,591,613,618,639,645,663,669,673,715,720,736,775,780,785,798,811,823,835,849,857,871,895,925,931,936],{"__ignoreMap":335},[345,346,349,353,357,361,364],"span",{"class":347,"line":348},"line",1,[345,350,352],{"class":351},"sw1J6","namespace",[345,354,356],{"class":355},"sbgvK"," App",[345,358,360],{"class":359},"stp6e","\\",[345,362,363],{"class":355},"Docs",[345,365,367],{"class":366},"sP7_E",";\n",[345,369,371],{"class":347,"line":370},2,[345,372,374],{"emptyLinePlaceholder":373},true,"\n",[345,376,378,381,384,387,390,392,395],{"class":347,"line":377},3,[345,379,380],{"class":351},"use",[345,382,356],{"class":383},"s_hVV",[345,385,360],{"class":386},"s39Yj",[345,388,389],{"class":383},"Exports",[345,391,360],{"class":386},[345,393,394],{"class":383},"CsvExport",[345,396,367],{"class":366},[345,398,400,402,405,407,410,412,415,417,420],{"class":347,"line":399},4,[345,401,380],{"class":351},[345,403,404],{"class":383}," Ark4ne",[345,406,360],{"class":386},[345,408,409],{"class":383},"OpenApi",[345,411,360],{"class":386},[345,413,414],{"class":383},"Context",[345,416,360],{"class":386},[345,418,419],{"class":383},"GenerationContext",[345,421,367],{"class":366},[345,423,425,427,429,431,433,435,438,440,443],{"class":347,"line":424},5,[345,426,380],{"class":351},[345,428,404],{"class":383},[345,430,360],{"class":386},[345,432,409],{"class":383},[345,434,360],{"class":386},[345,436,437],{"class":383},"Description",[345,439,360],{"class":386},[345,441,442],{"class":383},"ResponseDescription",[345,444,367],{"class":366},[345,446,448,450,452,454,456,458,461,463,465],{"class":347,"line":447},6,[345,449,380],{"class":351},[345,451,404],{"class":383},[345,453,360],{"class":386},[345,455,409],{"class":383},[345,457,360],{"class":386},[345,459,460],{"class":383},"Extraction",[345,462,360],{"class":386},[345,464,317],{"class":383},[345,466,367],{"class":366},[345,468,470,472,474,476,478,480,482,484,486,488,491],{"class":347,"line":469},7,[345,471,380],{"class":351},[345,473,404],{"class":383},[345,475,360],{"class":386},[345,477,409],{"class":383},[345,479,360],{"class":386},[345,481,460],{"class":383},[345,483,360],{"class":386},[345,485,154],{"class":383},[345,487,360],{"class":386},[345,489,490],{"class":383},"ResponseExtractor",[345,492,367],{"class":366},[345,494,496,498,500,502,504,506,509,511,514],{"class":347,"line":495},8,[345,497,380],{"class":351},[345,499,404],{"class":383},[345,501,360],{"class":386},[345,503,409],{"class":383},[345,505,360],{"class":386},[345,507,508],{"class":383},"Types",[345,510,360],{"class":386},[345,512,513],{"class":383},"NamedType",[345,515,367],{"class":366},[345,517,519,521,523,525,527,529,531,533,536],{"class":347,"line":518},9,[345,520,380],{"class":351},[345,522,404],{"class":383},[345,524,360],{"class":386},[345,526,409],{"class":383},[345,528,360],{"class":386},[345,530,508],{"class":383},[345,532,360],{"class":386},[345,534,535],{"class":383},"Type",[345,537,367],{"class":366},[345,539,540,542,544,546,549,551,554,556,559],{"class":347,"line":29},[345,541,380],{"class":351},[345,543,404],{"class":383},[345,545,360],{"class":386},[345,547,548],{"class":383},"OpenApiWriter",[345,550,360],{"class":386},[345,552,553],{"class":383},"Objects",[345,555,360],{"class":386},[345,557,558],{"class":383},"Schema",[345,560,367],{"class":366},[345,562,564],{"class":347,"line":563},11,[345,565,374],{"emptyLinePlaceholder":373},[345,567,569,573,576,579,582],{"class":347,"line":568},12,[345,570,572],{"class":571},"sbsja","final",[345,574,575],{"class":571}," class",[345,577,578],{"class":355}," CsvExportExtractor",[345,580,581],{"class":571}," implements",[345,583,584],{"class":355}," ResponseExtractor\n",[345,586,588],{"class":347,"line":587},13,[345,589,590],{"class":366},"{\n",[345,592,594,597,600,603,607,611],{"class":347,"line":593},14,[345,595,596],{"class":571},"    public",[345,598,599],{"class":571}," const",[345,601,602],{"class":383}," PRIORITY",[345,604,606],{"class":605},"smGrS"," =",[345,608,610],{"class":609},"srdBf"," 500",[345,612,367],{"class":366},[345,614,616],{"class":347,"line":615},15,[345,617,374],{"emptyLinePlaceholder":373},[345,619,621,623,626,630,633,636],{"class":347,"line":620},16,[345,622,596],{"class":571},[345,624,625],{"class":571}," function",[345,627,629],{"class":628},"sGLFI"," priority",[345,631,632],{"class":366},"()",[345,634,635],{"class":605},":",[345,637,638],{"class":351}," int\n",[345,640,642],{"class":347,"line":641},17,[345,643,644],{"class":366},"    {\n",[345,646,648,652,655,658,661],{"class":347,"line":647},18,[345,649,651],{"class":650},"sVHd0","        return",[345,653,654],{"class":571}," self",[345,656,657],{"class":605},"::",[345,659,660],{"class":383},"PRIORITY",[345,662,367],{"class":366},[345,664,666],{"class":347,"line":665},19,[345,667,668],{"class":366},"    }\n",[345,670,671],{"class":347,"line":58},[345,672,374],{"emptyLinePlaceholder":373},[345,674,676,678,680,683,686,689,692,696,699,702,704,707,710,712],{"class":347,"line":675},21,[345,677,596],{"class":571},[345,679,625],{"class":571},[345,681,682],{"class":628}," supports",[345,684,685],{"class":366},"(",[345,687,535],{"class":688},"sZMiF",[345,690,691],{"class":366}," $",[345,693,695],{"class":694},"su5hD","type",[345,697,698],{"class":366},",",[345,700,701],{"class":688}," OperationContext",[345,703,691],{"class":366},[345,705,706],{"class":694},"operation",[345,708,709],{"class":366},")",[345,711,635],{"class":605},[345,713,714],{"class":351}," bool\n",[345,716,718],{"class":347,"line":717},22,[345,719,644],{"class":366},[345,721,723,725,727,730,733],{"class":347,"line":722},23,[345,724,651],{"class":650},[345,726,691],{"class":366},[345,728,729],{"class":694},"type ",[345,731,732],{"class":605},"instanceof",[345,734,735],{"class":688}," NamedType\n",[345,737,739,742,746,749,751,754,757,759,762,764,767,769,772],{"class":347,"line":738},24,[345,740,741],{"class":605},"            &&",[345,743,745],{"class":744},"sptTA"," is_a",[345,747,748],{"class":366},"($",[345,750,695],{"class":694},[345,752,753],{"class":605},"->",[345,755,756],{"class":694},"name",[345,758,698],{"class":366},[345,760,761],{"class":688}," CsvExport",[345,763,657],{"class":605},[345,765,766],{"class":351},"class",[345,768,698],{"class":366},[345,770,771],{"class":386}," true",[345,773,774],{"class":366},");\n",[345,776,778],{"class":347,"line":777},25,[345,779,668],{"class":366},[345,781,783],{"class":347,"line":782},26,[345,784,374],{"emptyLinePlaceholder":373},[345,786,788,790,792,795],{"class":347,"line":787},27,[345,789,596],{"class":571},[345,791,625],{"class":571},[345,793,794],{"class":628}," extract",[345,796,797],{"class":366},"(\n",[345,799,801,804,806,808],{"class":347,"line":800},28,[345,802,803],{"class":688},"        Type",[345,805,691],{"class":366},[345,807,695],{"class":694},[345,809,810],{"class":366},",\n",[345,812,814,817,819,821],{"class":347,"line":813},29,[345,815,816],{"class":688},"        OperationContext",[345,818,691],{"class":366},[345,820,706],{"class":694},[345,822,810],{"class":366},[345,824,825,828,830,833],{"class":347,"line":84},[345,826,827],{"class":688},"        GenerationContext",[345,829,691],{"class":366},[345,831,832],{"class":694},"context",[345,834,810],{"class":366},[345,836,838,841,843,846],{"class":347,"line":837},31,[345,839,840],{"class":366},"    )",[345,842,635],{"class":605},[345,844,845],{"class":351}," array",[345,847,848],{"class":366}," {\n",[345,850,852,854],{"class":347,"line":851},32,[345,853,651],{"class":650},[345,855,856],{"class":366}," [\n",[345,858,860,863,865,868],{"class":347,"line":859},33,[345,861,862],{"class":688},"            ResponseDescription",[345,864,657],{"class":605},[345,866,867],{"class":628},"ok",[345,869,870],{"class":366},"()\n",[345,872,874,877,880,882,886,890,892],{"class":347,"line":873},34,[345,875,876],{"class":605},"                ->",[345,878,879],{"class":628},"description",[345,881,685],{"class":366},[345,883,885],{"class":884},"sjJ54","'",[345,887,889],{"class":888},"s_sjI","A CSV file",[345,891,885],{"class":884},[345,893,894],{"class":366},")\n",[345,896,898,900,903,905,907,910,912,914,917,919,922],{"class":347,"line":897},35,[345,899,876],{"class":605},[345,901,902],{"class":628},"content",[345,904,685],{"class":366},[345,906,885],{"class":884},[345,908,909],{"class":888},"text\u002Fcsv",[345,911,885],{"class":884},[345,913,698],{"class":366},[345,915,916],{"class":688}," Schema",[345,918,657],{"class":605},[345,920,921],{"class":628},"string",[345,923,924],{"class":366},"()),\n",[345,926,928],{"class":347,"line":927},36,[345,929,930],{"class":366},"        ];\n",[345,932,934],{"class":347,"line":933},37,[345,935,668],{"class":366},[345,937,939],{"class":347,"line":938},38,[345,940,941],{"class":366},"}\n",[333,943,944],{"v-slot:output":335},[337,945,949],{"className":946,"code":947,"language":948,"meta":335,"style":335},"language-json shiki shiki-themes material-theme-lighter github-light github-dark","{\n  \"200\": {\n    \"description\": \"A CSV file\",\n    \"content\": {\n      \"text\u002Fcsv\": { \"schema\": { \"type\": \"string\" } }\n    }\n  }\n}\n","json",[315,950,951,955,971,991,1003,1050,1054,1059],{"__ignoreMap":335},[345,952,953],{"class":347,"line":348},[345,954,590],{"class":366},[345,956,957,960,964,967,969],{"class":347,"line":370},[345,958,959],{"class":386},"  \"",[345,961,963],{"class":962},"sseR_","200",[345,965,966],{"class":386},"\"",[345,968,635],{"class":366},[345,970,848],{"class":366},[345,972,973,976,978,980,982,985,987,989],{"class":347,"line":377},[345,974,975],{"class":386},"    \"",[345,977,879],{"class":688},[345,979,966],{"class":386},[345,981,635],{"class":366},[345,983,984],{"class":884}," \"",[345,986,889],{"class":888},[345,988,966],{"class":884},[345,990,810],{"class":366},[345,992,993,995,997,999,1001],{"class":347,"line":399},[345,994,975],{"class":386},[345,996,902],{"class":688},[345,998,966],{"class":386},[345,1000,635],{"class":366},[345,1002,848],{"class":366},[345,1004,1005,1008,1010,1012,1014,1017,1019,1023,1025,1027,1029,1031,1034,1036,1038,1040,1042,1044,1047],{"class":347,"line":424},[345,1006,1007],{"class":386},"      \"",[345,1009,909],{"class":609},[345,1011,966],{"class":386},[345,1013,635],{"class":366},[345,1015,1016],{"class":366}," {",[345,1018,984],{"class":386},[345,1020,1022],{"class":1021},"swQdS","schema",[345,1024,966],{"class":386},[345,1026,635],{"class":366},[345,1028,1016],{"class":366},[345,1030,984],{"class":386},[345,1032,695],{"class":1033},"sAQsV",[345,1035,966],{"class":386},[345,1037,635],{"class":366},[345,1039,984],{"class":884},[345,1041,921],{"class":888},[345,1043,966],{"class":884},[345,1045,1046],{"class":366}," }",[345,1048,1049],{"class":366}," }\n",[345,1051,1052],{"class":347,"line":447},[345,1053,668],{"class":366},[345,1055,1056],{"class":347,"line":469},[345,1057,1058],{"class":366},"  }\n",[345,1060,1061],{"class":347,"line":495},[345,1062,941],{"class":366},[337,1064,1067],{"className":339,"code":1065,"filename":1066,"language":341,"meta":335,"style":335},"'extensions' => [\n    'response_extractors' => [App\\Docs\\CsvExportExtractor::class],\n],\n","config\u002Fopenapi.php",[315,1068,1069,1083,1117],{"__ignoreMap":335},[345,1070,1071,1073,1076,1078,1081],{"class":347,"line":348},[345,1072,885],{"class":884},[345,1074,1075],{"class":888},"extensions",[345,1077,885],{"class":884},[345,1079,1080],{"class":605}," =>",[345,1082,856],{"class":366},[345,1084,1085,1088,1091,1093,1095,1098,1101,1103,1105,1107,1110,1112,1114],{"class":347,"line":370},[345,1086,1087],{"class":884},"    '",[345,1089,1090],{"class":888},"response_extractors",[345,1092,885],{"class":884},[345,1094,1080],{"class":605},[345,1096,1097],{"class":366}," [",[345,1099,1100],{"class":383},"App",[345,1102,360],{"class":386},[345,1104,363],{"class":383},[345,1106,360],{"class":386},[345,1108,1109],{"class":688},"CsvExportExtractor",[345,1111,657],{"class":605},[345,1113,766],{"class":351},[345,1115,1116],{"class":366},"],\n",[345,1118,1119],{"class":347,"line":377},[345,1120,1116],{"class":366},[302,1122,1123,1125,1126,1128,1129,1132,1133,1136,1137,1140,1141,1144,1145,1148,1149,1152,1153,1156],{},[315,1124,535],{}," is the parsed return type, PHPDoc included: a ",[315,1127,513],{}," (a class or a built-in type, ",[315,1130,1131],{},"$type->name","), a\n",[315,1134,1135],{},"GenericType"," (",[315,1138,1139],{},"AnonymousResourceCollection\u003CUserResource>","), a ",[315,1142,1143],{},"UnionType",", an ",[315,1146,1147],{},"ArrayShapeType",", a ",[315,1150,1151],{},"ListType","… in\n",[315,1154,1155],{},"Ark4ne\\OpenApi\\Types",". A union is split before the extractors are asked: each member is extracted on its own.",[302,1158,1159,1160,1163,1164,1167],{},"The priorities of the built-in extractors go from 100 (",[315,1161,1162],{},"EmptyResponseExtractor",") to 320\n(",[315,1165,1166],{},"ResourceCollectionExtractor","); a priority above them makes yours win for the types it supports.",[302,1169,1170,1172,1173,1176,1177,1180,1181,1184,1185,1184,1188,1191,1192,1195,1196,1199],{},[315,1171,442],{}," is built with ",[315,1174,1175],{},"create(int|string $status)"," or ",[315,1178,1179],{},"ok()",", then ",[315,1182,1183],{},"description()",", ",[315,1186,1187],{},"content($mediaType, $schema)",[315,1189,1190],{},"headers(HeaderDescription …)"," and ",[315,1193,1194],{},"summary()",". A response declared with ",[315,1197,1198],{},"#[Response]"," still replaces yours\nfor its status.",[320,1201,1203],{"id":1202},"request-extractors","Request extractors",[302,1205,1206,1207,1210,1211,1214],{},"Every request extractor that supports the operation runs, by increasing priority, each refining the\n",[315,1208,1209],{},"RequestDescription"," the previous ones gave. The built-in ones run in this order: path parameters (0), form request\n(100), ",[315,1212,1213],{},"DescribesRequest"," (200), attributes (300).",[302,1216,1217,1218,635],{},"This one adds a header to every operation under ",[315,1219,1220],{},"\u002Fapi\u002Ftenants\u002F",[337,1222,1225],{"className":339,"code":1223,"filename":1224,"language":341,"meta":335,"style":335},"namespace App\\Docs;\n\nuse Ark4ne\\OpenApi\\Context\\GenerationContext;\nuse Ark4ne\\OpenApi\\Description\\ParameterDescription;\nuse Ark4ne\\OpenApi\\Description\\RequestDescription;\nuse Ark4ne\\OpenApi\\Extraction\\OperationContext;\nuse Ark4ne\\OpenApi\\Extraction\\Requests\\RequestExtractor;\nuse Ark4ne\\OpenApiWriter\\Objects\\Schema;\n\nfinal class TenantHeaderExtractor implements RequestExtractor\n{\n    public const PRIORITY = 150;\n\n    public function priority(): int\n    {\n        return self::PRIORITY;\n    }\n\n    public function supports(OperationContext $operation): bool\n    {\n        return str_starts_with($operation->path, '\u002Fapi\u002Ftenants\u002F');\n    }\n\n    public function extract(\n        OperationContext $operation,\n        RequestDescription $request,\n        GenerationContext $context,\n    ): RequestDescription {\n        return $request->addParameters(\n            ParameterDescription::header(\n                'X-Tenant',\n                Schema::string()->format('uuid'),\n            )\n                ->required()\n                ->description('Tenant of the request'),\n        );\n    }\n}\n","app\u002FDocs\u002FTenantHeaderExtractor.php",[315,1226,1227,1239,1243,1263,1284,1304,1324,1349,1369,1373,1387,1391,1406,1410,1424,1428,1440,1444,1448,1470,1474,1501,1505,1509,1519,1529,1541,1551,1562,1577,1589,1601,1629,1634,1643,1660,1665,1669],{"__ignoreMap":335},[345,1228,1229,1231,1233,1235,1237],{"class":347,"line":348},[345,1230,352],{"class":351},[345,1232,356],{"class":355},[345,1234,360],{"class":359},[345,1236,363],{"class":355},[345,1238,367],{"class":366},[345,1240,1241],{"class":347,"line":370},[345,1242,374],{"emptyLinePlaceholder":373},[345,1244,1245,1247,1249,1251,1253,1255,1257,1259,1261],{"class":347,"line":377},[345,1246,380],{"class":351},[345,1248,404],{"class":383},[345,1250,360],{"class":386},[345,1252,409],{"class":383},[345,1254,360],{"class":386},[345,1256,414],{"class":383},[345,1258,360],{"class":386},[345,1260,419],{"class":383},[345,1262,367],{"class":366},[345,1264,1265,1267,1269,1271,1273,1275,1277,1279,1282],{"class":347,"line":399},[345,1266,380],{"class":351},[345,1268,404],{"class":383},[345,1270,360],{"class":386},[345,1272,409],{"class":383},[345,1274,360],{"class":386},[345,1276,437],{"class":383},[345,1278,360],{"class":386},[345,1280,1281],{"class":383},"ParameterDescription",[345,1283,367],{"class":366},[345,1285,1286,1288,1290,1292,1294,1296,1298,1300,1302],{"class":347,"line":424},[345,1287,380],{"class":351},[345,1289,404],{"class":383},[345,1291,360],{"class":386},[345,1293,409],{"class":383},[345,1295,360],{"class":386},[345,1297,437],{"class":383},[345,1299,360],{"class":386},[345,1301,1209],{"class":383},[345,1303,367],{"class":366},[345,1305,1306,1308,1310,1312,1314,1316,1318,1320,1322],{"class":347,"line":447},[345,1307,380],{"class":351},[345,1309,404],{"class":383},[345,1311,360],{"class":386},[345,1313,409],{"class":383},[345,1315,360],{"class":386},[345,1317,460],{"class":383},[345,1319,360],{"class":386},[345,1321,317],{"class":383},[345,1323,367],{"class":366},[345,1325,1326,1328,1330,1332,1334,1336,1338,1340,1342,1344,1347],{"class":347,"line":469},[345,1327,380],{"class":351},[345,1329,404],{"class":383},[345,1331,360],{"class":386},[345,1333,409],{"class":383},[345,1335,360],{"class":386},[345,1337,460],{"class":383},[345,1339,360],{"class":386},[345,1341,150],{"class":383},[345,1343,360],{"class":386},[345,1345,1346],{"class":383},"RequestExtractor",[345,1348,367],{"class":366},[345,1350,1351,1353,1355,1357,1359,1361,1363,1365,1367],{"class":347,"line":495},[345,1352,380],{"class":351},[345,1354,404],{"class":383},[345,1356,360],{"class":386},[345,1358,548],{"class":383},[345,1360,360],{"class":386},[345,1362,553],{"class":383},[345,1364,360],{"class":386},[345,1366,558],{"class":383},[345,1368,367],{"class":366},[345,1370,1371],{"class":347,"line":518},[345,1372,374],{"emptyLinePlaceholder":373},[345,1374,1375,1377,1379,1382,1384],{"class":347,"line":29},[345,1376,572],{"class":571},[345,1378,575],{"class":571},[345,1380,1381],{"class":355}," TenantHeaderExtractor",[345,1383,581],{"class":571},[345,1385,1386],{"class":355}," RequestExtractor\n",[345,1388,1389],{"class":347,"line":563},[345,1390,590],{"class":366},[345,1392,1393,1395,1397,1399,1401,1404],{"class":347,"line":568},[345,1394,596],{"class":571},[345,1396,599],{"class":571},[345,1398,602],{"class":383},[345,1400,606],{"class":605},[345,1402,1403],{"class":609}," 150",[345,1405,367],{"class":366},[345,1407,1408],{"class":347,"line":587},[345,1409,374],{"emptyLinePlaceholder":373},[345,1411,1412,1414,1416,1418,1420,1422],{"class":347,"line":593},[345,1413,596],{"class":571},[345,1415,625],{"class":571},[345,1417,629],{"class":628},[345,1419,632],{"class":366},[345,1421,635],{"class":605},[345,1423,638],{"class":351},[345,1425,1426],{"class":347,"line":615},[345,1427,644],{"class":366},[345,1429,1430,1432,1434,1436,1438],{"class":347,"line":620},[345,1431,651],{"class":650},[345,1433,654],{"class":571},[345,1435,657],{"class":605},[345,1437,660],{"class":383},[345,1439,367],{"class":366},[345,1441,1442],{"class":347,"line":641},[345,1443,668],{"class":366},[345,1445,1446],{"class":347,"line":647},[345,1447,374],{"emptyLinePlaceholder":373},[345,1449,1450,1452,1454,1456,1458,1460,1462,1464,1466,1468],{"class":347,"line":665},[345,1451,596],{"class":571},[345,1453,625],{"class":571},[345,1455,682],{"class":628},[345,1457,685],{"class":366},[345,1459,317],{"class":688},[345,1461,691],{"class":366},[345,1463,706],{"class":694},[345,1465,709],{"class":366},[345,1467,635],{"class":605},[345,1469,714],{"class":351},[345,1471,1472],{"class":347,"line":58},[345,1473,644],{"class":366},[345,1475,1476,1478,1481,1483,1485,1487,1490,1492,1495,1497,1499],{"class":347,"line":675},[345,1477,651],{"class":650},[345,1479,1480],{"class":744}," str_starts_with",[345,1482,748],{"class":366},[345,1484,706],{"class":694},[345,1486,753],{"class":605},[345,1488,1489],{"class":694},"path",[345,1491,698],{"class":366},[345,1493,1494],{"class":884}," '",[345,1496,1220],{"class":888},[345,1498,885],{"class":884},[345,1500,774],{"class":366},[345,1502,1503],{"class":347,"line":717},[345,1504,668],{"class":366},[345,1506,1507],{"class":347,"line":722},[345,1508,374],{"emptyLinePlaceholder":373},[345,1510,1511,1513,1515,1517],{"class":347,"line":738},[345,1512,596],{"class":571},[345,1514,625],{"class":571},[345,1516,794],{"class":628},[345,1518,797],{"class":366},[345,1520,1521,1523,1525,1527],{"class":347,"line":777},[345,1522,816],{"class":688},[345,1524,691],{"class":366},[345,1526,706],{"class":694},[345,1528,810],{"class":366},[345,1530,1531,1534,1536,1539],{"class":347,"line":782},[345,1532,1533],{"class":688},"        RequestDescription",[345,1535,691],{"class":366},[345,1537,1538],{"class":694},"request",[345,1540,810],{"class":366},[345,1542,1543,1545,1547,1549],{"class":347,"line":787},[345,1544,827],{"class":688},[345,1546,691],{"class":366},[345,1548,832],{"class":694},[345,1550,810],{"class":366},[345,1552,1553,1555,1557,1560],{"class":347,"line":800},[345,1554,840],{"class":366},[345,1556,635],{"class":605},[345,1558,1559],{"class":688}," RequestDescription",[345,1561,848],{"class":366},[345,1563,1564,1566,1568,1570,1572,1575],{"class":347,"line":813},[345,1565,651],{"class":650},[345,1567,691],{"class":366},[345,1569,1538],{"class":694},[345,1571,753],{"class":605},[345,1573,1574],{"class":628},"addParameters",[345,1576,797],{"class":366},[345,1578,1579,1582,1584,1587],{"class":347,"line":84},[345,1580,1581],{"class":688},"            ParameterDescription",[345,1583,657],{"class":605},[345,1585,1586],{"class":628},"header",[345,1588,797],{"class":366},[345,1590,1591,1594,1597,1599],{"class":347,"line":837},[345,1592,1593],{"class":884},"                '",[345,1595,1596],{"class":888},"X-Tenant",[345,1598,885],{"class":884},[345,1600,810],{"class":366},[345,1602,1603,1606,1608,1610,1612,1614,1617,1619,1621,1624,1626],{"class":347,"line":851},[345,1604,1605],{"class":688},"                Schema",[345,1607,657],{"class":605},[345,1609,921],{"class":628},[345,1611,632],{"class":366},[345,1613,753],{"class":605},[345,1615,1616],{"class":628},"format",[345,1618,685],{"class":366},[345,1620,885],{"class":884},[345,1622,1623],{"class":888},"uuid",[345,1625,885],{"class":884},[345,1627,1628],{"class":366},"),\n",[345,1630,1631],{"class":347,"line":859},[345,1632,1633],{"class":366},"            )\n",[345,1635,1636,1638,1641],{"class":347,"line":873},[345,1637,876],{"class":605},[345,1639,1640],{"class":628},"required",[345,1642,870],{"class":366},[345,1644,1645,1647,1649,1651,1653,1656,1658],{"class":347,"line":897},[345,1646,876],{"class":605},[345,1648,879],{"class":628},[345,1650,685],{"class":366},[345,1652,885],{"class":884},[345,1654,1655],{"class":888},"Tenant of the request",[345,1657,885],{"class":884},[345,1659,1628],{"class":366},[345,1661,1662],{"class":347,"line":927},[345,1663,1664],{"class":366},"        );\n",[345,1666,1667],{"class":347,"line":933},[345,1668,668],{"class":366},[345,1670,1671],{"class":347,"line":938},[345,1672,941],{"class":366},[302,1674,1675,1676,1679],{},"At 150, it runs after the form request and before the attributes: a ",[315,1677,1678],{},"#[Header('X-Tenant', …)]"," on an action still\ncompletes it.",[302,1681,1682,1684,1685,1136,1688,1184,1691,1184,1694,1184,1697,1700,1701,1704,1705,1708,1709,1712,1713,1716],{},[315,1683,1209],{}," holds the ",[315,1686,1687],{},"parameters",[315,1689,1690],{},"ParameterDescription::path()",[315,1692,1693],{},"query()",[315,1695,1696],{},"header()",[315,1698,1699],{},"cookie()","), the\n",[315,1702,1703],{},"fields"," of the rules, the ",[315,1706,1707],{},"body"," and two flags, ",[315,1710,1711],{},"validated"," (adds the 422) and ",[315,1714,1715],{},"authorized"," (adds the 403).",[1718,1719,1720],"tip",{},[302,1721,1722,1723,1728],{},"A header that depends on a middleware is better described by a\n",[1724,1725,1727],"a",{"href":1726},"\u002Flaravel-openapi-generator\u002Fextending\u002Fpasses-and-middlewares#middleware-mappers","middleware mapper",": it follows the\nmiddleware wherever it is used.",[320,1730,1732],{"id":1731},"the-operation-context","The operation context",[1734,1735,1736,1749],"table",{},[1737,1738,1739],"thead",{},[1740,1741,1742,1746],"tr",{},[1743,1744,1745],"th",{},"Member",[1743,1747,1748],{},"Holds",[1750,1751,1752,1787,1799,1816,1837,1850],"tbody",{},[1740,1753,1754,1760],{},[1755,1756,1757],"td",{},[315,1758,1759],{},"route",[1755,1761,1762,1763,1766,1767,1184,1769,1184,1772,1184,1775,1184,1778,1184,1781,1136,1784,709],{},"the ",[315,1764,1765],{},"RouteDefinition",": ",[315,1768,756],{},[315,1770,1771],{},"domain",[315,1773,1774],{},"controller",[315,1776,1777],{},"action",[315,1779,1780],{},"middlewares",[315,1782,1783],{},"label()",[315,1785,1786],{},"GET \u002Fapi\u002Fusers",[1740,1788,1789,1796],{},[1755,1790,1791,1184,1794],{},[315,1792,1793],{},"method",[315,1795,1489],{},[1755,1797,1798],{},"the HTTP method and the OpenAPI path of the operation",[1740,1800,1801,1805],{},[1755,1802,1803],{},[315,1804,1777],{},[1755,1806,1807,1808,1811,1812,1815],{},"the reflected action (",[315,1809,1810],{},"ReflectionMethod",", or ",[315,1813,1814],{},"ReflectionFunction"," for a closure)",[1740,1817,1818,1823],{},[1755,1819,1820],{},[315,1821,1822],{},"doc",[1755,1824,1825,1826,1184,1828,1184,1830,1833,1834],{},"the PHPDoc of the action: ",[315,1827,1194],{},[315,1829,1183],{},[315,1831,1832],{},"isDeprecated()",", and its parsed ",[315,1835,1836],{},"node",[1740,1838,1839,1847],{},[1755,1840,1841,1184,1844],{},[315,1842,1843],{},"returnType",[315,1845,1846],{},"requestType",[1755,1848,1849],{},"the parsed return type and form request type",[1740,1851,1852,1857],{},[1755,1853,1854],{},[315,1855,1856],{},"attributes(Attr::class, $context)",[1755,1858,1859],{},"the attributes of the class and of the action, the action's last",[1861,1862,1863],"style",{},"html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .stp6e, html code.shiki .stp6e{--shiki-light:#39ADB5;--shiki-default:#6F42C1;--shiki-dark:#B392F0}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 .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .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 .sseR_, html code.shiki .sseR_{--shiki-light:#9C3EDA;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .swQdS, html code.shiki .swQdS{--shiki-light:#E53935;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sAQsV, html code.shiki .sAQsV{--shiki-light:#916B53;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":335,"searchDepth":377,"depth":377,"links":1865},[1866,1867,1868],{"id":322,"depth":370,"text":323},{"id":1202,"depth":370,"text":1203},{"id":1731,"depth":370,"text":1732},"Describe a return type the generator does not know, and add parameters or bodies from another source.","md",{},"---\ntitle: Request & response extractors\ndescription: Describe a return type the generator does not know, and add parameters or bodies from another source.\n---\n\nExtractors read an operation. A **response extractor** describes the responses of one return type; a **request\nextractor** refines what the operation receives. Both receive an `OperationContext`: the route, the HTTP method and path,\nthe reflected action, its PHPDoc and its return type.\n\n## Response extractors\n\nThe first response extractor that supports the return type, by decreasing priority, describes its responses. Add one\nfor a type of your application:\n\n::example{input=\"app\u002FDocs\u002FCsvExportExtractor.php\" output=\"responses\"}\n#input\n```php\nnamespace App\\Docs;\n\nuse App\\Exports\\CsvExport;\nuse Ark4ne\\OpenApi\\Context\\GenerationContext;\nuse Ark4ne\\OpenApi\\Description\\ResponseDescription;\nuse Ark4ne\\OpenApi\\Extraction\\OperationContext;\nuse Ark4ne\\OpenApi\\Extraction\\Responses\\ResponseExtractor;\nuse Ark4ne\\OpenApi\\Types\\NamedType;\nuse Ark4ne\\OpenApi\\Types\\Type;\nuse Ark4ne\\OpenApiWriter\\Objects\\Schema;\n\nfinal class CsvExportExtractor implements ResponseExtractor\n{\n    public const PRIORITY = 500;\n\n    public function priority(): int\n    {\n        return self::PRIORITY;\n    }\n\n    public function supports(Type $type, OperationContext $operation): bool\n    {\n        return $type instanceof NamedType\n            && is_a($type->name, CsvExport::class, true);\n    }\n\n    public function extract(\n        Type $type,\n        OperationContext $operation,\n        GenerationContext $context,\n    ): array {\n        return [\n            ResponseDescription::ok()\n                ->description('A CSV file')\n                ->content('text\u002Fcsv', Schema::string()),\n        ];\n    }\n}\n```\n#output\n```json\n{\n  \"200\": {\n    \"description\": \"A CSV file\",\n    \"content\": {\n      \"text\u002Fcsv\": { \"schema\": { \"type\": \"string\" } }\n    }\n  }\n}\n```\n::\n\n```php [config\u002Fopenapi.php]\n'extensions' => [\n    'response_extractors' => [App\\Docs\\CsvExportExtractor::class],\n],\n```\n\n`Type` is the parsed return type, PHPDoc included: a `NamedType` (a class or a built-in type, `$type->name`), a\n`GenericType` (`AnonymousResourceCollection\u003CUserResource>`), a `UnionType`, an `ArrayShapeType`, a `ListType`… in\n`Ark4ne\\OpenApi\\Types`. A union is split before the extractors are asked: each member is extracted on its own.\n\nThe priorities of the built-in extractors go from 100 (`EmptyResponseExtractor`) to 320\n(`ResourceCollectionExtractor`); a priority above them makes yours win for the types it supports.\n\n`ResponseDescription` is built with `create(int|string $status)` or `ok()`, then `description()`, `content($mediaType,\n$schema)`, `headers(HeaderDescription …)` and `summary()`. A response declared with `#[Response]` still replaces yours\nfor its status.\n\n## Request extractors\n\nEvery request extractor that supports the operation runs, by increasing priority, each refining the\n`RequestDescription` the previous ones gave. The built-in ones run in this order: path parameters (0), form request\n(100), `DescribesRequest` (200), attributes (300).\n\nThis one adds a header to every operation under `\u002Fapi\u002Ftenants\u002F`:\n\n```php [app\u002FDocs\u002FTenantHeaderExtractor.php]\nnamespace App\\Docs;\n\nuse Ark4ne\\OpenApi\\Context\\GenerationContext;\nuse Ark4ne\\OpenApi\\Description\\ParameterDescription;\nuse Ark4ne\\OpenApi\\Description\\RequestDescription;\nuse Ark4ne\\OpenApi\\Extraction\\OperationContext;\nuse Ark4ne\\OpenApi\\Extraction\\Requests\\RequestExtractor;\nuse Ark4ne\\OpenApiWriter\\Objects\\Schema;\n\nfinal class TenantHeaderExtractor implements RequestExtractor\n{\n    public const PRIORITY = 150;\n\n    public function priority(): int\n    {\n        return self::PRIORITY;\n    }\n\n    public function supports(OperationContext $operation): bool\n    {\n        return str_starts_with($operation->path, '\u002Fapi\u002Ftenants\u002F');\n    }\n\n    public function extract(\n        OperationContext $operation,\n        RequestDescription $request,\n        GenerationContext $context,\n    ): RequestDescription {\n        return $request->addParameters(\n            ParameterDescription::header(\n                'X-Tenant',\n                Schema::string()->format('uuid'),\n            )\n                ->required()\n                ->description('Tenant of the request'),\n        );\n    }\n}\n```\n\nAt 150, it runs after the form request and before the attributes: a `#[Header('X-Tenant', …)]` on an action still\ncompletes it.\n\n`RequestDescription` holds the `parameters` (`ParameterDescription::path()`, `query()`, `header()`, `cookie()`), the\n`fields` of the rules, the `body` and two flags, `validated` (adds the 422) and `authorized` (adds the 403).\n\n::tip\nA header that depends on a middleware is better described by a\n[middleware mapper](\u002Flaravel-openapi-generator\u002Fextending\u002Fpasses-and-middlewares#middleware-mappers): it follows the\nmiddleware wherever it is used.\n::\n\n## The operation context\n\n| Member | Holds |\n| --- | --- |\n| `route` | the `RouteDefinition`: `name`, `domain`, `controller`, `action`, `middlewares`, `label()` (`GET \u002Fapi\u002Fusers`) |\n| `method`, `path` | the HTTP method and the OpenAPI path of the operation |\n| `action` | the reflected action (`ReflectionMethod`, or `ReflectionFunction` for a closure) |\n| `doc` | the PHPDoc of the action: `summary()`, `description()`, `isDeprecated()`, and its parsed `node` |\n| `returnType`, `requestType` | the parsed return type and form request type |\n| `attributes(Attr::class, $context)` | the attributes of the class and of the action, the action's last |\n",{"title":228,"description":1869},"qolZ5G0ld2O-Zl7H9y_Z4Eth2IggPEi3w9wirXmRt2I",[1876,1878],{"title":224,"path":225,"stem":226,"description":1877,"children":-1},"Describe a validation rule the generator does not know, or change how a built-in rule is described.",{"title":232,"path":233,"stem":234,"description":1879,"children":-1},"Add metadata to the operations, and name summaries, tags, operation ids and query parameters your own way.",1795438904320]