[{"data":1,"prerenderedAt":840},["ShallowReactive",2],{"libs":3,"navigation-openapi-writer":115,"\u002Fopenapi-writer\u002Fgetting-started\u002Fintroduction":256,"\u002Fopenapi-writer\u002Fgetting-started\u002Fintroduction-surround":837},[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":125,"body":258,"description":831,"experimental":119,"extension":832,"links":118,"meta":833,"navigation":321,"path":113,"rawbody":834,"seo":835,"since":118,"stem":126,"__hash__":836},"openapi_writer\u002Fopenapi-writer\u002F1.getting-started\u002F1.introduction.md",{"type":259,"value":260,"toc":825},"minimark",[261,265,700,707,712,779,783,790,793,797,799,808,812,821],[262,263,264],"p",{},"OpenAPI Writer builds OpenAPI documents with PHP objects, and writes them as JSON, YAML or a PHP array for the version\nyou choose: 3.0.0 to 3.0.4, 3.1.0 to 3.1.2, or 3.2.0. It does not depend on any framework: a script, a command, a\nSymfony or Laravel application, or another library can use it.",[266,267,270,492],"example",{"input":268,"output":269},"PHP","components.schemas.Book (3.1.2)",[271,272,274],"template",{"v-slot:input":273},"",[275,276,280],"pre",{"className":277,"code":278,"language":279,"meta":273,"style":273},"language-php shiki shiki-themes material-theme-lighter github-light github-dark","use Ark4ne\\OpenApiWriter\\Objects\\Schema;\n\n$book = Schema::object('Book')\n    ->properties(\n        Schema::integer('id')->readOnly(),\n        Schema::string('title'),\n        Schema::string('subtitle')->nullable(),\n    )\n    ->required('id', 'title');\n","php",[281,282,283,316,323,364,376,408,430,457,463],"code",{"__ignoreMap":273},[284,285,288,292,296,300,303,305,307,309,312],"span",{"class":286,"line":287},"line",1,[284,289,291],{"class":290},"sw1J6","use",[284,293,295],{"class":294},"s_hVV"," Ark4ne",[284,297,299],{"class":298},"s39Yj","\\",[284,301,302],{"class":294},"OpenApiWriter",[284,304,299],{"class":298},[284,306,233],{"class":294},[284,308,299],{"class":298},[284,310,311],{"class":294},"Schema",[284,313,315],{"class":314},"sP7_E",";\n",[284,317,319],{"class":286,"line":318},2,[284,320,322],{"emptyLinePlaceholder":321},true,"\n",[284,324,326,329,333,337,341,344,348,351,355,359,361],{"class":286,"line":325},3,[284,327,328],{"class":314},"$",[284,330,332],{"class":331},"su5hD","book ",[284,334,336],{"class":335},"smGrS","=",[284,338,340],{"class":339},"sZMiF"," Schema",[284,342,343],{"class":335},"::",[284,345,347],{"class":346},"sGLFI","object",[284,349,350],{"class":314},"(",[284,352,354],{"class":353},"sjJ54","'",[284,356,358],{"class":357},"s_sjI","Book",[284,360,354],{"class":353},[284,362,363],{"class":314},")\n",[284,365,367,370,373],{"class":286,"line":366},4,[284,368,369],{"class":335},"    ->",[284,371,372],{"class":346},"properties",[284,374,375],{"class":314},"(\n",[284,377,379,382,384,387,389,391,394,396,399,402,405],{"class":286,"line":378},5,[284,380,381],{"class":339},"        Schema",[284,383,343],{"class":335},[284,385,386],{"class":346},"integer",[284,388,350],{"class":314},[284,390,354],{"class":353},[284,392,393],{"class":357},"id",[284,395,354],{"class":353},[284,397,398],{"class":314},")",[284,400,401],{"class":335},"->",[284,403,404],{"class":346},"readOnly",[284,406,407],{"class":314},"(),\n",[284,409,411,413,415,418,420,422,425,427],{"class":286,"line":410},6,[284,412,381],{"class":339},[284,414,343],{"class":335},[284,416,417],{"class":346},"string",[284,419,350],{"class":314},[284,421,354],{"class":353},[284,423,424],{"class":357},"title",[284,426,354],{"class":353},[284,428,429],{"class":314},"),\n",[284,431,433,435,437,439,441,443,446,448,450,452,455],{"class":286,"line":432},7,[284,434,381],{"class":339},[284,436,343],{"class":335},[284,438,417],{"class":346},[284,440,350],{"class":314},[284,442,354],{"class":353},[284,444,445],{"class":357},"subtitle",[284,447,354],{"class":353},[284,449,398],{"class":314},[284,451,401],{"class":335},[284,453,454],{"class":346},"nullable",[284,456,407],{"class":314},[284,458,460],{"class":286,"line":459},8,[284,461,462],{"class":314},"    )\n",[284,464,466,468,471,473,475,477,479,482,485,487,489],{"class":286,"line":465},9,[284,467,369],{"class":335},[284,469,470],{"class":346},"required",[284,472,350],{"class":314},[284,474,354],{"class":353},[284,476,393],{"class":357},[284,478,354],{"class":353},[284,480,481],{"class":314},",",[284,483,484],{"class":353}," '",[284,486,424],{"class":357},[284,488,354],{"class":353},[284,490,491],{"class":314},");\n",[271,493,494],{"v-slot:output":273},[275,495,499],{"className":496,"code":497,"language":498,"meta":273,"style":273},"language-json shiki shiki-themes material-theme-lighter github-light github-dark","{\n  \"type\": \"object\",\n  \"required\": [\"id\", \"title\"],\n  \"properties\": {\n    \"id\": { \"type\": \"integer\", \"readOnly\": true },\n    \"title\": { \"type\": \"string\" },\n    \"subtitle\": { \"type\": [\"string\", \"null\"] }\n  }\n}\n","json",[281,500,501,506,531,561,574,619,647,690,695],{"__ignoreMap":273},[284,502,503],{"class":286,"line":287},[284,504,505],{"class":314},"{\n",[284,507,508,511,515,518,521,524,526,528],{"class":286,"line":318},[284,509,510],{"class":298},"  \"",[284,512,514],{"class":513},"sseR_","type",[284,516,517],{"class":298},"\"",[284,519,520],{"class":314},":",[284,522,523],{"class":353}," \"",[284,525,347],{"class":357},[284,527,517],{"class":353},[284,529,530],{"class":314},",\n",[284,532,533,535,537,539,541,544,546,548,550,552,554,556,558],{"class":286,"line":325},[284,534,510],{"class":298},[284,536,470],{"class":513},[284,538,517],{"class":298},[284,540,520],{"class":314},[284,542,543],{"class":314}," [",[284,545,517],{"class":353},[284,547,393],{"class":357},[284,549,517],{"class":353},[284,551,481],{"class":314},[284,553,523],{"class":353},[284,555,424],{"class":357},[284,557,517],{"class":353},[284,559,560],{"class":314},"],\n",[284,562,563,565,567,569,571],{"class":286,"line":366},[284,564,510],{"class":298},[284,566,372],{"class":513},[284,568,517],{"class":298},[284,570,520],{"class":314},[284,572,573],{"class":314}," {\n",[284,575,576,579,581,583,585,588,590,593,595,597,599,601,603,605,607,609,611,613,616],{"class":286,"line":378},[284,577,578],{"class":298},"    \"",[284,580,393],{"class":339},[284,582,517],{"class":298},[284,584,520],{"class":314},[284,586,587],{"class":314}," {",[284,589,523],{"class":298},[284,591,514],{"class":592},"srdBf",[284,594,517],{"class":298},[284,596,520],{"class":314},[284,598,523],{"class":353},[284,600,386],{"class":357},[284,602,517],{"class":353},[284,604,481],{"class":314},[284,606,523],{"class":298},[284,608,404],{"class":592},[284,610,517],{"class":298},[284,612,520],{"class":314},[284,614,615],{"class":298}," true",[284,617,618],{"class":314}," },\n",[284,620,621,623,625,627,629,631,633,635,637,639,641,643,645],{"class":286,"line":410},[284,622,578],{"class":298},[284,624,424],{"class":339},[284,626,517],{"class":298},[284,628,520],{"class":314},[284,630,587],{"class":314},[284,632,523],{"class":298},[284,634,514],{"class":592},[284,636,517],{"class":298},[284,638,520],{"class":314},[284,640,523],{"class":353},[284,642,417],{"class":357},[284,644,517],{"class":353},[284,646,618],{"class":314},[284,648,649,651,653,655,657,659,661,663,665,667,669,671,673,675,677,679,682,684,687],{"class":286,"line":432},[284,650,578],{"class":298},[284,652,445],{"class":339},[284,654,517],{"class":298},[284,656,520],{"class":314},[284,658,587],{"class":314},[284,660,523],{"class":298},[284,662,514],{"class":592},[284,664,517],{"class":298},[284,666,520],{"class":314},[284,668,543],{"class":314},[284,670,517],{"class":353},[284,672,417],{"class":357},[284,674,517],{"class":353},[284,676,481],{"class":314},[284,678,523],{"class":353},[284,680,681],{"class":357},"null",[284,683,517],{"class":353},[284,685,686],{"class":314},"]",[284,688,689],{"class":314}," }\n",[284,691,692],{"class":286,"line":459},[284,693,694],{"class":314},"  }\n",[284,696,697],{"class":286,"line":465},[284,698,699],{"class":314},"}\n",[262,701,702,703,706],{},"The same object written for 3.0.4 gives ",[281,704,705],{},"\"subtitle\": { \"type\": \"string\", \"nullable\": true }",": you describe the API\nonce, and the library writes what each version expects.",[708,709,711],"h2",{"id":710},"how-it-works","How it works",[713,714,715,737,743,752,770],"ul",{},[716,717,718,722,723,725,726,725,729,732,733,736],"li",{},[719,720,721],"strong",{},"One object per specification object",": ",[281,724,311],{},", ",[281,727,728],{},"Operation",[281,730,731],{},"Response","… with one method per field, named\nexactly like the specification. See ",[734,735,142],"a",{"href":143},".",[716,738,739,742],{},[719,740,741],{},"Immutable",": every method returns a modified copy, so a schema or a response can be shared and derived without\nside effects.",[716,744,745,748,749,736],{},[719,746,747],{},"The version is chosen when writing",": the differences are converted, and a feature the version cannot express\nthrows, or is dropped and reported in ",[734,750,751],{"href":202},"lenient mode",[716,753,754,722,757,725,760,763,764,767,768,736],{},[719,755,756],{},"Any object can be written",[281,758,759],{},"toJson()",[281,761,762],{},"toYaml()"," and ",[281,765,766],{},"toArray()"," work on a single schema as well as on the\ndocument. See ",[734,769,189],{"href":190},[716,771,772,774,775,778],{},[719,773,213],{},": the ",[734,776,777],{"href":220},"validator"," checks the written document\nagainst the official schema of its version and ten semantic rules.",[708,780,782],{"id":781},"what-it-does-not-do","What it does not do",[262,784,785,786,789],{},"OpenAPI Writer writes documents; it does not read or parse OpenAPI files, scan PHP code, resolve external ",[281,787,788],{},"$ref",", or\nvalidate HTTP traffic. To generate the documents of a Laravel application from its routes, form requests and\nresources, use the generator built on this library:",[791,792],"lib-card",{"slug":33},[708,794,796],{"id":795},"compatibility","Compatibility",[795,798],{},[262,800,801,802,805,806,736],{},"The only runtime requirement is ",[281,803,804],{},"ext-json",". YAML output and the validation against the official schemas use optional\npackages; see ",[734,807,128],{"href":129},[708,809,811],{"id":810},"next","Next",[262,813,814,817,818,736],{},[734,815,816],{"href":129},"Install the package",", then follow the\n",[734,819,820],{"href":133},"quick start",[822,823,824],"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);}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":273,"searchDepth":325,"depth":325,"links":826},[827,828,829,830],{"id":710,"depth":318,"text":711},{"id":781,"depth":318,"text":782},{"id":795,"depth":318,"text":796},{"id":810,"depth":318,"text":811},"Build OpenAPI documents in PHP with immutable objects, and write them for OpenAPI 3.0, 3.1 or 3.2.","md",{},"---\ntitle: Introduction\ndescription: Build OpenAPI documents in PHP with immutable objects, and write them for OpenAPI 3.0, 3.1 or 3.2.\n---\n\nOpenAPI Writer builds OpenAPI documents with PHP objects, and writes them as JSON, YAML or a PHP array for the version\nyou choose: 3.0.0 to 3.0.4, 3.1.0 to 3.1.2, or 3.2.0. It does not depend on any framework: a script, a command, a\nSymfony or Laravel application, or another library can use it.\n\n::example{input=\"PHP\" output=\"components.schemas.Book (3.1.2)\"}\n#input\n```php\nuse Ark4ne\\OpenApiWriter\\Objects\\Schema;\n\n$book = Schema::object('Book')\n    ->properties(\n        Schema::integer('id')->readOnly(),\n        Schema::string('title'),\n        Schema::string('subtitle')->nullable(),\n    )\n    ->required('id', 'title');\n```\n#output\n```json\n{\n  \"type\": \"object\",\n  \"required\": [\"id\", \"title\"],\n  \"properties\": {\n    \"id\": { \"type\": \"integer\", \"readOnly\": true },\n    \"title\": { \"type\": \"string\" },\n    \"subtitle\": { \"type\": [\"string\", \"null\"] }\n  }\n}\n```\n::\n\nThe same object written for 3.0.4 gives `\"subtitle\": { \"type\": \"string\", \"nullable\": true }`: you describe the API\nonce, and the library writes what each version expects.\n\n## How it works\n\n- **One object per specification object**: `Schema`, `Operation`, `Response`… with one method per field, named\n  exactly like the specification. See [The object model](\u002Fopenapi-writer\u002Fbuilding-documents\u002Fthe-object-model).\n- **Immutable**: every method returns a modified copy, so a schema or a response can be shared and derived without\n  side effects.\n- **The version is chosen when writing**: the differences are converted, and a feature the version cannot express\n  throws, or is dropped and reported in [lenient mode](\u002Fopenapi-writer\u002Fversions-and-output\u002Fstrict-and-lenient).\n- **Any object can be written**: `toJson()`, `toYaml()` and `toArray()` work on a single schema as well as on the\n  document. See [Writing a document](\u002Fopenapi-writer\u002Fversions-and-output\u002Fwriting-a-document).\n- **Validation**: the [validator](\u002Fopenapi-writer\u002Fvalidation\u002Fvalidating-a-document) checks the written document\n  against the official schema of its version and ten semantic rules.\n\n## What it does not do\n\nOpenAPI Writer writes documents; it does not read or parse OpenAPI files, scan PHP code, resolve external `$ref`, or\nvalidate HTTP traffic. To generate the documents of a Laravel application from its routes, form requests and\nresources, use the generator built on this library:\n\n:lib-card{slug=\"laravel-openapi-generator\"}\n\n## Compatibility\n\n::compatibility\n::\n\nThe only runtime requirement is `ext-json`. YAML output and the validation against the official schemas use optional\npackages; see [Installation](\u002Fopenapi-writer\u002Fgetting-started\u002Finstallation).\n\n## Next\n\n[Install the package](\u002Fopenapi-writer\u002Fgetting-started\u002Finstallation), then follow the\n[quick start](\u002Fopenapi-writer\u002Fgetting-started\u002Fquick-start).\n",{"title":125,"description":831},"3UXOK5hC0V4qK6AoPAoAu7iCd3rJWy4Rj78jTG2XnWU",[118,838],{"title":128,"path":129,"stem":130,"description":839,"children":-1},"Require the package, and add the optional packages for YAML output and schema validation.",1795438899100]