[{"data":1,"prerenderedAt":1060},["ShallowReactive",2],{"libs":3,"navigation-openapi-writer":115,"\u002Fopenapi-writer\u002Fbuilding-documents\u002Fwebhooks-and-callbacks":256,"\u002Fopenapi-writer\u002Fbuilding-documents\u002Fwebhooks-and-callbacks-surround":1055},[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,182,212,226,248],{"title":117,"since":118,"experimental":119,"icon":120,"path":121,"stem":122,"children":123,"page":119},"Getting started",null,false,"i-lucide-rocket","\u002Fopenapi-writer\u002Fgetting-started","openapi-writer\u002F1.getting-started",[124,127,131],{"title":125,"path":113,"stem":126,"since":118,"experimental":119},"Introduction","openapi-writer\u002F1.getting-started\u002F1.introduction",{"title":128,"path":129,"stem":130,"since":118,"experimental":119},"Installation","\u002Fopenapi-writer\u002Fgetting-started\u002Finstallation","openapi-writer\u002F1.getting-started\u002F2.installation",{"title":132,"path":133,"stem":134,"since":118,"experimental":119},"Quick start","\u002Fopenapi-writer\u002Fgetting-started\u002Fquick-start","openapi-writer\u002F1.getting-started\u002F3.quick-start",{"title":136,"since":118,"experimental":119,"icon":137,"path":138,"stem":139,"children":140,"page":119},"Building documents","i-lucide-blocks","\u002Fopenapi-writer\u002Fbuilding-documents","openapi-writer\u002F2.building-documents",[141,145,149,153,157,161,165],{"title":142,"path":143,"stem":144,"since":118,"experimental":119},"The object model","\u002Fopenapi-writer\u002Fbuilding-documents\u002Fthe-object-model","openapi-writer\u002F2.building-documents\u002F1.the-object-model",{"title":146,"path":147,"stem":148,"since":118,"experimental":119},"Document","\u002Fopenapi-writer\u002Fbuilding-documents\u002Fdocument","openapi-writer\u002F2.building-documents\u002F2.document",{"title":150,"path":151,"stem":152,"since":118,"experimental":119},"Paths and operations","\u002Fopenapi-writer\u002Fbuilding-documents\u002Fpaths-and-operations","openapi-writer\u002F2.building-documents\u002F3.paths-and-operations",{"title":154,"path":155,"stem":156,"since":118,"experimental":119},"Requests and responses","\u002Fopenapi-writer\u002Fbuilding-documents\u002Frequests-and-responses","openapi-writer\u002F2.building-documents\u002F4.requests-and-responses",{"title":158,"path":159,"stem":160,"since":118,"experimental":119},"Components and references","\u002Fopenapi-writer\u002Fbuilding-documents\u002Fcomponents-and-references","openapi-writer\u002F2.building-documents\u002F5.components-and-references",{"title":162,"path":163,"stem":164,"since":118,"experimental":119},"Security","\u002Fopenapi-writer\u002Fbuilding-documents\u002Fsecurity","openapi-writer\u002F2.building-documents\u002F6.security",{"title":166,"path":167,"stem":168,"since":118,"experimental":119},"Webhooks and callbacks","\u002Fopenapi-writer\u002Fbuilding-documents\u002Fwebhooks-and-callbacks","openapi-writer\u002F2.building-documents\u002F7.webhooks-and-callbacks",{"title":170,"since":118,"experimental":119,"icon":21,"path":171,"stem":172,"children":173,"page":119},"Schemas","\u002Fopenapi-writer\u002Fschemas","openapi-writer\u002F3.schemas",[174,178],{"title":175,"path":176,"stem":177,"since":118,"experimental":119},"Types and constraints","\u002Fopenapi-writer\u002Fschemas\u002Ftypes-and-constraints","openapi-writer\u002F3.schemas\u002F1.types-and-constraints",{"title":179,"path":180,"stem":181,"since":118,"experimental":119},"Composition and polymorphism","\u002Fopenapi-writer\u002Fschemas\u002Fcomposition-and-polymorphism","openapi-writer\u002F3.schemas\u002F2.composition-and-polymorphism",{"title":183,"since":118,"experimental":119,"icon":184,"path":185,"stem":186,"children":187,"page":119},"Versions and output","i-lucide-layers","\u002Fopenapi-writer\u002Fversions-and-output","openapi-writer\u002F4.versions-and-output",[188,192,196,200,204,208],{"title":189,"path":190,"stem":191,"since":118,"experimental":119},"Writing a document","\u002Fopenapi-writer\u002Fversions-and-output\u002Fwriting-a-document","openapi-writer\u002F4.versions-and-output\u002F1.writing-a-document",{"title":193,"path":194,"stem":195,"since":118,"experimental":119},"Choosing a version","\u002Fopenapi-writer\u002Fversions-and-output\u002Fchoosing-a-version","openapi-writer\u002F4.versions-and-output\u002F2.choosing-a-version",{"title":197,"path":198,"stem":199,"since":118,"experimental":119},"Conversions","\u002Fopenapi-writer\u002Fversions-and-output\u002Fconversions","openapi-writer\u002F4.versions-and-output\u002F3.conversions",{"title":201,"path":202,"stem":203,"since":118,"experimental":119},"Strict and lenient","\u002Fopenapi-writer\u002Fversions-and-output\u002Fstrict-and-lenient","openapi-writer\u002F4.versions-and-output\u002F4.strict-and-lenient",{"title":205,"path":206,"stem":207,"since":118,"experimental":119},"OpenAPI 3.2","\u002Fopenapi-writer\u002Fversions-and-output\u002Fopenapi-3-2","openapi-writer\u002F4.versions-and-output\u002F5.openapi-3-2",{"title":209,"path":210,"stem":211,"since":118,"experimental":119},"Redoc extensions","\u002Fopenapi-writer\u002Fversions-and-output\u002Fredoc-extensions","openapi-writer\u002F4.versions-and-output\u002F6.redoc-extensions",{"title":213,"since":118,"experimental":119,"icon":214,"path":215,"stem":216,"children":217,"page":119},"Validation","i-lucide-badge-check","\u002Fopenapi-writer\u002Fvalidation","openapi-writer\u002F5.validation",[218,222],{"title":219,"path":220,"stem":221,"since":118,"experimental":119},"Validating a document","\u002Fopenapi-writer\u002Fvalidation\u002Fvalidating-a-document","openapi-writer\u002F5.validation\u002F1.validating-a-document",{"title":223,"path":224,"stem":225,"since":118,"experimental":119},"Custom rules","\u002Fopenapi-writer\u002Fvalidation\u002Fcustom-rules","openapi-writer\u002F5.validation\u002F2.custom-rules",{"title":227,"since":118,"experimental":119,"icon":228,"path":229,"stem":230,"children":231,"page":119},"Reference","i-lucide-library","\u002Fopenapi-writer\u002Freference","openapi-writer\u002F6.reference",[232,236,240,244],{"title":233,"path":234,"stem":235,"since":118,"experimental":119},"Objects","\u002Fopenapi-writer\u002Freference\u002Fobjects","openapi-writer\u002F6.reference\u002F1.objects",{"title":237,"path":238,"stem":239,"since":118,"experimental":119},"Enums","\u002Fopenapi-writer\u002Freference\u002Fenums","openapi-writer\u002F6.reference\u002F2.enums",{"title":241,"path":242,"stem":243,"since":118,"experimental":119},"Validation rules","\u002Fopenapi-writer\u002Freference\u002Fvalidation-rules","openapi-writer\u002F6.reference\u002F3.validation-rules",{"title":245,"path":246,"stem":247,"since":118,"experimental":119},"Exceptions","\u002Fopenapi-writer\u002Freference\u002Fexceptions","openapi-writer\u002F6.reference\u002F4.exceptions",{"title":249,"path":250,"children":251},"Releases","\u002Fopenapi-writer\u002Freleases",[252],{"title":253,"path":254,"stem":255,"since":118,"experimental":119},"Changelog","\u002Fopenapi-writer\u002Fchangelog","openapi-writer\u002FCHANGELOG",{"id":257,"title":166,"body":258,"description":1049,"experimental":119,"extension":1050,"links":118,"meta":1051,"navigation":436,"path":167,"rawbody":1052,"seo":1053,"since":118,"stem":168,"__hash__":1054},"openapi_writer\u002Fopenapi-writer\u002F2.building-documents\u002F7.webhooks-and-callbacks.md",{"type":259,"value":260,"toc":1045},"minimark",[261,270,275,278,666,681,685,688,1031,1041],[262,263,264,265,269],"p",{},"Both describe requests sent ",[266,267,268],"strong",{},"by"," your API, with path items and operations like the rest of the document.",[271,272,274],"h2",{"id":273},"webhooks","Webhooks",[262,276,277],{},"Webhooks are requests the API sends on its own, outside any call. They exist from OpenAPI 3.1; the objectId of each\npath item is the webhook name.",[279,280,285],"pre",{"className":281,"code":282,"language":283,"meta":284,"style":284},"language-php shiki shiki-themes material-theme-lighter github-light github-dark","use Ark4ne\\OpenApiWriter\\Objects\\MediaType;\nuse Ark4ne\\OpenApiWriter\\Objects\\Operation;\nuse Ark4ne\\OpenApiWriter\\Objects\\PathItem;\nuse Ark4ne\\OpenApiWriter\\Objects\\RequestBody;\nuse Ark4ne\\OpenApiWriter\\Objects\\Response;\nuse Ark4ne\\OpenApiWriter\\Objects\\Schema;\n\n$event = RequestBody::create()\n    ->required()\n    ->content(MediaType::json()->schema(Schema::ref('Book')));\n\n$document = $document->webhooks(\n    PathItem::create('bookPublished')->operations(\n        Operation::post()\n            ->operationId('webhooks.bookPublished')\n            ->requestBody($event)\n            ->responses(Response::noContent()),\n    ),\n);\n","php","",[286,287,288,321,343,365,387,409,431,438,466,477,527,532,555,584,597,618,634,654,660],"code",{"__ignoreMap":284},[289,290,293,297,301,305,308,310,312,314,317],"span",{"class":291,"line":292},"line",1,[289,294,296],{"class":295},"sw1J6","use",[289,298,300],{"class":299},"s_hVV"," Ark4ne",[289,302,304],{"class":303},"s39Yj","\\",[289,306,307],{"class":299},"OpenApiWriter",[289,309,304],{"class":303},[289,311,233],{"class":299},[289,313,304],{"class":303},[289,315,316],{"class":299},"MediaType",[289,318,320],{"class":319},"sP7_E",";\n",[289,322,324,326,328,330,332,334,336,338,341],{"class":291,"line":323},2,[289,325,296],{"class":295},[289,327,300],{"class":299},[289,329,304],{"class":303},[289,331,307],{"class":299},[289,333,304],{"class":303},[289,335,233],{"class":299},[289,337,304],{"class":303},[289,339,340],{"class":299},"Operation",[289,342,320],{"class":319},[289,344,346,348,350,352,354,356,358,360,363],{"class":291,"line":345},3,[289,347,296],{"class":295},[289,349,300],{"class":299},[289,351,304],{"class":303},[289,353,307],{"class":299},[289,355,304],{"class":303},[289,357,233],{"class":299},[289,359,304],{"class":303},[289,361,362],{"class":299},"PathItem",[289,364,320],{"class":319},[289,366,368,370,372,374,376,378,380,382,385],{"class":291,"line":367},4,[289,369,296],{"class":295},[289,371,300],{"class":299},[289,373,304],{"class":303},[289,375,307],{"class":299},[289,377,304],{"class":303},[289,379,233],{"class":299},[289,381,304],{"class":303},[289,383,384],{"class":299},"RequestBody",[289,386,320],{"class":319},[289,388,390,392,394,396,398,400,402,404,407],{"class":291,"line":389},5,[289,391,296],{"class":295},[289,393,300],{"class":299},[289,395,304],{"class":303},[289,397,307],{"class":299},[289,399,304],{"class":303},[289,401,233],{"class":299},[289,403,304],{"class":303},[289,405,406],{"class":299},"Response",[289,408,320],{"class":319},[289,410,412,414,416,418,420,422,424,426,429],{"class":291,"line":411},6,[289,413,296],{"class":295},[289,415,300],{"class":299},[289,417,304],{"class":303},[289,419,307],{"class":299},[289,421,304],{"class":303},[289,423,233],{"class":299},[289,425,304],{"class":303},[289,427,428],{"class":299},"Schema",[289,430,320],{"class":319},[289,432,434],{"class":291,"line":433},7,[289,435,437],{"emptyLinePlaceholder":436},true,"\n",[289,439,441,444,448,452,456,459,463],{"class":291,"line":440},8,[289,442,443],{"class":319},"$",[289,445,447],{"class":446},"su5hD","event ",[289,449,451],{"class":450},"smGrS","=",[289,453,455],{"class":454},"sZMiF"," RequestBody",[289,457,458],{"class":450},"::",[289,460,462],{"class":461},"sGLFI","create",[289,464,465],{"class":319},"()\n",[289,467,469,472,475],{"class":291,"line":468},9,[289,470,471],{"class":450},"    ->",[289,473,474],{"class":461},"required",[289,476,465],{"class":319},[289,478,479,481,484,487,489,491,494,497,500,503,505,507,509,512,514,518,522,524],{"class":291,"line":29},[289,480,471],{"class":450},[289,482,483],{"class":461},"content",[289,485,486],{"class":319},"(",[289,488,316],{"class":454},[289,490,458],{"class":450},[289,492,493],{"class":461},"json",[289,495,496],{"class":319},"()",[289,498,499],{"class":450},"->",[289,501,502],{"class":461},"schema",[289,504,486],{"class":319},[289,506,428],{"class":454},[289,508,458],{"class":450},[289,510,511],{"class":461},"ref",[289,513,486],{"class":319},[289,515,517],{"class":516},"sjJ54","'",[289,519,521],{"class":520},"s_sjI","Book",[289,523,517],{"class":516},[289,525,526],{"class":319},")));\n",[289,528,530],{"class":291,"line":529},11,[289,531,437],{"emptyLinePlaceholder":436},[289,533,535,537,540,542,545,548,550,552],{"class":291,"line":534},12,[289,536,443],{"class":319},[289,538,539],{"class":446},"document ",[289,541,451],{"class":450},[289,543,544],{"class":319}," $",[289,546,547],{"class":446},"document",[289,549,499],{"class":450},[289,551,273],{"class":461},[289,553,554],{"class":319},"(\n",[289,556,558,561,563,565,567,569,572,574,577,579,582],{"class":291,"line":557},13,[289,559,560],{"class":454},"    PathItem",[289,562,458],{"class":450},[289,564,462],{"class":461},[289,566,486],{"class":319},[289,568,517],{"class":516},[289,570,571],{"class":520},"bookPublished",[289,573,517],{"class":516},[289,575,576],{"class":319},")",[289,578,499],{"class":450},[289,580,581],{"class":461},"operations",[289,583,554],{"class":319},[289,585,587,590,592,595],{"class":291,"line":586},14,[289,588,589],{"class":454},"        Operation",[289,591,458],{"class":450},[289,593,594],{"class":461},"post",[289,596,465],{"class":319},[289,598,600,603,606,608,610,613,615],{"class":291,"line":599},15,[289,601,602],{"class":450},"            ->",[289,604,605],{"class":461},"operationId",[289,607,486],{"class":319},[289,609,517],{"class":516},[289,611,612],{"class":520},"webhooks.bookPublished",[289,614,517],{"class":516},[289,616,617],{"class":319},")\n",[289,619,621,623,626,629,632],{"class":291,"line":620},16,[289,622,602],{"class":450},[289,624,625],{"class":461},"requestBody",[289,627,628],{"class":319},"($",[289,630,631],{"class":446},"event",[289,633,617],{"class":319},[289,635,637,639,642,644,646,648,651],{"class":291,"line":636},17,[289,638,602],{"class":450},[289,640,641],{"class":461},"responses",[289,643,486],{"class":319},[289,645,406],{"class":454},[289,647,458],{"class":450},[289,649,650],{"class":461},"noContent",[289,652,653],{"class":319},"()),\n",[289,655,657],{"class":291,"line":656},18,[289,658,659],{"class":319},"    ),\n",[289,661,663],{"class":291,"line":662},19,[289,664,665],{"class":319},");\n",[262,667,668,669,672,673,676,677,680],{},"Written for OpenAPI 3.0, webhooks throw an ",[286,670,671],{},"UnsupportedFeatureException"," (or are dropped in lenient mode). Redoc reads\nthem from an ",[286,674,675],{},"x-webhooks"," extension, which the library can write for you; see\n",[678,679,209],"a",{"href":210},".",[271,682,684],{"id":683},"callbacks","Callbacks",[262,686,687],{},"Callbacks are requests sent in reaction to a call, to a URL that call provides. The objectId of the callback is its\nname; the objectId of each path item is a runtime expression.",[279,689,691],{"className":281,"code":690,"language":283,"meta":284,"style":284},"use Ark4ne\\OpenApiWriter\\Objects\\Callback;\n\n$subscribe = Operation::post()\n    ->operationId('subscriptions.store')\n    ->requestBody(\n        RequestBody::create()->required()->content(\n            MediaType::json()->schema(\n                Schema::object()\n                    ->properties(\n                        Schema::string('callbackUrl')->format('uri'),\n                    )\n                    ->required('callbackUrl'),\n            ),\n        ),\n    )\n    ->callbacks(\n        Callback::create('bookPublished')->pathItems(\n            PathItem::create('{$request.body#\u002FcallbackUrl}')->operations(\n                Operation::post()\n                    ->requestBody($event)\n                    ->responses(Response::noContent()),\n            ),\n        ),\n    )\n    ->responses(Response::created());\n",[286,692,693,714,718,736,753,761,784,801,813,823,861,866,882,887,892,897,905,931,957,968,980,997,1002,1007,1012],{"__ignoreMap":284},[289,694,695,697,699,701,703,705,707,709,712],{"class":291,"line":292},[289,696,296],{"class":295},[289,698,300],{"class":299},[289,700,304],{"class":303},[289,702,307],{"class":299},[289,704,304],{"class":303},[289,706,233],{"class":299},[289,708,304],{"class":303},[289,710,711],{"class":299},"Callback",[289,713,320],{"class":319},[289,715,716],{"class":291,"line":323},[289,717,437],{"emptyLinePlaceholder":436},[289,719,720,722,725,727,730,732,734],{"class":291,"line":345},[289,721,443],{"class":319},[289,723,724],{"class":446},"subscribe ",[289,726,451],{"class":450},[289,728,729],{"class":454}," Operation",[289,731,458],{"class":450},[289,733,594],{"class":461},[289,735,465],{"class":319},[289,737,738,740,742,744,746,749,751],{"class":291,"line":367},[289,739,471],{"class":450},[289,741,605],{"class":461},[289,743,486],{"class":319},[289,745,517],{"class":516},[289,747,748],{"class":520},"subscriptions.store",[289,750,517],{"class":516},[289,752,617],{"class":319},[289,754,755,757,759],{"class":291,"line":389},[289,756,471],{"class":450},[289,758,625],{"class":461},[289,760,554],{"class":319},[289,762,763,766,768,770,772,774,776,778,780,782],{"class":291,"line":411},[289,764,765],{"class":454},"        RequestBody",[289,767,458],{"class":450},[289,769,462],{"class":461},[289,771,496],{"class":319},[289,773,499],{"class":450},[289,775,474],{"class":461},[289,777,496],{"class":319},[289,779,499],{"class":450},[289,781,483],{"class":461},[289,783,554],{"class":319},[289,785,786,789,791,793,795,797,799],{"class":291,"line":433},[289,787,788],{"class":454},"            MediaType",[289,790,458],{"class":450},[289,792,493],{"class":461},[289,794,496],{"class":319},[289,796,499],{"class":450},[289,798,502],{"class":461},[289,800,554],{"class":319},[289,802,803,806,808,811],{"class":291,"line":440},[289,804,805],{"class":454},"                Schema",[289,807,458],{"class":450},[289,809,810],{"class":461},"object",[289,812,465],{"class":319},[289,814,815,818,821],{"class":291,"line":468},[289,816,817],{"class":450},"                    ->",[289,819,820],{"class":461},"properties",[289,822,554],{"class":319},[289,824,825,828,830,833,835,837,840,842,844,846,849,851,853,856,858],{"class":291,"line":29},[289,826,827],{"class":454},"                        Schema",[289,829,458],{"class":450},[289,831,832],{"class":461},"string",[289,834,486],{"class":319},[289,836,517],{"class":516},[289,838,839],{"class":520},"callbackUrl",[289,841,517],{"class":516},[289,843,576],{"class":319},[289,845,499],{"class":450},[289,847,848],{"class":461},"format",[289,850,486],{"class":319},[289,852,517],{"class":516},[289,854,855],{"class":520},"uri",[289,857,517],{"class":516},[289,859,860],{"class":319},"),\n",[289,862,863],{"class":291,"line":529},[289,864,865],{"class":319},"                    )\n",[289,867,868,870,872,874,876,878,880],{"class":291,"line":534},[289,869,817],{"class":450},[289,871,474],{"class":461},[289,873,486],{"class":319},[289,875,517],{"class":516},[289,877,839],{"class":520},[289,879,517],{"class":516},[289,881,860],{"class":319},[289,883,884],{"class":291,"line":557},[289,885,886],{"class":319},"            ),\n",[289,888,889],{"class":291,"line":586},[289,890,891],{"class":319},"        ),\n",[289,893,894],{"class":291,"line":599},[289,895,896],{"class":319},"    )\n",[289,898,899,901,903],{"class":291,"line":620},[289,900,471],{"class":450},[289,902,683],{"class":461},[289,904,554],{"class":319},[289,906,907,910,912,914,916,918,920,922,924,926,929],{"class":291,"line":636},[289,908,909],{"class":454},"        Callback",[289,911,458],{"class":450},[289,913,462],{"class":461},[289,915,486],{"class":319},[289,917,517],{"class":516},[289,919,571],{"class":520},[289,921,517],{"class":516},[289,923,576],{"class":319},[289,925,499],{"class":450},[289,927,928],{"class":461},"pathItems",[289,930,554],{"class":319},[289,932,933,936,938,940,942,944,947,949,951,953,955],{"class":291,"line":656},[289,934,935],{"class":454},"            PathItem",[289,937,458],{"class":450},[289,939,462],{"class":461},[289,941,486],{"class":319},[289,943,517],{"class":516},[289,945,946],{"class":520},"{$request.body#\u002FcallbackUrl}",[289,948,517],{"class":516},[289,950,576],{"class":319},[289,952,499],{"class":450},[289,954,581],{"class":461},[289,956,554],{"class":319},[289,958,959,962,964,966],{"class":291,"line":662},[289,960,961],{"class":454},"                Operation",[289,963,458],{"class":450},[289,965,594],{"class":461},[289,967,465],{"class":319},[289,969,970,972,974,976,978],{"class":291,"line":58},[289,971,817],{"class":450},[289,973,625],{"class":461},[289,975,628],{"class":319},[289,977,631],{"class":446},[289,979,617],{"class":319},[289,981,983,985,987,989,991,993,995],{"class":291,"line":982},21,[289,984,817],{"class":450},[289,986,641],{"class":461},[289,988,486],{"class":319},[289,990,406],{"class":454},[289,992,458],{"class":450},[289,994,650],{"class":461},[289,996,653],{"class":319},[289,998,1000],{"class":291,"line":999},22,[289,1001,886],{"class":319},[289,1003,1005],{"class":291,"line":1004},23,[289,1006,891],{"class":319},[289,1008,1010],{"class":291,"line":1009},24,[289,1011,896],{"class":319},[289,1013,1015,1017,1019,1021,1023,1025,1028],{"class":291,"line":1014},25,[289,1016,471],{"class":450},[289,1018,641],{"class":461},[289,1020,486],{"class":319},[289,1022,406],{"class":454},[289,1024,458],{"class":450},[289,1026,1027],{"class":461},"created",[289,1029,1030],{"class":319},"());\n",[262,1032,1033,1034,1037,1038,680],{},"Callbacks exist in every version. Reusable ones go in ",[286,1035,1036],{},"Components::callbacks()",", referred to with\n",[286,1039,1040],{},"Callback::ref('BookPublished', 'bookPublished')",[1042,1043,1044],"style",{},"html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--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 .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);}",{"title":284,"searchDepth":345,"depth":345,"links":1046},[1047,1048],{"id":273,"depth":323,"text":274},{"id":683,"depth":323,"text":684},"Describe the requests your API sends - webhooks outside any call, callbacks in reaction to one.","md",{},"---\ntitle: Webhooks and callbacks\ndescription: Describe the requests your API sends - webhooks outside any call, callbacks in reaction to one.\n---\n\nBoth describe requests sent **by** your API, with path items and operations like the rest of the document.\n\n## Webhooks\n\nWebhooks are requests the API sends on its own, outside any call. They exist from OpenAPI 3.1; the objectId of each\npath item is the webhook name.\n\n```php\nuse Ark4ne\\OpenApiWriter\\Objects\\MediaType;\nuse Ark4ne\\OpenApiWriter\\Objects\\Operation;\nuse Ark4ne\\OpenApiWriter\\Objects\\PathItem;\nuse Ark4ne\\OpenApiWriter\\Objects\\RequestBody;\nuse Ark4ne\\OpenApiWriter\\Objects\\Response;\nuse Ark4ne\\OpenApiWriter\\Objects\\Schema;\n\n$event = RequestBody::create()\n    ->required()\n    ->content(MediaType::json()->schema(Schema::ref('Book')));\n\n$document = $document->webhooks(\n    PathItem::create('bookPublished')->operations(\n        Operation::post()\n            ->operationId('webhooks.bookPublished')\n            ->requestBody($event)\n            ->responses(Response::noContent()),\n    ),\n);\n```\n\nWritten for OpenAPI 3.0, webhooks throw an `UnsupportedFeatureException` (or are dropped in lenient mode). Redoc reads\nthem from an `x-webhooks` extension, which the library can write for you; see\n[Redoc extensions](\u002Fopenapi-writer\u002Fversions-and-output\u002Fredoc-extensions).\n\n## Callbacks\n\nCallbacks are requests sent in reaction to a call, to a URL that call provides. The objectId of the callback is its\nname; the objectId of each path item is a runtime expression.\n\n```php\nuse Ark4ne\\OpenApiWriter\\Objects\\Callback;\n\n$subscribe = Operation::post()\n    ->operationId('subscriptions.store')\n    ->requestBody(\n        RequestBody::create()->required()->content(\n            MediaType::json()->schema(\n                Schema::object()\n                    ->properties(\n                        Schema::string('callbackUrl')->format('uri'),\n                    )\n                    ->required('callbackUrl'),\n            ),\n        ),\n    )\n    ->callbacks(\n        Callback::create('bookPublished')->pathItems(\n            PathItem::create('{$request.body#\u002FcallbackUrl}')->operations(\n                Operation::post()\n                    ->requestBody($event)\n                    ->responses(Response::noContent()),\n            ),\n        ),\n    )\n    ->responses(Response::created());\n```\n\nCallbacks exist in every version. Reusable ones go in `Components::callbacks()`, referred to with\n`Callback::ref('BookPublished', 'bookPublished')`.\n",{"title":166,"description":1049},"M3xeWMHpAYEX7ZpUHl6aRWTA1LTrlevGOKxUhL4y9rc",[1056,1058],{"title":162,"path":163,"stem":164,"description":1057,"children":-1},"Declare security schemes, require them for the whole API, and override them per operation.",{"title":175,"path":176,"stem":177,"description":1059,"children":-1},"Describe values with Schema - types, nullable, formats, constraints, objects, arrays and metadata.",1795438900863]