[{"data":1,"prerenderedAt":968},["ShallowReactive",2],{"libs":3,"navigation-openapi-writer":115,"\u002Fopenapi-writer\u002Fversions-and-output\u002Fstrict-and-lenient":256,"\u002Fopenapi-writer\u002Fversions-and-output\u002Fstrict-and-lenient-surround":963},[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":201,"body":258,"description":957,"experimental":119,"extension":958,"links":118,"meta":959,"navigation":357,"path":202,"rawbody":960,"seo":961,"since":118,"stem":203,"__hash__":962},"openapi_writer\u002Fopenapi-writer\u002F4.versions-and-output\u002F4.strict-and-lenient.md",{"type":259,"value":260,"toc":951},"minimark",[261,265,270,289,452,460,472,476,487,684,690,700,703,708,761,767,830,842,937,941,947],[262,263,264],"p",{},"When a document uses a feature the target version cannot express, the library either throws (strict mode, the\ndefault) or drops the feature and reports it (lenient mode). Both list every problem at once, each with the JSON Pointer\nof its place in the document.",[266,267,269],"h2",{"id":268},"strict-mode","Strict mode",[262,271,272,276,277,280,281,284,285,288],{},[273,274,275],"code",{},"toJson()",", ",[273,278,279],{},"toYaml()"," and ",[273,282,283],{},"toArray()"," are strict. One ",[273,286,287],{},"UnsupportedFeatureException"," lists every unsupported feature:",[290,291,296],"pre",{"className":292,"code":293,"language":294,"meta":295,"style":295},"language-php shiki shiki-themes material-theme-lighter github-light github-dark","use Ark4ne\\OpenApiWriter\\Enums\\Version;\nuse Ark4ne\\OpenApiWriter\\Exceptions\\UnsupportedFeatureException;\n\ntry {\n    $document->toJson(Version::V3_0_4);\n} catch (UnsupportedFeatureException $exception) {\n    echo $exception->getMessage();\n}\n","php","",[273,297,298,331,352,359,369,402,427,446],{"__ignoreMap":295},[299,300,303,307,311,315,318,320,322,324,327],"span",{"class":301,"line":302},"line",1,[299,304,306],{"class":305},"sw1J6","use",[299,308,310],{"class":309},"s_hVV"," Ark4ne",[299,312,314],{"class":313},"s39Yj","\\",[299,316,317],{"class":309},"OpenApiWriter",[299,319,314],{"class":313},[299,321,237],{"class":309},[299,323,314],{"class":313},[299,325,326],{"class":309},"Version",[299,328,330],{"class":329},"sP7_E",";\n",[299,332,334,336,338,340,342,344,346,348,350],{"class":301,"line":333},2,[299,335,306],{"class":305},[299,337,310],{"class":309},[299,339,314],{"class":313},[299,341,317],{"class":309},[299,343,314],{"class":313},[299,345,245],{"class":309},[299,347,314],{"class":313},[299,349,287],{"class":309},[299,351,330],{"class":329},[299,353,355],{"class":301,"line":354},3,[299,356,358],{"emptyLinePlaceholder":357},true,"\n",[299,360,362,366],{"class":301,"line":361},4,[299,363,365],{"class":364},"sVHd0","try",[299,367,368],{"class":329}," {\n",[299,370,372,375,379,383,387,390,393,396,399],{"class":301,"line":371},5,[299,373,374],{"class":329},"    $",[299,376,378],{"class":377},"su5hD","document",[299,380,382],{"class":381},"smGrS","->",[299,384,386],{"class":385},"sGLFI","toJson",[299,388,389],{"class":329},"(",[299,391,326],{"class":392},"sZMiF",[299,394,395],{"class":381},"::",[299,397,398],{"class":309},"V3_0_4",[299,400,401],{"class":329},");\n",[299,403,405,408,411,414,416,419,422,425],{"class":301,"line":404},6,[299,406,407],{"class":329},"}",[299,409,410],{"class":364}," catch",[299,412,413],{"class":329}," (",[299,415,287],{"class":392},[299,417,418],{"class":329}," $",[299,420,421],{"class":377},"exception",[299,423,424],{"class":329},")",[299,426,368],{"class":329},[299,428,430,434,436,438,440,443],{"class":301,"line":429},7,[299,431,433],{"class":432},"sptTA","    echo",[299,435,418],{"class":329},[299,437,421],{"class":377},[299,439,382],{"class":381},[299,441,442],{"class":385},"getMessage",[299,444,445],{"class":329},"();\n",[299,447,449],{"class":301,"line":448},8,[299,450,451],{"class":329},"}\n",[290,453,458],{"className":454,"code":456,"language":457,"meta":295},[455],"language-text","3 features cannot be written for this version:\n- \u002Finfo\u002Fsummary: summary needs 3.1.0\n- \u002Fwebhooks: webhooks needs 3.1.0\n- \u002Ftags\u002F1\u002Fparent: parent needs 3.2.0\n","text",[273,459,456],{"__ignoreMap":295},[262,461,462,465,466,471],{},[273,463,464],{},"$exception->diagnostics()"," returns the same list as ",[467,468,470],"a",{"href":469},"#diagnostics","diagnostics",". Fix it by removing the features,\ntargeting a newer version, or switching to the lenient mode.",[266,473,475],{"id":474},"lenient-mode","Lenient mode",[262,477,478,479,482,483,486],{},"The ",[273,480,481],{},"Serializer"," with ",[273,484,485],{},"Strictness::Lenient"," writes what it can and reports the rest:",[290,488,490],{"className":292,"code":489,"language":294,"meta":295,"style":295},"use Ark4ne\\OpenApiWriter\\Enums\\Strictness;\nuse Ark4ne\\OpenApiWriter\\Serialization\\Serializer;\n\n$result = Serializer::for(Version::V3_0_4, Strictness::Lenient)\n    ->serialize($document);\n\n$json = $result->toJson(JSON_PRETTY_PRINT);\n\nforeach ($result->diagnostics() as $diagnostic) {\n    echo $diagnostic, \"\\n\";\n}\n",[273,491,492,513,534,538,579,594,598,623,627,657,679],{"__ignoreMap":295},[299,493,494,496,498,500,502,504,506,508,511],{"class":301,"line":302},[299,495,306],{"class":305},[299,497,310],{"class":309},[299,499,314],{"class":313},[299,501,317],{"class":309},[299,503,314],{"class":313},[299,505,237],{"class":309},[299,507,314],{"class":313},[299,509,510],{"class":309},"Strictness",[299,512,330],{"class":329},[299,514,515,517,519,521,523,525,528,530,532],{"class":301,"line":333},[299,516,306],{"class":305},[299,518,310],{"class":309},[299,520,314],{"class":313},[299,522,317],{"class":309},[299,524,314],{"class":313},[299,526,527],{"class":309},"Serialization",[299,529,314],{"class":313},[299,531,481],{"class":309},[299,533,330],{"class":329},[299,535,536],{"class":301,"line":354},[299,537,358],{"emptyLinePlaceholder":357},[299,539,540,543,546,549,552,554,557,559,561,563,565,568,571,573,576],{"class":301,"line":361},[299,541,542],{"class":329},"$",[299,544,545],{"class":377},"result ",[299,547,548],{"class":381},"=",[299,550,551],{"class":392}," Serializer",[299,553,395],{"class":381},[299,555,556],{"class":385},"for",[299,558,389],{"class":329},[299,560,326],{"class":392},[299,562,395],{"class":381},[299,564,398],{"class":309},[299,566,567],{"class":329},",",[299,569,570],{"class":392}," Strictness",[299,572,395],{"class":381},[299,574,575],{"class":309},"Lenient",[299,577,578],{"class":329},")\n",[299,580,581,584,587,590,592],{"class":301,"line":371},[299,582,583],{"class":381},"    ->",[299,585,586],{"class":385},"serialize",[299,588,589],{"class":329},"($",[299,591,378],{"class":377},[299,593,401],{"class":329},[299,595,596],{"class":301,"line":404},[299,597,358],{"emptyLinePlaceholder":357},[299,599,600,602,605,607,609,612,614,616,618,621],{"class":301,"line":429},[299,601,542],{"class":329},[299,603,604],{"class":377},"json ",[299,606,548],{"class":381},[299,608,418],{"class":329},[299,610,611],{"class":377},"result",[299,613,382],{"class":381},[299,615,386],{"class":385},[299,617,389],{"class":329},[299,619,620],{"class":309},"JSON_PRETTY_PRINT",[299,622,401],{"class":329},[299,624,625],{"class":301,"line":448},[299,626,358],{"emptyLinePlaceholder":357},[299,628,630,633,636,638,640,642,645,648,650,653,655],{"class":301,"line":629},9,[299,631,632],{"class":364},"foreach",[299,634,635],{"class":329}," ($",[299,637,611],{"class":377},[299,639,382],{"class":381},[299,641,470],{"class":385},[299,643,644],{"class":329},"()",[299,646,647],{"class":381}," as",[299,649,418],{"class":329},[299,651,652],{"class":377},"diagnostic",[299,654,424],{"class":329},[299,656,368],{"class":329},[299,658,659,661,663,665,667,671,674,677],{"class":301,"line":29},[299,660,433],{"class":432},[299,662,418],{"class":329},[299,664,652],{"class":377},[299,666,567],{"class":329},[299,668,670],{"class":669},"sjJ54"," \"",[299,672,673],{"class":309},"\\n",[299,675,676],{"class":669},"\"",[299,678,330],{"class":329},[299,680,682],{"class":301,"line":681},11,[299,683,451],{"class":329},[290,685,688],{"className":686,"code":687,"language":457,"meta":295},[455],"[dropped] \u002Finfo\u002Fsummary: summary needs 3.1.0\n[dropped] \u002Fwebhooks: webhooks needs 3.1.0\n[converted] \u002Fcomponents\u002Fschemas\u002FOrder\u002Fproperties\u002Fnote: nullable written as nullable: true\n[dropped] \u002Ftags\u002F1\u002Fparent: parent needs 3.2.0\n",[273,689,687],{"__ignoreMap":295},[262,691,692,695,696,699],{},[273,693,694],{},"Serializer::for()"," also takes the strings: ",[273,697,698],{},"Serializer::for('3.0.4', 'lenient')",".",[266,701,702],{"id":470},"Diagnostics",[262,704,705,707],{},[273,706,702],{}," is iterable and countable:",[709,710,711,724],"table",{},[712,713,714],"thead",{},[715,716,717,721],"tr",{},[718,719,720],"th",{},"Method",[718,722,723],{},"Returns",[725,726,727,741,751],"tbody",{},[715,728,729,735],{},[730,731,732],"td",{},[273,733,734],{},"all()",[730,736,737,738],{},"every ",[273,739,740],{},"Diagnostic",[715,742,743,748],{},[730,744,745],{},[273,746,747],{},"ofLevel(DiagnosticLevel $level)",[730,749,750],{},"the diagnostics of one level",[715,752,753,758],{},[730,754,755],{},[273,756,757],{},"isEmpty()",[730,759,760],{},"whether there is none",[262,762,763,764,766],{},"Each ",[273,765,740],{}," has three public properties, and casts to the one-line string shown above:",[709,768,769,779],{},[712,770,771],{},[715,772,773,776],{},[718,774,775],{},"Property",[718,777,778],{},"Content",[725,780,781,800,817],{},[715,782,783,788],{},[730,784,785],{},[273,786,787],{},"level",[730,789,790,276,793,796,797],{},[273,791,792],{},"DiagnosticLevel::Converted",[273,794,795],{},"Dropped"," or ",[273,798,799],{},"Unsupported",[715,801,802,807],{},[730,803,804],{},[273,805,806],{},"pointer",[730,808,809,810,813,814],{},"where, as a ",[273,811,812],{},"JsonPointer",": ",[273,815,816],{},"\u002Fcomponents\u002Fschemas\u002FOrder\u002Fproperties\u002Fnote",[715,818,819,824],{},[730,820,821],{},[273,822,823],{},"message",[730,825,826,827],{},"what: ",[273,828,829],{},"nullable written as nullable: true",[262,831,832,835,836,838,839,841],{},[273,833,834],{},"Converted"," is informative: the meaning is kept in another form. ",[273,837,795],{}," means the output lost something.\n",[273,840,799],{}," appears only in the exception of the strict mode.",[290,843,845],{"className":292,"code":844,"language":294,"meta":295,"style":295},"use Ark4ne\\OpenApiWriter\\Serialization\\DiagnosticLevel;\n\n$lost = $result->diagnostics()->ofLevel(DiagnosticLevel::Dropped);\n\nif ($lost !== []) {\n    \u002F\u002F log them, or fail the build\n}\n",[273,846,847,868,872,906,910,927,933],{"__ignoreMap":295},[299,848,849,851,853,855,857,859,861,863,866],{"class":301,"line":302},[299,850,306],{"class":305},[299,852,310],{"class":309},[299,854,314],{"class":313},[299,856,317],{"class":309},[299,858,314],{"class":313},[299,860,527],{"class":309},[299,862,314],{"class":313},[299,864,865],{"class":309},"DiagnosticLevel",[299,867,330],{"class":329},[299,869,870],{"class":301,"line":333},[299,871,358],{"emptyLinePlaceholder":357},[299,873,874,876,879,881,883,885,887,889,891,893,896,898,900,902,904],{"class":301,"line":354},[299,875,542],{"class":329},[299,877,878],{"class":377},"lost ",[299,880,548],{"class":381},[299,882,418],{"class":329},[299,884,611],{"class":377},[299,886,382],{"class":381},[299,888,470],{"class":385},[299,890,644],{"class":329},[299,892,382],{"class":381},[299,894,895],{"class":385},"ofLevel",[299,897,389],{"class":329},[299,899,865],{"class":392},[299,901,395],{"class":381},[299,903,795],{"class":309},[299,905,401],{"class":329},[299,907,908],{"class":301,"line":361},[299,909,358],{"emptyLinePlaceholder":357},[299,911,912,915,917,919,922,925],{"class":301,"line":371},[299,913,914],{"class":364},"if",[299,916,635],{"class":329},[299,918,878],{"class":377},[299,920,921],{"class":381},"!==",[299,923,924],{"class":329}," [])",[299,926,368],{"class":329},[299,928,929],{"class":301,"line":404},[299,930,932],{"class":931},"sutJx","    \u002F\u002F log them, or fail the build\n",[299,934,935],{"class":301,"line":429},[299,936,451],{"class":329},[266,938,940],{"id":939},"the-validator-is-lenient","The validator is lenient",[262,942,478,943,946],{},[467,944,945],{"href":220},"validator"," writes the document in lenient mode: what the version\ncannot express is reported as an error instead of thrown. When there is any, the validator returns these errors alone,\nbefore checking the schema and the rules.",[948,949,950],"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 .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .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 .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .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}",{"title":295,"searchDepth":354,"depth":354,"links":952},[953,954,955,956],{"id":268,"depth":333,"text":269},{"id":474,"depth":333,"text":475},{"id":470,"depth":333,"text":702},{"id":939,"depth":333,"text":940},"Fail on what the target version cannot express, or drop it and read the diagnostics.","md",{},"---\ntitle: Strict and lenient\ndescription: Fail on what the target version cannot express, or drop it and read the diagnostics.\n---\n\nWhen a document uses a feature the target version cannot express, the library either throws (strict mode, the\ndefault) or drops the feature and reports it (lenient mode). Both list every problem at once, each with the JSON Pointer\nof its place in the document.\n\n## Strict mode\n\n`toJson()`, `toYaml()` and `toArray()` are strict. One `UnsupportedFeatureException` lists every unsupported feature:\n\n```php\nuse Ark4ne\\OpenApiWriter\\Enums\\Version;\nuse Ark4ne\\OpenApiWriter\\Exceptions\\UnsupportedFeatureException;\n\ntry {\n    $document->toJson(Version::V3_0_4);\n} catch (UnsupportedFeatureException $exception) {\n    echo $exception->getMessage();\n}\n```\n\n```text\n3 features cannot be written for this version:\n- \u002Finfo\u002Fsummary: summary needs 3.1.0\n- \u002Fwebhooks: webhooks needs 3.1.0\n- \u002Ftags\u002F1\u002Fparent: parent needs 3.2.0\n```\n\n`$exception->diagnostics()` returns the same list as [diagnostics](#diagnostics). Fix it by removing the features,\ntargeting a newer version, or switching to the lenient mode.\n\n## Lenient mode\n\nThe `Serializer` with `Strictness::Lenient` writes what it can and reports the rest:\n\n```php\nuse Ark4ne\\OpenApiWriter\\Enums\\Strictness;\nuse Ark4ne\\OpenApiWriter\\Serialization\\Serializer;\n\n$result = Serializer::for(Version::V3_0_4, Strictness::Lenient)\n    ->serialize($document);\n\n$json = $result->toJson(JSON_PRETTY_PRINT);\n\nforeach ($result->diagnostics() as $diagnostic) {\n    echo $diagnostic, \"\\n\";\n}\n```\n\n```text\n[dropped] \u002Finfo\u002Fsummary: summary needs 3.1.0\n[dropped] \u002Fwebhooks: webhooks needs 3.1.0\n[converted] \u002Fcomponents\u002Fschemas\u002FOrder\u002Fproperties\u002Fnote: nullable written as nullable: true\n[dropped] \u002Ftags\u002F1\u002Fparent: parent needs 3.2.0\n```\n\n`Serializer::for()` also takes the strings: `Serializer::for('3.0.4', 'lenient')`.\n\n## Diagnostics\n\n`Diagnostics` is iterable and countable:\n\n| Method | Returns |\n| --- | --- |\n| `all()` | every `Diagnostic` |\n| `ofLevel(DiagnosticLevel $level)` | the diagnostics of one level |\n| `isEmpty()` | whether there is none |\n\nEach `Diagnostic` has three public properties, and casts to the one-line string shown above:\n\n| Property | Content |\n| --- | --- |\n| `level` | `DiagnosticLevel::Converted`, `Dropped` or `Unsupported` |\n| `pointer` | where, as a `JsonPointer`: `\u002Fcomponents\u002Fschemas\u002FOrder\u002Fproperties\u002Fnote` |\n| `message` | what: `nullable written as nullable: true` |\n\n`Converted` is informative: the meaning is kept in another form. `Dropped` means the output lost something.\n`Unsupported` appears only in the exception of the strict mode.\n\n```php\nuse Ark4ne\\OpenApiWriter\\Serialization\\DiagnosticLevel;\n\n$lost = $result->diagnostics()->ofLevel(DiagnosticLevel::Dropped);\n\nif ($lost !== []) {\n    \u002F\u002F log them, or fail the build\n}\n```\n\n## The validator is lenient\n\nThe [validator](\u002Fopenapi-writer\u002Fvalidation\u002Fvalidating-a-document) writes the document in lenient mode: what the version\ncannot express is reported as an error instead of thrown. When there is any, the validator returns these errors alone,\nbefore checking the schema and the rules.\n",{"title":201,"description":957},"0g0uv3-5Cx7iSn-Dj2rGO_Bb03x7rv4_-uN_130nO6Y",[964,966],{"title":197,"path":198,"stem":199,"description":965,"children":-1},"What the library rewrites for OpenAPI 3.0, and what each version cannot express.",{"title":205,"path":206,"stem":207,"description":967,"children":-1},"The QUERY method, other HTTP methods, streams, tag hierarchies and the other 3.2 additions.",1795438901046]