[{"data":1,"prerenderedAt":1697},["ShallowReactive",2],{"libs":3,"navigation-openapi-writer":115,"\u002Fopenapi-writer\u002Fbuilding-documents\u002Fthe-object-model":256,"\u002Fopenapi-writer\u002Fbuilding-documents\u002Fthe-object-model-surround":1692},[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":142,"body":258,"description":1686,"experimental":119,"extension":1687,"links":118,"meta":1688,"navigation":325,"path":143,"rawbody":1689,"seo":1690,"since":118,"stem":144,"__hash__":1691},"openapi_writer\u002Fopenapi-writer\u002F2.building-documents\u002F1.the-object-model.md",{"type":259,"value":260,"toc":1676},"minimark",[261,270,275,278,427,430,485,492,496,514,521,630,648,652,675,798,817,850,861,873,877,892,1098,1134,1140,1167,1327,1357,1361,1368,1451,1470,1474,1487,1666,1672],[262,263,264,265,269],"p",{},"Every object of the OpenAPI specification has a PHP class in ",[266,267,268],"code",{},"Ark4ne\\OpenApiWriter\\Objects",", and every class follows\nthe same rules. Learn them once and the whole API follows.",[271,272,274],"h2",{"id":273},"objects-are-immutable","Objects are immutable",[262,276,277],{},"Every method returns a modified copy; the object it is called on does not change.",[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\\Schema;\n\n$name = Schema::string();\n$short = $name->maxLength(10);\n\n$name->maxLength;   \u002F\u002F null\n$short->maxLength;  \u002F\u002F 10\n","php","",[266,286,287,320,327,355,387,392,410],{"__ignoreMap":284},[288,289,292,296,300,304,307,309,311,313,316],"span",{"class":290,"line":291},"line",1,[288,293,295],{"class":294},"sw1J6","use",[288,297,299],{"class":298},"s_hVV"," Ark4ne",[288,301,303],{"class":302},"s39Yj","\\",[288,305,306],{"class":298},"OpenApiWriter",[288,308,303],{"class":302},[288,310,233],{"class":298},[288,312,303],{"class":302},[288,314,315],{"class":298},"Schema",[288,317,319],{"class":318},"sP7_E",";\n",[288,321,323],{"class":290,"line":322},2,[288,324,326],{"emptyLinePlaceholder":325},true,"\n",[288,328,330,333,337,341,345,348,352],{"class":290,"line":329},3,[288,331,332],{"class":318},"$",[288,334,336],{"class":335},"su5hD","name ",[288,338,340],{"class":339},"smGrS","=",[288,342,344],{"class":343},"sZMiF"," Schema",[288,346,347],{"class":339},"::",[288,349,351],{"class":350},"sGLFI","string",[288,353,354],{"class":318},"();\n",[288,356,358,360,363,365,368,371,374,377,380,384],{"class":290,"line":357},4,[288,359,332],{"class":318},[288,361,362],{"class":335},"short ",[288,364,340],{"class":339},[288,366,367],{"class":318}," $",[288,369,370],{"class":335},"name",[288,372,373],{"class":339},"->",[288,375,376],{"class":350},"maxLength",[288,378,379],{"class":318},"(",[288,381,383],{"class":382},"srdBf","10",[288,385,386],{"class":318},");\n",[288,388,390],{"class":290,"line":389},5,[288,391,326],{"emptyLinePlaceholder":325},[288,393,395,397,399,401,403,406],{"class":290,"line":394},6,[288,396,332],{"class":318},[288,398,370],{"class":335},[288,400,373],{"class":339},[288,402,376],{"class":335},[288,404,405],{"class":318},";",[288,407,409],{"class":408},"sutJx","   \u002F\u002F null\n",[288,411,413,415,418,420,422,424],{"class":290,"line":412},7,[288,414,332],{"class":318},[288,416,417],{"class":335},"short",[288,419,373],{"class":339},[288,421,376],{"class":335},[288,423,405],{"class":318},[288,425,426],{"class":408},"  \u002F\u002F 10\n",[262,428,429],{},"Always use the return value. A call whose result is dropped does nothing:",[279,431,433],{"className":281,"code":432,"language":283,"meta":284,"style":284},"$document->addPaths($path);              \u002F\u002F lost\n$document = $document->addPaths($path);  \u002F\u002F kept\n",[266,434,435,459],{"__ignoreMap":284},[288,436,437,439,442,444,447,450,453,456],{"class":290,"line":291},[288,438,332],{"class":318},[288,440,441],{"class":335},"document",[288,443,373],{"class":339},[288,445,446],{"class":350},"addPaths",[288,448,449],{"class":318},"($",[288,451,452],{"class":335},"path",[288,454,455],{"class":318},");",[288,457,458],{"class":408},"              \u002F\u002F lost\n",[288,460,461,463,466,468,470,472,474,476,478,480,482],{"class":290,"line":322},[288,462,332],{"class":318},[288,464,465],{"class":335},"document ",[288,467,340],{"class":339},[288,469,367],{"class":318},[288,471,441],{"class":335},[288,473,373],{"class":339},[288,475,446],{"class":350},[288,477,449],{"class":318},[288,479,452],{"class":335},[288,481,455],{"class":318},[288,483,484],{"class":408},"  \u002F\u002F kept\n",[262,486,487,488,491],{},"In return, objects can be shared and derived freely: one ",[266,489,490],{},"Response::notFound()"," can be used by every operation, and\na base schema can be extended without touching the original.",[271,493,495],{"id":494},"methods-are-named-after-the-specification","Methods are named after the specification",[262,497,498,499,502,503,502,506,509,510,513],{},"One method per field, with exactly the name of the field: ",[266,500,501],{},"operationId()",", ",[266,504,505],{},"requestBody()",[266,507,508],{},"exclusiveMinimum()",",\n",[266,511,512],{},"additionalProperties()",". If a field exists in the specification, the method exists, with no synonym.",[262,515,516,517,520],{},"Each class has a ",[266,518,519],{},"create()"," constructor and shortcuts for the common cases:",[522,523,524,537],"table",{},[525,526,527],"thead",{},[528,529,530,534],"tr",{},[531,532,533],"th",{},"Shortcut",[531,535,536],{},"Same as",[538,539,540,553,567,585,602,614],"tbody",{},[528,541,542,548],{},[543,544,545],"td",{},[266,546,547],{},"Schema::string('email')",[543,549,550],{},[266,551,552],{},"Schema::create('email')->type('string')",[528,554,555,560],{},[543,556,557],{},[266,558,559],{},"Operation::get()",[543,561,562,563,566],{},"the operation placed under ",[266,564,565],{},"get"," of its path item",[528,568,569,574],{},[543,570,571],{},[266,572,573],{},"Parameter::path('id')",[543,575,576,502,579,502,582],{},[266,577,578],{},"in: path",[266,580,581],{},"required: true",[266,583,584],{},"name: id",[528,586,587,592],{},[543,588,589],{},[266,590,591],{},"Response::created()",[543,593,594,595,598,599],{},"status ",[266,596,597],{},"201",", description ",[266,600,601],{},"Created",[528,603,604,609],{},[543,605,606],{},[266,607,608],{},"MediaType::json()",[543,610,611],{},[266,612,613],{},"application\u002Fjson",[528,615,616,621],{},[543,617,618],{},[266,619,620],{},"SecurityScheme::http('bearer')",[543,622,623,626,627],{},[266,624,625],{},"type: http",", under the name ",[266,628,629],{},"bearer",[262,631,632,633,502,636,639,640,643,644,647],{},"Fields are read as properties: ",[266,634,635],{},"$schema->maxLength",[266,637,638],{},"$info->title",". An unset field reads ",[266,641,642],{},"null","; ",[266,645,646],{},"has('maxLength')","\ntells whether it is set.",[271,649,651],{"id":650},"the-first-argument-is-the-key-in-the-parent","The first argument is the key in the parent",[262,653,654,655,658,659,662,663,666,667,669,670,674],{},"Many objects live in a map of their parent: a property in ",[266,656,657],{},"properties",", a schema in ",[266,660,661],{},"components.schemas",", a path in\n",[266,664,665],{},"paths",", a response under its status code. The first argument of ",[266,668,519],{}," and of the shortcuts is that key, called\nthe ",[671,672,673],"strong",{},"objectId",":",[279,676,678],{"className":281,"code":677,"language":283,"meta":284,"style":284},"Schema::string('email');                 \u002F\u002F the property \"email\"\nSchema::object('User');                  \u002F\u002F the component \"User\"\nPathItem::create('\u002Fusers\u002F{id}');         \u002F\u002F the path \"\u002Fusers\u002F{id}\"\nHeader::create('X-Rate-Limit');          \u002F\u002F the header \"X-Rate-Limit\"\nExample::create('admin');                \u002F\u002F the example \"admin\"\n",[266,679,680,705,728,752,775],{"__ignoreMap":284},[288,681,682,684,686,688,690,694,698,700,702],{"class":290,"line":291},[288,683,315],{"class":343},[288,685,347],{"class":339},[288,687,351],{"class":350},[288,689,379],{"class":318},[288,691,693],{"class":692},"sjJ54","'",[288,695,697],{"class":696},"s_sjI","email",[288,699,693],{"class":692},[288,701,455],{"class":318},[288,703,704],{"class":408},"                 \u002F\u002F the property \"email\"\n",[288,706,707,709,711,714,716,718,721,723,725],{"class":290,"line":322},[288,708,315],{"class":343},[288,710,347],{"class":339},[288,712,713],{"class":350},"object",[288,715,379],{"class":318},[288,717,693],{"class":692},[288,719,720],{"class":696},"User",[288,722,693],{"class":692},[288,724,455],{"class":318},[288,726,727],{"class":408},"                  \u002F\u002F the component \"User\"\n",[288,729,730,733,735,738,740,742,745,747,749],{"class":290,"line":329},[288,731,732],{"class":343},"PathItem",[288,734,347],{"class":339},[288,736,737],{"class":350},"create",[288,739,379],{"class":318},[288,741,693],{"class":692},[288,743,744],{"class":696},"\u002Fusers\u002F{id}",[288,746,693],{"class":692},[288,748,455],{"class":318},[288,750,751],{"class":408},"         \u002F\u002F the path \"\u002Fusers\u002F{id}\"\n",[288,753,754,757,759,761,763,765,768,770,772],{"class":290,"line":357},[288,755,756],{"class":343},"Header",[288,758,347],{"class":339},[288,760,737],{"class":350},[288,762,379],{"class":318},[288,764,693],{"class":692},[288,766,767],{"class":696},"X-Rate-Limit",[288,769,693],{"class":692},[288,771,455],{"class":318},[288,773,774],{"class":408},"          \u002F\u002F the header \"X-Rate-Limit\"\n",[288,776,777,780,782,784,786,788,791,793,795],{"class":290,"line":389},[288,778,779],{"class":343},"Example",[288,781,347],{"class":339},[288,783,737],{"class":350},[288,785,379],{"class":318},[288,787,693],{"class":692},[288,789,790],{"class":696},"admin",[288,792,693],{"class":692},[288,794,455],{"class":318},[288,796,797],{"class":408},"                \u002F\u002F the example \"admin\"\n",[262,799,800,801,804,805,502,808,804,810,812,813,816],{},"The shortcuts set it for you (",[266,802,803],{},"Response::ok()"," is ",[266,806,807],{},"200",[266,809,608],{},[266,811,613],{},"), and\n",[266,814,815],{},"objectId()"," changes it, for example to store a response as a component:",[279,818,820],{"className":281,"code":819,"language":283,"meta":284,"style":284},"Response::notFound()->objectId('NotFound');\n",[266,821,822],{"__ignoreMap":284},[288,823,824,827,829,832,835,837,839,841,843,846,848],{"class":290,"line":291},[288,825,826],{"class":343},"Response",[288,828,347],{"class":339},[288,830,831],{"class":350},"notFound",[288,833,834],{"class":318},"()",[288,836,373],{"class":339},[288,838,673],{"class":350},[288,840,379],{"class":318},[288,842,693],{"class":692},[288,844,845],{"class":696},"NotFound",[288,847,693],{"class":692},[288,849,386],{"class":318},[262,851,852,853,856,857,860],{},"An entry of a map needs an objectId, and two entries of the same map cannot share one: both throw, at once, a\n",[266,854,855],{},"MissingObjectIdException"," or a ",[266,858,859],{},"DuplicateObjectIdException",".",[862,863,864],"warning",{},[262,865,866,869,870,860],{},[266,867,868],{},"Tag::create('pets')"," sets only the objectId. Tags live in a list, and their name is a field: write\n",[266,871,872],{},"Tag::create()->name('pets')",[271,874,876],{"id":875},"lists-and-maps-have-two-methods","Lists and maps have two methods",[262,878,879,880,883,884,887,888,891],{},"Every list or map field has two variadic methods: the field name ",[671,881,882],{},"replaces"," the entries, ",[266,885,886],{},"add"," + the field name\n",[671,889,890],{},"appends"," to them.",[893,894,896,978],"example",{"input":315,"output":895},"toArray()",[897,898,899],"template",{"v-slot:input":284},[279,900,902],{"className":281,"code":901,"language":283,"meta":284,"style":284},"Schema::object('Pet')\n    ->properties(Schema::string('name'))\n    ->addProperties(Schema::integer('age'));\n",[266,903,904,924,950],{"__ignoreMap":284},[288,905,906,908,910,912,914,916,919,921],{"class":290,"line":291},[288,907,315],{"class":343},[288,909,347],{"class":339},[288,911,713],{"class":350},[288,913,379],{"class":318},[288,915,693],{"class":692},[288,917,918],{"class":696},"Pet",[288,920,693],{"class":692},[288,922,923],{"class":318},")\n",[288,925,926,929,931,933,935,937,939,941,943,945,947],{"class":290,"line":322},[288,927,928],{"class":339},"    ->",[288,930,657],{"class":350},[288,932,379],{"class":318},[288,934,315],{"class":343},[288,936,347],{"class":339},[288,938,351],{"class":350},[288,940,379],{"class":318},[288,942,693],{"class":692},[288,944,370],{"class":696},[288,946,693],{"class":692},[288,948,949],{"class":318},"))\n",[288,951,952,954,957,959,961,963,966,968,970,973,975],{"class":290,"line":329},[288,953,928],{"class":339},[288,955,956],{"class":350},"addProperties",[288,958,379],{"class":318},[288,960,315],{"class":343},[288,962,347],{"class":339},[288,964,965],{"class":350},"integer",[288,967,379],{"class":318},[288,969,693],{"class":692},[288,971,972],{"class":696},"age",[288,974,693],{"class":692},[288,976,977],{"class":318},"));\n",[897,979,980],{"v-slot:output":284},[279,981,985],{"className":982,"code":983,"language":984,"meta":284,"style":284},"language-json shiki shiki-themes material-theme-lighter github-light github-dark","{\n  \"type\": \"object\",\n  \"properties\": {\n    \"name\": { \"type\": \"string\" },\n    \"age\": { \"type\": \"integer\" }\n  }\n}\n","json",[266,986,987,992,1015,1028,1059,1088,1093],{"__ignoreMap":284},[288,988,989],{"class":290,"line":291},[288,990,991],{"class":318},"{\n",[288,993,994,997,1001,1004,1006,1009,1011,1013],{"class":290,"line":322},[288,995,996],{"class":302},"  \"",[288,998,1000],{"class":999},"sseR_","type",[288,1002,1003],{"class":302},"\"",[288,1005,674],{"class":318},[288,1007,1008],{"class":692}," \"",[288,1010,713],{"class":696},[288,1012,1003],{"class":692},[288,1014,509],{"class":318},[288,1016,1017,1019,1021,1023,1025],{"class":290,"line":329},[288,1018,996],{"class":302},[288,1020,657],{"class":999},[288,1022,1003],{"class":302},[288,1024,674],{"class":318},[288,1026,1027],{"class":318}," {\n",[288,1029,1030,1033,1035,1037,1039,1042,1044,1046,1048,1050,1052,1054,1056],{"class":290,"line":357},[288,1031,1032],{"class":302},"    \"",[288,1034,370],{"class":343},[288,1036,1003],{"class":302},[288,1038,674],{"class":318},[288,1040,1041],{"class":318}," {",[288,1043,1008],{"class":302},[288,1045,1000],{"class":382},[288,1047,1003],{"class":302},[288,1049,674],{"class":318},[288,1051,1008],{"class":692},[288,1053,351],{"class":696},[288,1055,1003],{"class":692},[288,1057,1058],{"class":318}," },\n",[288,1060,1061,1063,1065,1067,1069,1071,1073,1075,1077,1079,1081,1083,1085],{"class":290,"line":389},[288,1062,1032],{"class":302},[288,1064,972],{"class":343},[288,1066,1003],{"class":302},[288,1068,674],{"class":318},[288,1070,1041],{"class":318},[288,1072,1008],{"class":302},[288,1074,1000],{"class":382},[288,1076,1003],{"class":302},[288,1078,674],{"class":318},[288,1080,1008],{"class":692},[288,1082,965],{"class":696},[288,1084,1003],{"class":692},[288,1086,1087],{"class":318}," }\n",[288,1089,1090],{"class":290,"line":394},[288,1091,1092],{"class":318},"  }\n",[288,1094,1095],{"class":290,"line":412},[288,1096,1097],{"class":318},"}\n",[262,1099,1100,1101,502,1104,502,1107,502,1110,1113,1114,1117,1118,502,1121,502,1124,502,1127,1130,1131,860],{},"The names are not singularized: ",[266,1102,1103],{},"addPaths()",[266,1105,1106],{},"addProperties()",[266,1108,1109],{},"addTags()",[266,1111,1112],{},"addServers()",". Both take objects, never\nassociative arrays, except five fields whose values are plain data and take an ",[266,1115,1116],{},"array\u003Cstring, …>",":\n",[266,1119,1120],{},"Link::parameters()",[266,1122,1123],{},"Discriminator::mapping()",[266,1125,1126],{},"OAuthFlow::scopes()",[266,1128,1129],{},"Schema::dependentRequired()"," and\n",[266,1132,1133],{},"SecurityRequirement::schemes()",[271,1135,1137,1139],{"id":1136},"null-resets-except-for-free-values",[266,1138,642],{}," resets, except for free values",[262,1141,1142,1143,1145,1146,502,1149,1152,1153,1156,1157,1159,1160,1162,1163,1166],{},"Passing ",[266,1144,642],{}," to a typed setter removes the field. ",[266,1147,1148],{},"default()",[266,1150,1151],{},"example()"," and ",[266,1154,1155],{},"const()"," take any value, so ",[266,1158,642],{},"\nthere writes a real ",[266,1161,642],{},". ",[266,1164,1165],{},"without()"," removes any field.",[893,1168,1169,1262],{"input":315,"output":895},[897,1170,1171],{"v-slot:input":284},[279,1172,1174],{"className":281,"code":1173,"language":283,"meta":284,"style":284},"Schema::string('note')\n    ->description('Free text')\n    ->description(null)      \u002F\u002F removed\n    ->default(null)          \u002F\u002F \"default\": null\n    ->example('Any value');\n",[266,1175,1176,1195,1213,1229,1245],{"__ignoreMap":284},[288,1177,1178,1180,1182,1184,1186,1188,1191,1193],{"class":290,"line":291},[288,1179,315],{"class":343},[288,1181,347],{"class":339},[288,1183,351],{"class":350},[288,1185,379],{"class":318},[288,1187,693],{"class":692},[288,1189,1190],{"class":696},"note",[288,1192,693],{"class":692},[288,1194,923],{"class":318},[288,1196,1197,1199,1202,1204,1206,1209,1211],{"class":290,"line":322},[288,1198,928],{"class":339},[288,1200,1201],{"class":350},"description",[288,1203,379],{"class":318},[288,1205,693],{"class":692},[288,1207,1208],{"class":696},"Free text",[288,1210,693],{"class":692},[288,1212,923],{"class":318},[288,1214,1215,1217,1219,1221,1223,1226],{"class":290,"line":329},[288,1216,928],{"class":339},[288,1218,1201],{"class":350},[288,1220,379],{"class":318},[288,1222,642],{"class":302},[288,1224,1225],{"class":318},")",[288,1227,1228],{"class":408},"      \u002F\u002F removed\n",[288,1230,1231,1233,1236,1238,1240,1242],{"class":290,"line":357},[288,1232,928],{"class":339},[288,1234,1235],{"class":350},"default",[288,1237,379],{"class":318},[288,1239,642],{"class":302},[288,1241,1225],{"class":318},[288,1243,1244],{"class":408},"          \u002F\u002F \"default\": null\n",[288,1246,1247,1249,1251,1253,1255,1258,1260],{"class":290,"line":389},[288,1248,928],{"class":339},[288,1250,893],{"class":350},[288,1252,379],{"class":318},[288,1254,693],{"class":692},[288,1256,1257],{"class":696},"Any value",[288,1259,693],{"class":692},[288,1261,386],{"class":318},[897,1263,1264],{"v-slot:output":284},[279,1265,1267],{"className":982,"code":1266,"language":984,"meta":284,"style":284},"{\n  \"default\": null,\n  \"type\": \"string\",\n  \"example\": \"Any value\"\n}\n",[266,1268,1269,1273,1288,1306,1323],{"__ignoreMap":284},[288,1270,1271],{"class":290,"line":291},[288,1272,991],{"class":318},[288,1274,1275,1277,1279,1281,1283,1286],{"class":290,"line":322},[288,1276,996],{"class":302},[288,1278,1235],{"class":999},[288,1280,1003],{"class":302},[288,1282,674],{"class":318},[288,1284,1285],{"class":302}," null",[288,1287,509],{"class":318},[288,1289,1290,1292,1294,1296,1298,1300,1302,1304],{"class":290,"line":329},[288,1291,996],{"class":302},[288,1293,1000],{"class":999},[288,1295,1003],{"class":302},[288,1297,674],{"class":318},[288,1299,1008],{"class":692},[288,1301,351],{"class":696},[288,1303,1003],{"class":692},[288,1305,509],{"class":318},[288,1307,1308,1310,1312,1314,1316,1318,1320],{"class":290,"line":357},[288,1309,996],{"class":302},[288,1311,893],{"class":999},[288,1313,1003],{"class":302},[288,1315,674],{"class":318},[288,1317,1008],{"class":692},[288,1319,1257],{"class":696},[288,1321,1322],{"class":692},"\"\n",[288,1324,1325],{"class":290,"line":389},[288,1326,1097],{"class":318},[279,1328,1330],{"className":281,"code":1329,"language":283,"meta":284,"style":284},"$schema->without('default');   \u002F\u002F removes the default, whatever its value\n",[266,1331,1332],{"__ignoreMap":284},[288,1333,1334,1336,1339,1341,1344,1346,1348,1350,1352,1354],{"class":290,"line":291},[288,1335,332],{"class":318},[288,1337,1338],{"class":335},"schema",[288,1340,373],{"class":339},[288,1342,1343],{"class":350},"without",[288,1345,379],{"class":318},[288,1347,693],{"class":692},[288,1349,1235],{"class":696},[288,1351,693],{"class":692},[288,1353,455],{"class":318},[288,1355,1356],{"class":408},"   \u002F\u002F removes the default, whatever its value\n",[271,1358,1360],{"id":1359},"impossible-values-throw-at-once","Impossible values throw at once",[262,1362,1363,1364,1367],{},"A value no version accepts throws an ",[266,1365,1366],{},"InvalidArgumentException"," when the method is called, not when the document is\nwritten:",[279,1369,1371],{"className":281,"code":1370,"language":283,"meta":284,"style":284},"Response::status(999);\n\u002F\u002F Response::status: \"999\" is not a status code (100 to 599)\n\u002F\u002F or range (1XX to 5XX)\n\nLicense::create()->url('https:\u002F\u002Fexample.com')->identifier('MIT');\n\u002F\u002F License::identifier: url and identifier are mutually exclusive\n",[266,1372,1373,1389,1394,1399,1403,1446],{"__ignoreMap":284},[288,1374,1375,1377,1379,1382,1384,1387],{"class":290,"line":291},[288,1376,826],{"class":343},[288,1378,347],{"class":339},[288,1380,1381],{"class":350},"status",[288,1383,379],{"class":318},[288,1385,1386],{"class":382},"999",[288,1388,386],{"class":318},[288,1390,1391],{"class":290,"line":322},[288,1392,1393],{"class":408},"\u002F\u002F Response::status: \"999\" is not a status code (100 to 599)\n",[288,1395,1396],{"class":290,"line":329},[288,1397,1398],{"class":408},"\u002F\u002F or range (1XX to 5XX)\n",[288,1400,1401],{"class":290,"line":357},[288,1402,326],{"emptyLinePlaceholder":325},[288,1404,1405,1408,1410,1412,1414,1416,1419,1421,1423,1426,1428,1430,1432,1435,1437,1439,1442,1444],{"class":290,"line":389},[288,1406,1407],{"class":343},"License",[288,1409,347],{"class":339},[288,1411,737],{"class":350},[288,1413,834],{"class":318},[288,1415,373],{"class":339},[288,1417,1418],{"class":350},"url",[288,1420,379],{"class":318},[288,1422,693],{"class":692},[288,1424,1425],{"class":696},"https:\u002F\u002Fexample.com",[288,1427,693],{"class":692},[288,1429,1225],{"class":318},[288,1431,373],{"class":339},[288,1433,1434],{"class":350},"identifier",[288,1436,379],{"class":318},[288,1438,693],{"class":692},[288,1440,1441],{"class":696},"MIT",[288,1443,693],{"class":692},[288,1445,386],{"class":318},[288,1447,1448],{"class":290,"line":394},[288,1449,1450],{"class":408},"\u002F\u002F License::identifier: url and identifier are mutually exclusive\n",[262,1452,1453,1454,1457,1458,1461,1462,1466,1467,860],{},"What depends on the whole document (a unique ",[266,1455,1456],{},"operationId",", a ",[266,1459,1460],{},"$ref"," that resolves) is checked by the\n",[1463,1464,1465],"a",{"href":220},"validator",". What depends on the version is checked when\n",[1463,1468,1469],{"href":202},"writing",[271,1471,1473],{"id":1472},"extensions","Extensions",[262,1475,1476,1477,1152,1479,1482,1483,1486],{},"Every object but ",[266,1478,227],{},[266,1480,1481],{},"SecurityRequirement"," accepts extensions. The ",[266,1484,1485],{},"x-"," prefix is added when missing:",[893,1488,1490,1586],{"input":1489,"output":895},"Info",[897,1491,1492],{"v-slot:input":284},[279,1493,1495],{"className":281,"code":1494,"language":283,"meta":284,"style":284},"Info::create()\n    ->title('Pet Store')\n    ->version('1.0.0')\n    ->x('logo', ['url' => 'https:\u002F\u002Fexample.com\u002Flogo.png']);\n",[266,1496,1497,1508,1526,1544],{"__ignoreMap":284},[288,1498,1499,1501,1503,1505],{"class":290,"line":291},[288,1500,1489],{"class":343},[288,1502,347],{"class":339},[288,1504,737],{"class":350},[288,1506,1507],{"class":318},"()\n",[288,1509,1510,1512,1515,1517,1519,1522,1524],{"class":290,"line":322},[288,1511,928],{"class":339},[288,1513,1514],{"class":350},"title",[288,1516,379],{"class":318},[288,1518,693],{"class":692},[288,1520,1521],{"class":696},"Pet Store",[288,1523,693],{"class":692},[288,1525,923],{"class":318},[288,1527,1528,1530,1533,1535,1537,1540,1542],{"class":290,"line":329},[288,1529,928],{"class":339},[288,1531,1532],{"class":350},"version",[288,1534,379],{"class":318},[288,1536,693],{"class":692},[288,1538,1539],{"class":696},"1.0.0",[288,1541,693],{"class":692},[288,1543,923],{"class":318},[288,1545,1546,1548,1551,1553,1555,1558,1560,1563,1566,1568,1570,1572,1575,1578,1581,1583],{"class":290,"line":357},[288,1547,928],{"class":339},[288,1549,1550],{"class":350},"x",[288,1552,379],{"class":318},[288,1554,693],{"class":692},[288,1556,1557],{"class":696},"logo",[288,1559,693],{"class":692},[288,1561,1562],{"class":318},",",[288,1564,1565],{"class":318}," [",[288,1567,693],{"class":692},[288,1569,1418],{"class":696},[288,1571,693],{"class":692},[288,1573,1574],{"class":339}," =>",[288,1576,1577],{"class":692}," '",[288,1579,1580],{"class":696},"https:\u002F\u002Fexample.com\u002Flogo.png",[288,1582,693],{"class":692},[288,1584,1585],{"class":318},"]);\n",[897,1587,1588],{"v-slot:output":284},[279,1589,1591],{"className":982,"code":1590,"language":984,"meta":284,"style":284},"{\n  \"title\": \"Pet Store\",\n  \"version\": \"1.0.0\",\n  \"x-logo\": { \"url\": \"https:\u002F\u002Fexample.com\u002Flogo.png\" }\n}\n",[266,1592,1593,1597,1615,1633,1662],{"__ignoreMap":284},[288,1594,1595],{"class":290,"line":291},[288,1596,991],{"class":318},[288,1598,1599,1601,1603,1605,1607,1609,1611,1613],{"class":290,"line":322},[288,1600,996],{"class":302},[288,1602,1514],{"class":999},[288,1604,1003],{"class":302},[288,1606,674],{"class":318},[288,1608,1008],{"class":692},[288,1610,1521],{"class":696},[288,1612,1003],{"class":692},[288,1614,509],{"class":318},[288,1616,1617,1619,1621,1623,1625,1627,1629,1631],{"class":290,"line":329},[288,1618,996],{"class":302},[288,1620,1532],{"class":999},[288,1622,1003],{"class":302},[288,1624,674],{"class":318},[288,1626,1008],{"class":692},[288,1628,1539],{"class":696},[288,1630,1003],{"class":692},[288,1632,509],{"class":318},[288,1634,1635,1637,1640,1642,1644,1646,1648,1650,1652,1654,1656,1658,1660],{"class":290,"line":357},[288,1636,996],{"class":302},[288,1638,1639],{"class":999},"x-logo",[288,1641,1003],{"class":302},[288,1643,674],{"class":318},[288,1645,1041],{"class":318},[288,1647,1008],{"class":302},[288,1649,1418],{"class":343},[288,1651,1003],{"class":302},[288,1653,674],{"class":318},[288,1655,1008],{"class":692},[288,1657,1580],{"class":696},[288,1659,1003],{"class":692},[288,1661,1087],{"class":318},[288,1663,1664],{"class":290,"line":389},[288,1665,1097],{"class":318},[262,1667,1668,1671],{},[266,1669,1670],{},"withoutX('logo')"," removes it.",[1673,1674,1675],"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 .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--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 .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 .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 .sseR_, html code.shiki .sseR_{--shiki-light:#9C3EDA;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":284,"searchDepth":329,"depth":329,"links":1677},[1678,1679,1680,1681,1682,1684,1685],{"id":273,"depth":322,"text":274},{"id":494,"depth":322,"text":495},{"id":650,"depth":322,"text":651},{"id":875,"depth":322,"text":876},{"id":1136,"depth":322,"text":1683},"null resets, except for free values",{"id":1359,"depth":322,"text":1360},{"id":1472,"depth":322,"text":1473},"The five rules every object follows - immutability, spec names, keys, lists and maps, null and unset.","md",{},"---\ntitle: The object model\ndescription: The five rules every object follows - immutability, spec names, keys, lists and maps, null and unset.\n---\n\nEvery object of the OpenAPI specification has a PHP class in `Ark4ne\\OpenApiWriter\\Objects`, and every class follows\nthe same rules. Learn them once and the whole API follows.\n\n## Objects are immutable\n\nEvery method returns a modified copy; the object it is called on does not change.\n\n```php\nuse Ark4ne\\OpenApiWriter\\Objects\\Schema;\n\n$name = Schema::string();\n$short = $name->maxLength(10);\n\n$name->maxLength;   \u002F\u002F null\n$short->maxLength;  \u002F\u002F 10\n```\n\nAlways use the return value. A call whose result is dropped does nothing:\n\n```php\n$document->addPaths($path);              \u002F\u002F lost\n$document = $document->addPaths($path);  \u002F\u002F kept\n```\n\nIn return, objects can be shared and derived freely: one `Response::notFound()` can be used by every operation, and\na base schema can be extended without touching the original.\n\n## Methods are named after the specification\n\nOne method per field, with exactly the name of the field: `operationId()`, `requestBody()`, `exclusiveMinimum()`,\n`additionalProperties()`. If a field exists in the specification, the method exists, with no synonym.\n\nEach class has a `create()` constructor and shortcuts for the common cases:\n\n| Shortcut | Same as |\n| --- | --- |\n| `Schema::string('email')` | `Schema::create('email')->type('string')` |\n| `Operation::get()` | the operation placed under `get` of its path item |\n| `Parameter::path('id')` | `in: path`, `required: true`, `name: id` |\n| `Response::created()` | status `201`, description `Created` |\n| `MediaType::json()` | `application\u002Fjson` |\n| `SecurityScheme::http('bearer')` | `type: http`, under the name `bearer` |\n\nFields are read as properties: `$schema->maxLength`, `$info->title`. An unset field reads `null`; `has('maxLength')`\ntells whether it is set.\n\n## The first argument is the key in the parent\n\nMany objects live in a map of their parent: a property in `properties`, a schema in `components.schemas`, a path in\n`paths`, a response under its status code. The first argument of `create()` and of the shortcuts is that key, called\nthe **objectId**:\n\n```php\nSchema::string('email');                 \u002F\u002F the property \"email\"\nSchema::object('User');                  \u002F\u002F the component \"User\"\nPathItem::create('\u002Fusers\u002F{id}');         \u002F\u002F the path \"\u002Fusers\u002F{id}\"\nHeader::create('X-Rate-Limit');          \u002F\u002F the header \"X-Rate-Limit\"\nExample::create('admin');                \u002F\u002F the example \"admin\"\n```\n\nThe shortcuts set it for you (`Response::ok()` is `200`, `MediaType::json()` is `application\u002Fjson`), and\n`objectId()` changes it, for example to store a response as a component:\n\n```php\nResponse::notFound()->objectId('NotFound');\n```\n\nAn entry of a map needs an objectId, and two entries of the same map cannot share one: both throw, at once, a\n`MissingObjectIdException` or a `DuplicateObjectIdException`.\n\n::warning\n`Tag::create('pets')` sets only the objectId. Tags live in a list, and their name is a field: write\n`Tag::create()->name('pets')`.\n::\n\n## Lists and maps have two methods\n\nEvery list or map field has two variadic methods: the field name **replaces** the entries, `add` + the field name\n**appends** to them.\n\n::example{input=\"Schema\" output=\"toArray()\"}\n#input\n```php\nSchema::object('Pet')\n    ->properties(Schema::string('name'))\n    ->addProperties(Schema::integer('age'));\n```\n#output\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"name\": { \"type\": \"string\" },\n    \"age\": { \"type\": \"integer\" }\n  }\n}\n```\n::\n\nThe names are not singularized: `addPaths()`, `addProperties()`, `addTags()`, `addServers()`. Both take objects, never\nassociative arrays, except five fields whose values are plain data and take an `array\u003Cstring, …>`:\n`Link::parameters()`, `Discriminator::mapping()`, `OAuthFlow::scopes()`, `Schema::dependentRequired()` and\n`SecurityRequirement::schemes()`.\n\n## `null` resets, except for free values\n\nPassing `null` to a typed setter removes the field. `default()`, `example()` and `const()` take any value, so `null`\nthere writes a real `null`. `without()` removes any field.\n\n::example{input=\"Schema\" output=\"toArray()\"}\n#input\n```php\nSchema::string('note')\n    ->description('Free text')\n    ->description(null)      \u002F\u002F removed\n    ->default(null)          \u002F\u002F \"default\": null\n    ->example('Any value');\n```\n#output\n```json\n{\n  \"default\": null,\n  \"type\": \"string\",\n  \"example\": \"Any value\"\n}\n```\n::\n\n```php\n$schema->without('default');   \u002F\u002F removes the default, whatever its value\n```\n\n## Impossible values throw at once\n\nA value no version accepts throws an `InvalidArgumentException` when the method is called, not when the document is\nwritten:\n\n```php\nResponse::status(999);\n\u002F\u002F Response::status: \"999\" is not a status code (100 to 599)\n\u002F\u002F or range (1XX to 5XX)\n\nLicense::create()->url('https:\u002F\u002Fexample.com')->identifier('MIT');\n\u002F\u002F License::identifier: url and identifier are mutually exclusive\n```\n\nWhat depends on the whole document (a unique `operationId`, a `$ref` that resolves) is checked by the\n[validator](\u002Fopenapi-writer\u002Fvalidation\u002Fvalidating-a-document). What depends on the version is checked when\n[writing](\u002Fopenapi-writer\u002Fversions-and-output\u002Fstrict-and-lenient).\n\n## Extensions\n\nEvery object but `Reference` and `SecurityRequirement` accepts extensions. The `x-` prefix is added when missing:\n\n::example{input=\"Info\" output=\"toArray()\"}\n#input\n```php\nInfo::create()\n    ->title('Pet Store')\n    ->version('1.0.0')\n    ->x('logo', ['url' => 'https:\u002F\u002Fexample.com\u002Flogo.png']);\n```\n#output\n```json\n{\n  \"title\": \"Pet Store\",\n  \"version\": \"1.0.0\",\n  \"x-logo\": { \"url\": \"https:\u002F\u002Fexample.com\u002Flogo.png\" }\n}\n```\n::\n\n`withoutX('logo')` removes it.\n",{"title":142,"description":1686},"kSHK2jh4Az_pi2b7-gjWHd2mLn8KJALSlbrMF7J_zDY",[1693,1695],{"title":132,"path":133,"stem":134,"description":1694,"children":-1},"Build a small document, write it for OpenAPI 3.1 and 3.0, and validate it.",{"title":146,"path":147,"stem":148,"description":1696,"children":-1},"The root object - info, servers, tags, external documentation and the default version.",1795438900427]