[{"data":1,"prerenderedAt":1387},["ShallowReactive",2],{"libs":3,"navigation-laravel-openapi-generator":115,"\u002Flaravel-openapi-generator\u002Fextending\u002Frule-mappers":296,"\u002Flaravel-openapi-generator\u002Fextending\u002Frule-mappers-surround":1382},[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":224,"body":298,"description":1376,"experimental":119,"extension":1377,"links":118,"meta":1378,"navigation":398,"path":225,"rawbody":1379,"seo":1380,"since":118,"stem":226,"__hash__":1381},"laravel_openapi_generator\u002Flaravel-openapi-generator\u002F5.extending\u002F2.rule-mappers.md",{"type":299,"value":300,"toc":1371},"minimark",[301,329,347,352,909,968,974,978,994,999,1095,1100,1190,1196,1200,1203,1367],[302,303,304,305,309,310,313,314,313,317,320,321,324,325,328],"p",{},"A rule mapper turns one validation rule into constraints of a field. The generator has one per built-in rule\n(",[306,307,308],"code",{},"SizeRuleMapper"," handles ",[306,311,312],{},"min",", ",[306,315,316],{},"max",[306,318,319],{},"between"," and ",[306,322,323],{},"size","); add yours for a rule registered by name with\n",[306,326,327],{},"Validator::extend()",", or to replace a built-in one.",[302,330,331,332,336,337,340,341,346],{},"For a rule ",[333,334,335],"strong",{},"object"," of your application, implement ",[306,338,339],{},"DescribesRule"," on the rule instead; see\n",[342,343,345],"a",{"href":344},"\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Frequests#a-rule-that-describes-itself","A rule that describes itself",".",[348,349,351],"h2",{"id":350},"write-a-mapper","Write a mapper",[353,354,357,774],"example",{"input":355,"output":356},"app\u002FDocs\u002FPhoneRuleMapper.php","the field phone",[358,359,361],"template",{"v-slot:input":360},"",[362,363,367],"pre",{"className":364,"code":365,"language":366,"meta":360,"style":360},"language-php shiki shiki-themes material-theme-lighter github-light github-dark","namespace App\\Docs;\n\nuse Ark4ne\\OpenApi\\Context\\GenerationContext;\nuse Ark4ne\\OpenApi\\Description\\FieldDescription;\nuse Ark4ne\\OpenApi\\Extraction\\Rules\\RuleInvocation;\nuse Ark4ne\\OpenApi\\Extraction\\Rules\\RuleMapper;\n\n\u002F**\n * `phone`, a rule registered with Validator::extend(): an E.164 phone number.\n *\u002F\nfinal class PhoneRuleMapper implements RuleMapper\n{\n    public function handles(): array\n    {\n        return ['phone'];\n    }\n\n    public function map(\n        RuleInvocation $rule,\n        FieldDescription $field,\n        GenerationContext $context,\n    ): FieldDescription {\n        return $field->schema(\n            $field->schema\n                ->type('string')\n                ->pattern('^\\+[1-9][0-9]{6,14}$'),\n        );\n    }\n}\n","php",[306,368,369,393,400,428,451,479,505,510,517,523,528,547,553,576,582,605,611,616,629,646,658,671,685,702,715,737,757,763,768],{"__ignoreMap":360},[370,371,374,378,382,386,389],"span",{"class":372,"line":373},"line",1,[370,375,377],{"class":376},"sw1J6","namespace",[370,379,381],{"class":380},"sbgvK"," App",[370,383,385],{"class":384},"stp6e","\\",[370,387,388],{"class":380},"Docs",[370,390,392],{"class":391},"sP7_E",";\n",[370,394,396],{"class":372,"line":395},2,[370,397,399],{"emptyLinePlaceholder":398},true,"\n",[370,401,403,406,410,413,416,418,421,423,426],{"class":372,"line":402},3,[370,404,405],{"class":376},"use",[370,407,409],{"class":408},"s_hVV"," Ark4ne",[370,411,385],{"class":412},"s39Yj",[370,414,415],{"class":408},"OpenApi",[370,417,385],{"class":412},[370,419,420],{"class":408},"Context",[370,422,385],{"class":412},[370,424,425],{"class":408},"GenerationContext",[370,427,392],{"class":391},[370,429,431,433,435,437,439,441,444,446,449],{"class":372,"line":430},4,[370,432,405],{"class":376},[370,434,409],{"class":408},[370,436,385],{"class":412},[370,438,415],{"class":408},[370,440,385],{"class":412},[370,442,443],{"class":408},"Description",[370,445,385],{"class":412},[370,447,448],{"class":408},"FieldDescription",[370,450,392],{"class":391},[370,452,454,456,458,460,462,464,467,469,472,474,477],{"class":372,"line":453},5,[370,455,405],{"class":376},[370,457,409],{"class":408},[370,459,385],{"class":412},[370,461,415],{"class":408},[370,463,385],{"class":412},[370,465,466],{"class":408},"Extraction",[370,468,385],{"class":412},[370,470,471],{"class":408},"Rules",[370,473,385],{"class":412},[370,475,476],{"class":408},"RuleInvocation",[370,478,392],{"class":391},[370,480,482,484,486,488,490,492,494,496,498,500,503],{"class":372,"line":481},6,[370,483,405],{"class":376},[370,485,409],{"class":408},[370,487,385],{"class":412},[370,489,415],{"class":408},[370,491,385],{"class":412},[370,493,466],{"class":408},[370,495,385],{"class":412},[370,497,471],{"class":408},[370,499,385],{"class":412},[370,501,502],{"class":408},"RuleMapper",[370,504,392],{"class":391},[370,506,508],{"class":372,"line":507},7,[370,509,399],{"emptyLinePlaceholder":398},[370,511,513],{"class":372,"line":512},8,[370,514,516],{"class":515},"sutJx","\u002F**\n",[370,518,520],{"class":372,"line":519},9,[370,521,522],{"class":515}," * `phone`, a rule registered with Validator::extend(): an E.164 phone number.\n",[370,524,525],{"class":372,"line":29},[370,526,527],{"class":515}," *\u002F\n",[370,529,531,535,538,541,544],{"class":372,"line":530},11,[370,532,534],{"class":533},"sbsja","final",[370,536,537],{"class":533}," class",[370,539,540],{"class":380}," PhoneRuleMapper",[370,542,543],{"class":533}," implements",[370,545,546],{"class":380}," RuleMapper\n",[370,548,550],{"class":372,"line":549},12,[370,551,552],{"class":391},"{\n",[370,554,556,559,562,566,569,573],{"class":372,"line":555},13,[370,557,558],{"class":533},"    public",[370,560,561],{"class":533}," function",[370,563,565],{"class":564},"sGLFI"," handles",[370,567,568],{"class":391},"()",[370,570,572],{"class":571},"smGrS",":",[370,574,575],{"class":376}," array\n",[370,577,579],{"class":372,"line":578},14,[370,580,581],{"class":391},"    {\n",[370,583,585,589,592,596,600,602],{"class":372,"line":584},15,[370,586,588],{"class":587},"sVHd0","        return",[370,590,591],{"class":391}," [",[370,593,595],{"class":594},"sjJ54","'",[370,597,599],{"class":598},"s_sjI","phone",[370,601,595],{"class":594},[370,603,604],{"class":391},"];\n",[370,606,608],{"class":372,"line":607},16,[370,609,610],{"class":391},"    }\n",[370,612,614],{"class":372,"line":613},17,[370,615,399],{"emptyLinePlaceholder":398},[370,617,619,621,623,626],{"class":372,"line":618},18,[370,620,558],{"class":533},[370,622,561],{"class":533},[370,624,625],{"class":564}," map",[370,627,628],{"class":391},"(\n",[370,630,632,636,639,643],{"class":372,"line":631},19,[370,633,635],{"class":634},"sZMiF","        RuleInvocation",[370,637,638],{"class":391}," $",[370,640,642],{"class":641},"su5hD","rule",[370,644,645],{"class":391},",\n",[370,647,648,651,653,656],{"class":372,"line":58},[370,649,650],{"class":634},"        FieldDescription",[370,652,638],{"class":391},[370,654,655],{"class":641},"field",[370,657,645],{"class":391},[370,659,661,664,666,669],{"class":372,"line":660},21,[370,662,663],{"class":634},"        GenerationContext",[370,665,638],{"class":391},[370,667,668],{"class":641},"context",[370,670,645],{"class":391},[370,672,674,677,679,682],{"class":372,"line":673},22,[370,675,676],{"class":391},"    )",[370,678,572],{"class":571},[370,680,681],{"class":634}," FieldDescription",[370,683,684],{"class":391}," {\n",[370,686,688,690,692,694,697,700],{"class":372,"line":687},23,[370,689,588],{"class":587},[370,691,638],{"class":391},[370,693,655],{"class":641},[370,695,696],{"class":571},"->",[370,698,699],{"class":564},"schema",[370,701,628],{"class":391},[370,703,705,708,710,712],{"class":372,"line":704},24,[370,706,707],{"class":391},"            $",[370,709,655],{"class":641},[370,711,696],{"class":571},[370,713,714],{"class":641},"schema\n",[370,716,718,721,724,727,729,732,734],{"class":372,"line":717},25,[370,719,720],{"class":571},"                ->",[370,722,723],{"class":564},"type",[370,725,726],{"class":391},"(",[370,728,595],{"class":594},[370,730,731],{"class":598},"string",[370,733,595],{"class":594},[370,735,736],{"class":391},")\n",[370,738,740,742,745,747,749,752,754],{"class":372,"line":739},26,[370,741,720],{"class":571},[370,743,744],{"class":564},"pattern",[370,746,726],{"class":391},[370,748,595],{"class":594},[370,750,751],{"class":598},"^\\+[1-9][0-9]{6,14}$",[370,753,595],{"class":594},[370,755,756],{"class":391},"),\n",[370,758,760],{"class":372,"line":759},27,[370,761,762],{"class":391},"        );\n",[370,764,766],{"class":372,"line":765},28,[370,767,610],{"class":391},[370,769,771],{"class":372,"line":770},29,[370,772,773],{"class":391},"}\n",[358,775,776],{"v-slot:output":360},[362,777,781],{"className":778,"code":779,"language":780,"meta":360,"style":360},"language-json shiki shiki-themes material-theme-lighter github-light github-dark","{\n  \"type\": \"object\",\n  \"required\": [\"phone\"],\n  \"properties\": {\n    \"phone\": { \"type\": \"string\", \"pattern\": \"^\\\\+[1-9][0-9]{6,14}$\" }\n  }\n}\n","json",[306,782,783,787,809,831,844,900,905],{"__ignoreMap":360},[370,784,785],{"class":372,"line":373},[370,786,552],{"class":391},[370,788,789,792,795,798,800,803,805,807],{"class":372,"line":395},[370,790,791],{"class":412},"  \"",[370,793,723],{"class":794},"sseR_",[370,796,797],{"class":412},"\"",[370,799,572],{"class":391},[370,801,802],{"class":594}," \"",[370,804,335],{"class":598},[370,806,797],{"class":594},[370,808,645],{"class":391},[370,810,811,813,816,818,820,822,824,826,828],{"class":372,"line":402},[370,812,791],{"class":412},[370,814,815],{"class":794},"required",[370,817,797],{"class":412},[370,819,572],{"class":391},[370,821,591],{"class":391},[370,823,797],{"class":594},[370,825,599],{"class":598},[370,827,797],{"class":594},[370,829,830],{"class":391},"],\n",[370,832,833,835,838,840,842],{"class":372,"line":430},[370,834,791],{"class":412},[370,836,837],{"class":794},"properties",[370,839,797],{"class":412},[370,841,572],{"class":391},[370,843,684],{"class":391},[370,845,846,849,851,853,855,858,860,863,865,867,869,871,873,876,878,880,882,884,886,889,892,895,897],{"class":372,"line":453},[370,847,848],{"class":412},"    \"",[370,850,599],{"class":634},[370,852,797],{"class":412},[370,854,572],{"class":391},[370,856,857],{"class":391}," {",[370,859,802],{"class":412},[370,861,723],{"class":862},"srdBf",[370,864,797],{"class":412},[370,866,572],{"class":391},[370,868,802],{"class":594},[370,870,731],{"class":598},[370,872,797],{"class":594},[370,874,875],{"class":391},",",[370,877,802],{"class":412},[370,879,744],{"class":862},[370,881,797],{"class":412},[370,883,572],{"class":391},[370,885,802],{"class":594},[370,887,888],{"class":598},"^",[370,890,891],{"class":408},"\\\\",[370,893,894],{"class":598},"+[1-9][0-9]{6,14}$",[370,896,797],{"class":594},[370,898,899],{"class":391}," }\n",[370,901,902],{"class":372,"line":481},[370,903,904],{"class":391},"  }\n",[370,906,907],{"class":372,"line":507},[370,908,773],{"class":391},[362,910,913],{"className":364,"code":911,"filename":912,"language":366,"meta":360,"style":360},"'extensions' => [\n    'rule_mappers' => [App\\Docs\\PhoneRuleMapper::class],\n],\n","config\u002Fopenapi.php",[306,914,915,930,964],{"__ignoreMap":360},[370,916,917,919,922,924,927],{"class":372,"line":373},[370,918,595],{"class":594},[370,920,921],{"class":598},"extensions",[370,923,595],{"class":594},[370,925,926],{"class":571}," =>",[370,928,929],{"class":391}," [\n",[370,931,932,935,938,940,942,944,947,949,951,953,956,959,962],{"class":372,"line":395},[370,933,934],{"class":594},"    '",[370,936,937],{"class":598},"rule_mappers",[370,939,595],{"class":594},[370,941,926],{"class":571},[370,943,591],{"class":391},[370,945,946],{"class":408},"App",[370,948,385],{"class":412},[370,950,388],{"class":408},[370,952,385],{"class":412},[370,954,955],{"class":634},"PhoneRuleMapper",[370,957,958],{"class":571},"::",[370,960,961],{"class":376},"class",[370,963,830],{"class":391},[370,965,966],{"class":372,"line":402},[370,967,830],{"class":391},[302,969,970,971,346],{},"The form request uses the rule as usual: ",[306,972,973],{},"'phone' => 'required|phone'",[348,975,977],{"id":976},"what-a-mapper-receives","What a mapper receives",[302,979,980,983,984,313,986,989,990,993],{},[306,981,982],{},"handles()"," lists the rule names (snake case: ",[306,985,599],{},[306,987,988],{},"required_if",") and the rule classes\n(",[306,991,992],{},"Illuminate\\Validation\\Rules\\Enum",") the mapper describes. A mapper of yours replaces the built-in mapper of the same\nrule.",[302,995,996,998],{},[306,997,476],{}," is one rule applied to one field:",[1000,1001,1002,1015],"table",{},[1003,1004,1005],"thead",{},[1006,1007,1008,1012],"tr",{},[1009,1010,1011],"th",{},"Property",[1009,1013,1014],{},"Holds",[1016,1017,1018,1035,1045,1062,1078],"tbody",{},[1006,1019,1020,1025],{},[1021,1022,1023],"td",{},[306,1024,655],{},[1021,1026,1027,1028,313,1031,1034],{},"the field, as written in the rules (",[306,1029,1030],{},"address.city",[306,1032,1033],{},"tags.*",")",[1006,1036,1037,1042],{},[1021,1038,1039],{},[306,1040,1041],{},"name",[1021,1043,1044],{},"the rule name, or the class of a rule object",[1006,1046,1047,1052],{},[1021,1048,1049],{},[306,1050,1051],{},"parameters",[1021,1053,1054,1055,1058,1059],{},"the parameters: ",[306,1056,1057],{},"max:255"," gives ",[306,1060,1061],{},"['255']",[1006,1063,1064,1068],{},[1021,1065,1066],{},[306,1067,642],{},[1021,1069,1070,1071,313,1074,1077],{},"the rule object, for ",[306,1072,1073],{},"Rule::enum()",[306,1075,1076],{},"Password"," or your own",[1006,1079,1080,1085],{},[1021,1081,1082],{},[306,1083,1084],{},"conditional",[1021,1086,1087,1090,1091,1094],{},[306,1088,1089],{},"true"," when the rule comes from ",[306,1092,1093],{},"Rule::when()",": it applies in some cases only",[302,1096,1097,1099],{},[306,1098,448],{}," is the field being built, immutable:",[1000,1101,1102,1112],{},[1003,1103,1104],{},[1006,1105,1106,1109],{},[1009,1107,1108],{},"Method",[1009,1110,1111],{},"Effect",[1016,1113,1114,1128,1138,1154,1170,1180],{},[1006,1115,1116,1121],{},[1021,1117,1118],{},[306,1119,1120],{},"schema(Schema $schema)",[1021,1122,1123,1124,1127],{},"replaces the schema; start from ",[306,1125,1126],{},"$field->schema"," to keep the constraints of the other rules",[1006,1129,1130,1135],{},[1021,1131,1132],{},[306,1133,1134],{},"required(bool $required = true)",[1021,1136,1137],{},"the field is required",[1006,1139,1140,1148],{},[1021,1141,1142,313,1145],{},[306,1143,1144],{},"conditions(string ...)",[306,1146,1147],{},"addConditions(string ...)",[1021,1149,1150,1151],{},"sentences written in the description: ",[306,1152,1153],{},"required if type is company",[1006,1155,1156,1164],{},[1021,1157,1158,313,1161],{},[306,1159,1160],{},"file(bool $file = true)",[306,1162,1163],{},"contentTypes(string ...)",[1021,1165,1166,1167],{},"the field is a file, of these media types: the body becomes ",[306,1168,1169],{},"multipart\u002Fform-data",[1006,1171,1172,1177],{},[1021,1173,1174],{},[306,1175,1176],{},"distinct(bool $distinct = true)",[1021,1178,1179],{},"the items of the list are unique",[1006,1181,1182,1187],{},[1021,1183,1184],{},[306,1185,1186],{},"forbidden(bool $forbidden = true)",[1021,1188,1189],{},"the field must not be sent: it is left out",[302,1191,1192,1193,1195],{},"Constrain only what your rule says, and let the other rules of the field give the rest: start from ",[306,1194,1126],{},",\nand never replace a constraint your rule does not own.",[348,1197,1199],{"id":1198},"reporting-what-you-cannot-describe","Reporting what you cannot describe",[302,1201,1202],{},"When a parameter of the rule cannot be described, keep the field as it is and add an info:",[362,1204,1206],{"className":364,"code":1205,"language":366,"meta":360,"style":360},"use Ark4ne\\OpenApi\\Context\\Stage;\n\nif ($rule->parameters === []) {\n    $context->diagnostics->info(\n        Stage::Request,\n        \"phone on {$rule->field} has no region: written as a string\",\n    );\n\n    return $field->schema($field->schema->type('string'));\n}\n",[306,1207,1208,1229,1233,1256,1275,1287,1317,1322,1326,1363],{"__ignoreMap":360},[370,1209,1210,1212,1214,1216,1218,1220,1222,1224,1227],{"class":372,"line":373},[370,1211,405],{"class":376},[370,1213,409],{"class":408},[370,1215,385],{"class":412},[370,1217,415],{"class":408},[370,1219,385],{"class":412},[370,1221,420],{"class":408},[370,1223,385],{"class":412},[370,1225,1226],{"class":408},"Stage",[370,1228,392],{"class":391},[370,1230,1231],{"class":372,"line":395},[370,1232,399],{"emptyLinePlaceholder":398},[370,1234,1235,1238,1241,1243,1245,1248,1251,1254],{"class":372,"line":402},[370,1236,1237],{"class":587},"if",[370,1239,1240],{"class":391}," ($",[370,1242,642],{"class":641},[370,1244,696],{"class":571},[370,1246,1247],{"class":641},"parameters ",[370,1249,1250],{"class":571},"===",[370,1252,1253],{"class":391}," [])",[370,1255,684],{"class":391},[370,1257,1258,1261,1263,1265,1268,1270,1273],{"class":372,"line":430},[370,1259,1260],{"class":391},"    $",[370,1262,668],{"class":641},[370,1264,696],{"class":571},[370,1266,1267],{"class":641},"diagnostics",[370,1269,696],{"class":571},[370,1271,1272],{"class":564},"info",[370,1274,628],{"class":391},[370,1276,1277,1280,1282,1285],{"class":372,"line":453},[370,1278,1279],{"class":634},"        Stage",[370,1281,958],{"class":571},[370,1283,1284],{"class":408},"Request",[370,1286,645],{"class":391},[370,1288,1289,1292,1295,1298,1301,1303,1305,1307,1310,1313,1315],{"class":372,"line":481},[370,1290,1291],{"class":594},"        \"",[370,1293,1294],{"class":598},"phone on ",[370,1296,1297],{"class":594},"{",[370,1299,1300],{"class":391},"$",[370,1302,642],{"class":641},[370,1304,696],{"class":571},[370,1306,655],{"class":641},[370,1308,1309],{"class":594},"}",[370,1311,1312],{"class":598}," has no region: written as a string",[370,1314,797],{"class":594},[370,1316,645],{"class":391},[370,1318,1319],{"class":372,"line":507},[370,1320,1321],{"class":391},"    );\n",[370,1323,1324],{"class":372,"line":512},[370,1325,399],{"emptyLinePlaceholder":398},[370,1327,1328,1331,1333,1335,1337,1339,1342,1344,1346,1348,1350,1352,1354,1356,1358,1360],{"class":372,"line":519},[370,1329,1330],{"class":587},"    return",[370,1332,638],{"class":391},[370,1334,655],{"class":641},[370,1336,696],{"class":571},[370,1338,699],{"class":564},[370,1340,1341],{"class":391},"($",[370,1343,655],{"class":641},[370,1345,696],{"class":571},[370,1347,699],{"class":641},[370,1349,696],{"class":571},[370,1351,723],{"class":564},[370,1353,726],{"class":391},[370,1355,595],{"class":594},[370,1357,731],{"class":598},[370,1359,595],{"class":594},[370,1361,1362],{"class":391},"));\n",[370,1364,1365],{"class":372,"line":29},[370,1366,773],{"class":391},[1368,1369,1370],"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 .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 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 .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}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 .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 .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 .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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":360,"searchDepth":402,"depth":402,"links":1372},[1373,1374,1375],{"id":350,"depth":395,"text":351},{"id":976,"depth":395,"text":977},{"id":1198,"depth":395,"text":1199},"Describe a validation rule the generator does not know, or change how a built-in rule is described.","md",{},"---\ntitle: Rule mappers\ndescription: Describe a validation rule the generator does not know, or change how a built-in rule is described.\n---\n\nA rule mapper turns one validation rule into constraints of a field. The generator has one per built-in rule\n(`SizeRuleMapper` handles `min`, `max`, `between` and `size`); add yours for a rule registered by name with\n`Validator::extend()`, or to replace a built-in one.\n\nFor a rule **object** of your application, implement `DescribesRule` on the rule instead; see\n[A rule that describes itself](\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Frequests#a-rule-that-describes-itself).\n\n## Write a mapper\n\n::example{input=\"app\u002FDocs\u002FPhoneRuleMapper.php\" output=\"the field phone\"}\n#input\n```php\nnamespace App\\Docs;\n\nuse Ark4ne\\OpenApi\\Context\\GenerationContext;\nuse Ark4ne\\OpenApi\\Description\\FieldDescription;\nuse Ark4ne\\OpenApi\\Extraction\\Rules\\RuleInvocation;\nuse Ark4ne\\OpenApi\\Extraction\\Rules\\RuleMapper;\n\n\u002F**\n * `phone`, a rule registered with Validator::extend(): an E.164 phone number.\n *\u002F\nfinal class PhoneRuleMapper implements RuleMapper\n{\n    public function handles(): array\n    {\n        return ['phone'];\n    }\n\n    public function map(\n        RuleInvocation $rule,\n        FieldDescription $field,\n        GenerationContext $context,\n    ): FieldDescription {\n        return $field->schema(\n            $field->schema\n                ->type('string')\n                ->pattern('^\\+[1-9][0-9]{6,14}$'),\n        );\n    }\n}\n```\n#output\n```json\n{\n  \"type\": \"object\",\n  \"required\": [\"phone\"],\n  \"properties\": {\n    \"phone\": { \"type\": \"string\", \"pattern\": \"^\\\\+[1-9][0-9]{6,14}$\" }\n  }\n}\n```\n::\n\n```php [config\u002Fopenapi.php]\n'extensions' => [\n    'rule_mappers' => [App\\Docs\\PhoneRuleMapper::class],\n],\n```\n\nThe form request uses the rule as usual: `'phone' => 'required|phone'`.\n\n## What a mapper receives\n\n`handles()` lists the rule names (snake case: `phone`, `required_if`) and the rule classes\n(`Illuminate\\Validation\\Rules\\Enum`) the mapper describes. A mapper of yours replaces the built-in mapper of the same\nrule.\n\n`RuleInvocation` is one rule applied to one field:\n\n| Property | Holds |\n| --- | --- |\n| `field` | the field, as written in the rules (`address.city`, `tags.*`) |\n| `name` | the rule name, or the class of a rule object |\n| `parameters` | the parameters: `max:255` gives `['255']` |\n| `rule` | the rule object, for `Rule::enum()`, `Password` or your own |\n| `conditional` | `true` when the rule comes from `Rule::when()`: it applies in some cases only |\n\n`FieldDescription` is the field being built, immutable:\n\n| Method | Effect |\n| --- | --- |\n| `schema(Schema $schema)` | replaces the schema; start from `$field->schema` to keep the constraints of the other rules |\n| `required(bool $required = true)` | the field is required |\n| `conditions(string ...)`, `addConditions(string ...)` | sentences written in the description: `required if type is company` |\n| `file(bool $file = true)`, `contentTypes(string ...)` | the field is a file, of these media types: the body becomes `multipart\u002Fform-data` |\n| `distinct(bool $distinct = true)` | the items of the list are unique |\n| `forbidden(bool $forbidden = true)` | the field must not be sent: it is left out |\n\nConstrain only what your rule says, and let the other rules of the field give the rest: start from `$field->schema`,\nand never replace a constraint your rule does not own.\n\n## Reporting what you cannot describe\n\nWhen a parameter of the rule cannot be described, keep the field as it is and add an info:\n\n```php\nuse Ark4ne\\OpenApi\\Context\\Stage;\n\nif ($rule->parameters === []) {\n    $context->diagnostics->info(\n        Stage::Request,\n        \"phone on {$rule->field} has no region: written as a string\",\n    );\n\n    return $field->schema($field->schema->type('string'));\n}\n```\n",{"title":224,"description":1376},"7uxPRgyYYH9HRRtwYgICc0nUYZ-G1gHUO8HIAeWJoHs",[1383,1385],{"title":220,"path":221,"stem":222,"description":1384,"children":-1},"The extension points of the generator, how to register an extension, and the rules every extension follows.",{"title":228,"path":229,"stem":230,"description":1386,"children":-1},"Describe a return type the generator does not know, and add parameters or bodies from another source.",1795438904293]