diff --git a/assets/app.850f5e05.js b/assets/app.850f5e05.js new file mode 100644 index 00000000..64042387 --- /dev/null +++ b/assets/app.850f5e05.js @@ -0,0 +1,32 @@ +const co="modulepreload",js={},uo="/swagger-php/",fo=function(t,n){return!n||n.length===0?t():Promise.all(n.map(s=>{if(s=`${uo}${s}`,s in js)return;js[s]=!0;const r=s.endsWith(".css"),i=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${i}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":co,r||(o.as="script",o.crossOrigin=""),o.href=s,document.head.appendChild(o),r)return new Promise((l,a)=>{o.addEventListener("load",l),o.addEventListener("error",()=>a(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t())};/** +* @vue/shared v3.4.31 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function Pt(e,t){const n=new Set(e.split(","));return t?s=>n.has(s.toLowerCase()):s=>n.has(s)}const te={},Ct=[],Ee=()=>{},ho=()=>!1,Xt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),us=e=>e.startsWith("onUpdate:"),pe=Object.assign,fs=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},po=Object.prototype.hasOwnProperty,Y=(e,t)=>po.call(e,t),D=Array.isArray,kt=e=>In(e)==="[object Map]",Hr=e=>In(e)==="[object Set]",U=e=>typeof e=="function",le=e=>typeof e=="string",lt=e=>typeof e=="symbol",ne=e=>e!==null&&typeof e=="object",Mr=e=>(ne(e)||U(e))&&U(e.then)&&U(e.catch),Dr=Object.prototype.toString,In=e=>Dr.call(e),_o=e=>In(e).slice(8,-1),Nr=e=>In(e)==="[object Object]",ds=e=>le(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,St=Pt(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),En=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},go=/-(\w)/g,Ke=En(e=>e.replace(go,(t,n)=>n?n.toUpperCase():"")),mo=/\B([A-Z])/g,vt=En(e=>e.replace(mo,"-$1").toLowerCase()),Ln=En(e=>e.charAt(0).toUpperCase()+e.slice(1)),Wn=En(e=>e?`on${Ln(e)}`:""),ot=(e,t)=>!Object.is(e,t),Kn=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},vo=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Bs;const hs=()=>Bs||(Bs=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});function Pn(e){if(D(e)){const t={};for(let n=0;n{if(n){const s=n.split(yo);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Co(e){let t="";if(!e||le(e))return t;for(const n in e){const s=e[n];(le(s)||typeof s=="number")&&(t+=`${n.startsWith("--")?n:vt(n)}:${s};`)}return t}function Se(e){let t="";if(le(e))t=e;else if(D(e))for(let n=0;n!!(e&&e.__v_isRef===!0),me=e=>le(e)?e:e==null?"":D(e)||ne(e)&&(e.toString===Dr||!U(e.toString))?jr(e)?me(e.value):JSON.stringify(e,Br,2):String(e),Br=(e,t)=>jr(t)?Br(e,t.value):kt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[qn(s,i)+" =>"]=r,n),{})}:Hr(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>qn(n))}:lt(t)?qn(t):ne(t)&&!D(t)&&!Nr(t)?String(t):t,qn=(e,t="")=>{var n;return lt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.4.31 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let He;class Ao{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=He,!t&&He&&(this.index=(He.scopes||(He.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=He;try{return He=this,t()}finally{He=n}}}on(){He=this}off(){He=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),Ze()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=it,n=ht;try{return it=!0,ht=this,this._runnings++,Ws(this),this.fn()}finally{Ks(this),this._runnings--,ht=n,it=t}}stop(){this.active&&(Ws(this),Ks(this),this.onStop&&this.onStop(),this.active=!1)}}function Lo(e){return e.value}function Ws(e){e._trackId++,e._depsLength=0}function Ks(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},mn=new WeakMap,pt=Symbol(""),ns=Symbol("");function Ae(e,t,n){if(it&&ht){let s=mn.get(e);s||mn.set(e,s=new Map);let r=s.get(n);r||s.set(n,r=zr(()=>s.delete(n))),Kr(ht,r)}}function Ye(e,t,n,s,r,i){const o=mn.get(e);if(!o)return;let l=[];if(t==="clear")l=[...o.values()];else if(n==="length"&&D(e)){const a=Number(s);o.forEach((u,d)=>{(d==="length"||!lt(d)&&d>=a)&&l.push(u)})}else switch(n!==void 0&&l.push(o.get(n)),t){case"add":D(e)?ds(n)&&l.push(o.get("length")):(l.push(o.get(pt)),kt(e)&&l.push(o.get(ns)));break;case"delete":D(e)||(l.push(o.get(pt)),kt(e)&&l.push(o.get(ns)));break;case"set":kt(e)&&l.push(o.get(pt));break}gs();for(const a of l)a&&qr(a,4);ms()}function Po(e,t){const n=mn.get(e);return n&&n.get(t)}const Ro=Pt("__proto__,__v_isRef,__isVue"),Yr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(lt)),qs=Oo();function Oo(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=G(this);for(let i=0,o=this.length;i{e[t]=function(...n){Xe(),gs();const s=G(this)[t].apply(this,n);return ms(),Ze(),s}}),e}function Ho(e){lt(e)||(e=String(e));const t=G(this);return Ae(t,"has",e),t.hasOwnProperty(e)}class Gr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Yo:Qr:i?Zr:Xr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=D(t);if(!r){if(o&&Y(qs,n))return Reflect.get(qs,n,s);if(n==="hasOwnProperty")return Ho}const l=Reflect.get(t,n,s);return(lt(n)?Yr.has(n):Ro(n))||(r||Ae(t,"get",n),i)?l:we(l)?o&&ds(n)?l:l.value:ne(l)?r?ei(l):Rt(l):l}}class Jr extends Gr{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];if(!this._isShallow){const a=qt(i);if(!vn(s)&&!qt(s)&&(i=G(i),s=G(s)),!D(t)&&we(i)&&!we(s))return a?!1:(i.value=s,!0)}const o=D(t)&&ds(n)?Number(n)e,Rn=e=>Reflect.getPrototypeOf(e);function sn(e,t,n=!1,s=!1){e=e.__v_raw;const r=G(e),i=G(t);n||(ot(t,i)&&Ae(r,"get",t),Ae(r,"get",i));const{has:o}=Rn(r),l=s?vs:n?xs:zt;if(o.call(r,t))return l(e.get(t));if(o.call(r,i))return l(e.get(i));e!==r&&e.get(t)}function rn(e,t=!1){const n=this.__v_raw,s=G(n),r=G(e);return t||(ot(e,r)&&Ae(s,"has",e),Ae(s,"has",r)),e===r?n.has(e):n.has(e)||n.has(r)}function on(e,t=!1){return e=e.__v_raw,!t&&Ae(G(e),"iterate",pt),Reflect.get(e,"size",e)}function zs(e){e=G(e);const t=G(this);return Rn(t).has.call(t,e)||(t.add(e),Ye(t,"add",e,e)),this}function Ys(e,t){t=G(t);const n=G(this),{has:s,get:r}=Rn(n);let i=s.call(n,e);i||(e=G(e),i=s.call(n,e));const o=r.call(n,e);return n.set(e,t),i?ot(t,o)&&Ye(n,"set",e,t):Ye(n,"add",e,t),this}function Gs(e){const t=G(this),{has:n,get:s}=Rn(t);let r=n.call(t,e);r||(e=G(e),r=n.call(t,e)),s&&s.call(t,e);const i=t.delete(e);return r&&Ye(t,"delete",e,void 0),i}function Js(){const e=G(this),t=e.size!==0,n=e.clear();return t&&Ye(e,"clear",void 0,void 0),n}function ln(e,t){return function(s,r){const i=this,o=i.__v_raw,l=G(o),a=t?vs:e?xs:zt;return!e&&Ae(l,"iterate",pt),o.forEach((u,d)=>s.call(r,a(u),a(d),i))}}function an(e,t,n){return function(...s){const r=this.__v_raw,i=G(r),o=kt(i),l=e==="entries"||e===Symbol.iterator&&o,a=e==="keys"&&o,u=r[e](...s),d=n?vs:t?xs:zt;return!t&&Ae(i,"iterate",a?ns:pt),{next(){const{value:_,done:b}=u.next();return b?{value:_,done:b}:{value:l?[d(_[0]),d(_[1])]:d(_),done:b}},[Symbol.iterator](){return this}}}}function et(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Uo(){const e={get(i){return sn(this,i)},get size(){return on(this)},has:rn,add:zs,set:Ys,delete:Gs,clear:Js,forEach:ln(!1,!1)},t={get(i){return sn(this,i,!1,!0)},get size(){return on(this)},has:rn,add:zs,set:Ys,delete:Gs,clear:Js,forEach:ln(!1,!0)},n={get(i){return sn(this,i,!0)},get size(){return on(this,!0)},has(i){return rn.call(this,i,!0)},add:et("add"),set:et("set"),delete:et("delete"),clear:et("clear"),forEach:ln(!0,!1)},s={get(i){return sn(this,i,!0,!0)},get size(){return on(this,!0)},has(i){return rn.call(this,i,!0)},add:et("add"),set:et("set"),delete:et("delete"),clear:et("clear"),forEach:ln(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=an(i,!1,!1),n[i]=an(i,!0,!1),t[i]=an(i,!1,!0),s[i]=an(i,!0,!0)}),[e,n,t,s]}const[jo,Bo,Vo,Wo]=Uo();function bs(e,t){const n=t?e?Wo:Vo:e?Bo:jo;return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Y(n,r)&&r in s?n:s,r,i)}const Ko={get:bs(!1,!1)},qo={get:bs(!1,!0)},zo={get:bs(!0,!1)};const Xr=new WeakMap,Zr=new WeakMap,Qr=new WeakMap,Yo=new WeakMap;function Go(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Jo(e){return e.__v_skip||!Object.isExtensible(e)?0:Go(_o(e))}function Rt(e){return qt(e)?e:ys(e,!1,Do,Ko,Xr)}function Xo(e){return ys(e,!1,Fo,qo,Zr)}function ei(e){return ys(e,!0,No,zo,Qr)}function ys(e,t,n,s,r){if(!ne(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=Jo(e);if(o===0)return e;const l=new Proxy(e,o===2?s:n);return r.set(e,l),l}function Ut(e){return qt(e)?Ut(e.__v_raw):!!(e&&e.__v_isReactive)}function qt(e){return!!(e&&e.__v_isReadonly)}function vn(e){return!!(e&&e.__v_isShallow)}function ti(e){return e?!!e.__v_raw:!1}function G(e){const t=e&&e.__v_raw;return t?G(t):e}function hn(e){return Object.isExtensible(e)&&Fr(e,"__v_skip",!0),e}const zt=e=>ne(e)?Rt(e):e,xs=e=>ne(e)?ei(e):e;class ni{constructor(t,n,s,r){this.getter=t,this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new _s(()=>t(this._value),()=>pn(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=s}get value(){const t=G(this);return(!t._cacheable||t.effect.dirty)&&ot(t._value,t._value=t.effect.run())&&pn(t,4),si(t),t.effect._dirtyLevel>=2&&pn(t,2),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function Zo(e,t,n=!1){let s,r;const i=U(e);return i?(s=e,r=Ee):(s=e.get,r=e.set),new ni(s,r,i||!r,n)}function si(e){var t;it&&ht&&(e=G(e),Kr(ht,(t=e.dep)!=null?t:e.dep=zr(()=>e.dep=void 0,e instanceof ni?e:void 0)))}function pn(e,t=4,n,s){e=G(e);const r=e.dep;r&&qr(r,t)}function we(e){return!!(e&&e.__v_isRef===!0)}function gt(e){return ri(e,!1)}function Qo(e){return ri(e,!0)}function ri(e,t){return we(e)?e:new el(e,t)}class el{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:G(t),this._value=n?t:zt(t)}get value(){return si(this),this._value}set value(t){const n=this.__v_isShallow||vn(t)||qt(t);t=n?t:G(t),ot(t,this._rawValue)&&(this._rawValue,this._rawValue=t,this._value=n?t:zt(t),pn(this,4))}}function $(e){return we(e)?e.value:e}const tl={get:(e,t,n)=>$(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return we(r)&&!we(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function ii(e){return Ut(e)?e:new Proxy(e,tl)}function ws(e){const t=D(e)?new Array(e.length):{};for(const n in e)t[n]=sl(e,n);return t}class nl{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Po(G(this._object),this._key)}}function sl(e,t,n){const s=e[t];return we(s)?s:new nl(e,t,n)}/** +* @vue/runtime-core v3.4.31 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const jt=[];function tt(e,...t){Xe();const n=jt.length?jt[jt.length-1].component:null,s=n&&n.appContext.config.warnHandler,r=rl();if(s)Ge(s,n,11,[e+t.map(i=>{var o,l;return(l=(o=i.toString)==null?void 0:o.call(i))!=null?l:JSON.stringify(i)}).join(""),n&&n.proxy,r.map(({vnode:i})=>`at <${Bi(n,i.type)}>`).join(` +`),r]);else{const i=[`[Vue warn]: ${e}`,...t];r.length&&i.push(` +`,...il(r)),console.warn(...i)}Ze()}function rl(){let e=jt[jt.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const s=e.component&&e.component.parent;e=s&&s.vnode}return t}function il(e){const t=[];return e.forEach((n,s)=>{t.push(...s===0?[]:[` +`],...ol(n))}),t}function ol({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",s=e.component?e.component.parent==null:!1,r=` at <${Bi(e.component,e.type,s)}`,i=">"+n;return e.props?[r,...ll(e.props),i]:[r+i]}function ll(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(s=>{t.push(...oi(s,e[s]))}),n.length>3&&t.push(" ..."),t}function oi(e,t,n){return le(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:we(t)?(t=oi(e,G(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):U(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=G(t),n?t:[`${e}=`,t])}function Ge(e,t,n,s){try{return s?e(...s):e()}catch(r){On(r,t,n)}}function Fe(e,t,n,s){if(U(e)){const r=Ge(e,t,n,s);return r&&Mr(r)&&r.catch(i=>{On(i,t,n)}),r}if(D(e)){const r=[];for(let i=0;i>>1,r=ye[s],i=Gt(r);iVe&&ye.splice(t,1)}function fl(e){D(e)?Tt.push(...e):(!nt||!nt.includes(e,e.allowRecurse?dt+1:dt))&&Tt.push(e),ci()}function Xs(e,t,n=Yt?Ve+1:0){for(;nGt(n)-Gt(s));if(Tt.length=0,nt){nt.push(...t);return}for(nt=t,dt=0;dte.id==null?1/0:e.id,dl=(e,t)=>{const n=Gt(e)-Gt(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function ui(e){ss=!1,Yt=!0,ye.sort(dl);const t=Ee;try{for(Ve=0;Vele(T)?T.trim():T)),_&&(r=n.map(vo))}let l,a=s[l=Wn(t)]||s[l=Wn(Ke(t))];!a&&i&&(a=s[l=Wn(vt(t))]),a&&Fe(a,e,6,r);const u=s[l+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Fe(u,e,6,r)}}function fi(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!U(e)){const a=u=>{const d=fi(u,t,!0);d&&(l=!0,pe(o,d))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(ne(e)&&s.set(e,null),null):(D(i)?i.forEach(a=>o[a]=null):pe(o,i),ne(e)&&s.set(e,o),o)}function Hn(e,t){return!e||!Xt(t)?!1:(t=t.slice(2).replace(/Once$/,""),Y(e,t[0].toLowerCase()+t.slice(1))||Y(e,vt(t))||Y(e,t))}let ge=null,Mn=null;function yn(e){const t=ge;return ge=e,Mn=e&&e.type.__scopeId||null,t}function Ss(e){Mn=e}function Ts(){Mn=null}function Re(e,t=ge,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&dr(-1);const i=yn(t);let o;try{o=e(...r)}finally{yn(i),s._d&&dr(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function zn(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:a,render:u,renderCache:d,props:_,data:b,setupState:T,ctx:F,inheritAttrs:V}=e,ue=yn(e);let re,ae;try{if(n.shapeFlag&4){const y=r||s,R=y;re=Me(u.call(R,y,d,_,T,b,F)),ae=l}else{const y=t;re=Me(y.length>1?y(_,{attrs:l,slots:o,emit:a}):y(_,null)),ae=t.props?l:pl(l)}}catch(y){Kt.length=0,On(y,e,1),re=j(Je)}let h=re;if(ae&&V!==!1){const y=Object.keys(ae),{shapeFlag:R}=h;y.length&&R&7&&(i&&y.some(us)&&(ae=_l(ae,i)),h=Et(h,ae,!1,!0))}return n.dirs&&(h=Et(h,null,!1,!0),h.dirs=h.dirs?h.dirs.concat(n.dirs):n.dirs),n.transition&&(h.transition=n.transition),re=h,yn(ue),re}const pl=e=>{let t;for(const n in e)(n==="class"||n==="style"||Xt(n))&&((t||(t={}))[n]=e[n]);return t},_l=(e,t)=>{const n={};for(const s in e)(!us(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function gl(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Zs(s,o,u):!!o;if(a&8){const d=t.dynamicProps;for(let _=0;_e.__isSuspense;function hi(e,t){t&&t.pendingBranch?D(e)?t.effects.push(...e):t.effects.push(e):fl(e)}function Dn(e,t,n=xe,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Xe();const l=en(n),a=Fe(t,n,e,o);return l(),Ze(),a});return s?r.unshift(i):r.push(i),i}}const Qe=e=>(t,n=xe)=>{(!Fn||e==="sp")&&Dn(e,(...s)=>t(...s),n)},pi=Qe("bm"),bt=Qe("m"),xl=Qe("bu"),_i=Qe("u"),gi=Qe("bum"),Nn=Qe("um"),wl=Qe("sp"),Cl=Qe("rtg"),kl=Qe("rtc");function Sl(e,t=xe){Dn("ec",e,t)}function Tl(e,t){if(ge===null)return e;const n=Un(ge),s=e.dirs||(e.dirs=[]);for(let r=0;rt(o,l,void 0,i&&i[l]));else{const o=Object.keys(e);r=new Array(o.length);for(let l=0,a=o.length;lpe({name:e.name},t,{setup:e}))():e}const $t=e=>!!e.type.__asyncLoader;function oe(e,t,n={},s,r){if(ge.isCE||ge.parent&&$t(ge.parent)&&ge.parent.isCE)return t!=="default"&&(n.name=t),j("slot",n,s&&s());let i=e[t];i&&i._c&&(i._d=!1),A();const o=i&&mi(i(n)),l=be(de,{key:n.key||o&&o.key||`_${t}`},o||(s?s():[]),o&&e._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),i&&i._c&&(i._d=!0),l}function mi(e){return e.some(t=>Cn(t)?!(t.type===Je||t.type===de&&!mi(t.children)):!0)?e:null}const rs=e=>e?Fi(e)?Un(e):rs(e.parent):null,Bt=pe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>rs(e.parent),$root:e=>rs(e.root),$emit:e=>e.emit,$options:e=>$s(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,ks(e.update)}),$nextTick:e=>e.n||(e.n=ai.bind(e.proxy)),$watch:e=>Zl.bind(e)}),Yn=(e,t)=>e!==te&&!e.__isScriptSetup&&Y(e,t),$l={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:a}=e;let u;if(t[0]!=="$"){const T=o[t];if(T!==void 0)switch(T){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(Yn(s,t))return o[t]=1,s[t];if(r!==te&&Y(r,t))return o[t]=2,r[t];if((u=e.propsOptions[0])&&Y(u,t))return o[t]=3,i[t];if(n!==te&&Y(n,t))return o[t]=4,n[t];is&&(o[t]=0)}}const d=Bt[t];let _,b;if(d)return t==="$attrs"&&Ae(e.attrs,"get",""),d(e);if((_=l.__cssModules)&&(_=_[t]))return _;if(n!==te&&Y(n,t))return o[t]=4,n[t];if(b=a.config.globalProperties,Y(b,t))return b[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return Yn(r,t)?(r[t]=n,!0):s!==te&&Y(s,t)?(s[t]=n,!0):Y(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let l;return!!n[o]||e!==te&&Y(e,o)||Yn(t,o)||(l=i[0])&&Y(l,o)||Y(s,o)||Y(Bt,o)||Y(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Y(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function er(e){return D(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let is=!0;function Al(e){const t=$s(e),n=e.proxy,s=e.ctx;is=!1,t.beforeCreate&&tr(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:a,inject:u,created:d,beforeMount:_,mounted:b,beforeUpdate:T,updated:F,activated:V,deactivated:ue,beforeDestroy:re,beforeUnmount:ae,destroyed:h,unmounted:y,render:R,renderTracked:I,renderTriggered:q,errorCaptured:J,serverPrefetch:Q,expose:B,inheritAttrs:ie,components:_e,directives:ce,filters:Ce}=t;if(u&&Il(u,s,null),o)for(const z in o){const E=o[z];U(E)&&(s[z]=E.bind(n))}if(r){const z=r.call(n,n);ne(z)&&(e.data=Rt(z))}if(is=!0,i)for(const z in i){const E=i[z],Le=U(E)?E.bind(n,n):U(E.get)?E.get.bind(n,n):Ee,yt=!U(E)&&U(E.set)?E.set.bind(n):Ee,ct=K({get:Le,set:yt});Object.defineProperty(s,z,{enumerable:!0,configurable:!0,get:()=>ct.value,set:Ue=>ct.value=Ue})}if(l)for(const z in l)vi(l[z],s,n,z);if(a){const z=U(a)?a.call(n):a;Reflect.ownKeys(z).forEach(E=>{Ft(E,z[E])})}d&&tr(d,e,"c");function O(z,E){D(E)?E.forEach(Le=>z(Le.bind(n))):E&&z(E.bind(n))}if(O(pi,_),O(bt,b),O(xl,T),O(_i,F),O(Ql,V),O(ea,ue),O(Sl,J),O(kl,I),O(Cl,q),O(gi,ae),O(Nn,y),O(wl,Q),D(B))if(B.length){const z=e.exposed||(e.exposed={});B.forEach(E=>{Object.defineProperty(z,E,{get:()=>n[E],set:Le=>n[E]=Le})})}else e.exposed||(e.exposed={});R&&e.render===Ee&&(e.render=R),ie!=null&&(e.inheritAttrs=ie),_e&&(e.components=_e),ce&&(e.directives=ce)}function Il(e,t,n=Ee){D(e)&&(e=os(e));for(const s in e){const r=e[s];let i;ne(r)?"default"in r?i=_t(r.from||s,r.default,!0):i=_t(r.from||s):i=_t(r),we(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function tr(e,t,n){Fe(D(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function vi(e,t,n,s){const r=s.includes(".")?Ri(n,s):()=>n[s];if(le(e)){const i=t[e];U(i)&&We(r,i)}else if(U(e))We(r,e.bind(n));else if(ne(e))if(D(e))e.forEach(i=>vi(i,t,n,s));else{const i=U(e.handler)?e.handler.bind(n):t[e.handler];U(i)&&We(r,i,e)}}function $s(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let a;return l?a=l:!r.length&&!n&&!s?a=t:(a={},r.length&&r.forEach(u=>xn(a,u,o,!0)),xn(a,t,o)),ne(t)&&i.set(t,a),a}function xn(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&xn(e,i,n,!0),r&&r.forEach(o=>xn(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=El[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const El={data:nr,props:sr,emits:sr,methods:Nt,computed:Nt,beforeCreate:ke,created:ke,beforeMount:ke,mounted:ke,beforeUpdate:ke,updated:ke,beforeDestroy:ke,beforeUnmount:ke,destroyed:ke,unmounted:ke,activated:ke,deactivated:ke,errorCaptured:ke,serverPrefetch:ke,components:Nt,directives:Nt,watch:Pl,provide:nr,inject:Ll};function nr(e,t){return t?e?function(){return pe(U(e)?e.call(this,this):e,U(t)?t.call(this,this):t)}:t:e}function Ll(e,t){return Nt(os(e),os(t))}function os(e){if(D(e)){const t={};for(let n=0;n1)return n&&U(t)?t.call(s&&s.proxy):t}}const yi={},xi=()=>Object.create(yi),wi=e=>Object.getPrototypeOf(e)===yi;function Hl(e,t,n,s=!1){const r={},i=xi();e.propsDefaults=Object.create(null),Ci(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:Xo(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function Ml(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=G(r),[a]=e.propsOptions;let u=!1;if((s||o>0)&&!(o&16)){if(o&8){const d=e.vnode.dynamicProps;for(let _=0;_{a=!0;const[b,T]=ki(_,t,!0);pe(o,b),T&&l.push(...T)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!a)return ne(e)&&s.set(e,Ct),Ct;if(D(i))for(let d=0;d-1,T[1]=V<0||F-1||Y(T,"default"))&&l.push(_)}}}const u=[o,l];return ne(e)&&s.set(e,u),u}function rr(e){return e[0]!=="$"&&!St(e)}function ir(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function or(e,t){return ir(e)===ir(t)}function lr(e,t){return D(t)?t.findIndex(n=>or(n,e)):U(t)&&or(t,e)?0:-1}const Si=e=>e[0]==="_"||e==="$stable",As=e=>D(e)?e.map(Me):[Me(e)],Dl=(e,t,n)=>{if(t._n)return t;const s=Re((...r)=>As(t(...r)),n);return s._c=!1,s},Ti=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Si(r))continue;const i=e[r];if(U(i))t[r]=Dl(r,i,s);else if(i!=null){const o=As(i);t[r]=()=>o}}},$i=(e,t)=>{const n=As(t);e.slots.default=()=>n},Nl=(e,t)=>{const n=e.slots=xi();if(e.vnode.shapeFlag&32){const s=t._;s?(pe(n,t),Fr(n,"_",s,!0)):Ti(t,n)}else t&&$i(e,t)},Fl=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=te;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:(pe(r,t),!n&&l===1&&delete r._):(i=!t.$stable,Ti(t,r)),o=t}else t&&($i(e,t),o={default:1});if(i)for(const l in r)!Si(l)&&o[l]==null&&delete r[l]};function wn(e,t,n,s,r=!1){if(D(e)){e.forEach((b,T)=>wn(b,t&&(D(t)?t[T]:t),n,s,r));return}if($t(s)&&!r)return;const i=s.shapeFlag&4?Un(s.component):s.el,o=r?null:i,{i:l,r:a}=e,u=t&&t.r,d=l.refs===te?l.refs={}:l.refs,_=l.setupState;if(u!=null&&u!==a&&(le(u)?(d[u]=null,Y(_,u)&&(_[u]=null)):we(u)&&(u.value=null)),U(a))Ge(a,l,12,[o,d]);else{const b=le(a),T=we(a);if(b||T){const F=()=>{if(e.f){const V=b?Y(_,a)?_[a]:d[a]:a.value;r?D(V)&&fs(V,i):D(V)?V.includes(i)||V.push(i):b?(d[a]=[i],Y(_,a)&&(_[a]=d[a])):(a.value=[i],e.k&&(d[e.k]=a.value))}else b?(d[a]=o,Y(_,a)&&(_[a]=o)):T&&(a.value=o,e.k&&(d[e.k]=o))};o?(F.id=-1,$e(F,n)):F()}}}let ar=!1;const ut=()=>{ar||(console.error("Hydration completed but contains mismatches."),ar=!0)},Ul=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",jl=e=>e.namespaceURI.includes("MathML"),cn=e=>{if(Ul(e))return"svg";if(jl(e))return"mathml"},Ht=e=>e.nodeType===8;function Bl(e){const{mt:t,p:n,o:{patchProp:s,createText:r,nextSibling:i,parentNode:o,remove:l,insert:a,createComment:u}}=e,d=(h,y)=>{if(!y.hasChildNodes()){__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&tt("Attempting to hydrate existing markup but container is empty. Performing full mount instead."),n(null,h,y),bn(),y._vnode=h;return}_(y.firstChild,h,null,null,null),bn(),y._vnode=h},_=(h,y,R,I,q,J=!1)=>{J=J||!!y.dynamicChildren;const Q=Ht(h)&&h.data==="[",B=()=>V(h,y,R,I,q,Q),{type:ie,ref:_e,shapeFlag:ce,patchFlag:Ce}=y;let Te=h.nodeType;y.el=h,Ce===-2&&(J=!1,y.dynamicChildren=null);let O=null;switch(ie){case It:Te!==3?y.children===""?(a(y.el=r(""),o(h),h),O=h):O=B():(h.data!==y.children&&(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&tt("Hydration text mismatch in",h.parentNode,` + - rendered on server: ${JSON.stringify(h.data)} + - expected on client: ${JSON.stringify(y.children)}`),ut(),h.data=y.children),O=i(h));break;case Je:ae(h)?(O=i(h),re(y.el=h.content.firstChild,h,R)):Te!==8||Q?O=B():O=i(h);break;case Wt:if(Q&&(h=i(h),Te=h.nodeType),Te===1||Te===3){O=h;const z=!y.children.length;for(let E=0;E{J=J||!!y.dynamicChildren;const{type:Q,props:B,patchFlag:ie,shapeFlag:_e,dirs:ce,transition:Ce}=y,Te=Q==="input"||Q==="option";if(Te||ie!==-1){ce&&Be(y,null,R,"created");let O=!1;if(ae(h)){O=Ii(I,Ce)&&R&&R.vnode.props&&R.vnode.props.appear;const E=h.content.firstChild;O&&Ce.beforeEnter(E),re(E,h,R),y.el=h=E}if(_e&16&&!(B&&(B.innerHTML||B.textContent))){let E=T(h.firstChild,y,h,R,I,q,J),Le=!1;for(;E;){__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&!Le&&(tt("Hydration children mismatch on",h,` +Server rendered element contains more child nodes than client vdom.`),Le=!0),ut();const yt=E;E=E.nextSibling,l(yt)}}else _e&8&&h.textContent!==y.children&&(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&tt("Hydration text content mismatch on",h,` + - rendered on server: ${h.textContent} + - expected on client: ${y.children}`),ut(),h.textContent=y.children);if(B)if(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__||Te||!J||ie&48)for(const E in B)__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&!(ce&&ce.some(Le=>Le.dir.created))&&Vl(h,E,B[E],y,R)&&ut(),(Te&&(E.endsWith("value")||E==="indeterminate")||Xt(E)&&!St(E)||E[0]===".")&&s(h,E,null,B[E],void 0,void 0,R);else B.onClick&&s(h,"onClick",null,B.onClick,void 0,void 0,R);let z;(z=B&&B.onVnodeBeforeMount)&&Pe(z,R,y),ce&&Be(y,null,R,"beforeMount"),((z=B&&B.onVnodeMounted)||ce||O)&&hi(()=>{z&&Pe(z,R,y),O&&Ce.enter(h),ce&&Be(y,null,R,"mounted")},I)}return h.nextSibling},T=(h,y,R,I,q,J,Q)=>{Q=Q||!!y.dynamicChildren;const B=y.children,ie=B.length;let _e=!1;for(let ce=0;ce{const{slotScopeIds:Q}=y;Q&&(q=q?q.concat(Q):Q);const B=o(h),ie=T(i(h),y,B,R,I,q,J);return ie&&Ht(ie)&&ie.data==="]"?i(y.anchor=ie):(ut(),a(y.anchor=u("]"),B,ie),ie)},V=(h,y,R,I,q,J)=>{if(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&tt(`Hydration node mismatch: +- rendered on server:`,h,h.nodeType===3?"(text)":Ht(h)&&h.data==="["?"(start of fragment)":"",` +- expected on client:`,y.type),ut(),y.el=null,J){const ie=ue(h);for(;;){const _e=i(h);if(_e&&_e!==ie)l(_e);else break}}const Q=i(h),B=o(h);return l(h),n(null,y,B,Q,R,I,cn(B),q),Q},ue=(h,y="[",R="]")=>{let I=0;for(;h;)if(h=i(h),h&&Ht(h)&&(h.data===y&&I++,h.data===R)){if(I===0)return i(h);I--}return h},re=(h,y,R)=>{const I=y.parentNode;I&&I.replaceChild(h,y);let q=R;for(;q;)q.vnode.el===y&&(q.vnode.el=q.subTree.el=h),q=q.parent},ae=h=>h.nodeType===1&&h.tagName.toLowerCase()==="template";return[d,_]}function Vl(e,t,n,s,r){let i,o,l,a;if(t==="class")l=e.getAttribute("class"),a=Se(n),Wl(cr(l||""),cr(a))||(i=o="class");else if(t==="style"){l=e.getAttribute("style")||"",a=le(n)?n:Co(Pn(n));const u=ur(l),d=ur(a);if(s.dirs)for(const{dir:_,value:b}of s.dirs)_.name==="show"&&!b&&d.set("display","none");r&&Ai(r,s,d),Kl(u,d)||(i=o="style")}else(e instanceof SVGElement&&To(t)||e instanceof HTMLElement&&(Vs(t)||So(t)))&&(Vs(t)?(l=e.hasAttribute(t),a=ps(n)):n==null?(l=e.hasAttribute(t),a=!1):(e.hasAttribute(t)?l=e.getAttribute(t):t==="value"&&e.tagName==="TEXTAREA"?l=e.value:l=!1,a=$o(n)?String(n):!1),l!==a&&(i="attribute",o=t));if(i){const u=b=>b===!1?"(not rendered)":`${o}="${b}"`,d=`Hydration ${i} mismatch on`,_=` + - rendered on server: ${u(l)} + - expected on client: ${u(a)} + Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. + You should fix the source of the mismatch.`;return tt(d,e,_),!0}return!1}function cr(e){return new Set(e.trim().split(/\s+/))}function Wl(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ur(e){const t=new Map;for(const n of e.split(";")){let[s,r]=n.split(":");s=s.trim(),r=r&&r.trim(),s&&r&&t.set(s,r)}return t}function Kl(e,t){if(e.size!==t.size)return!1;for(const[n,s]of e)if(s!==t.get(n))return!1;return!0}function Ai(e,t,n){const s=e.subTree;if(e.getCssVars&&(t===s||s&&s.type===de&&s.children.includes(t))){const r=e.getCssVars();for(const i in r)n.set(`--${i}`,String(r[i]))}t===s&&e.parent&&Ai(e.parent,e.vnode,n)}function ql(){typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!="boolean"&&(hs().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1)}const $e=hi;function zl(e){return Yl(e,Bl)}function Yl(e,t){ql();const n=hs();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:a,setText:u,setElementText:d,parentNode:_,nextSibling:b,setScopeId:T=Ee,insertStaticContent:F}=e,V=(c,f,p,g=null,m=null,w=null,k=void 0,x=null,C=!!f.dynamicChildren)=>{if(c===f)return;c&&!Mt(c,f)&&(g=nn(c),Ue(c,m,w,!0),c=null),f.patchFlag===-2&&(C=!1,f.dynamicChildren=null);const{type:v,ref:S,shapeFlag:P}=f;switch(v){case It:ue(c,f,p,g);break;case Je:re(c,f,p,g);break;case Wt:c==null&&ae(f,p,g,k);break;case de:_e(c,f,p,g,m,w,k,x,C);break;default:P&1?R(c,f,p,g,m,w,k,x,C):P&6?ce(c,f,p,g,m,w,k,x,C):(P&64||P&128)&&v.process(c,f,p,g,m,w,k,x,C,xt)}S!=null&&m&&wn(S,c&&c.ref,w,f||c,!f)},ue=(c,f,p,g)=>{if(c==null)s(f.el=l(f.children),p,g);else{const m=f.el=c.el;f.children!==c.children&&u(m,f.children)}},re=(c,f,p,g)=>{c==null?s(f.el=a(f.children||""),p,g):f.el=c.el},ae=(c,f,p,g)=>{[c.el,c.anchor]=F(c.children,f,p,g,c.el,c.anchor)},h=({el:c,anchor:f},p,g)=>{let m;for(;c&&c!==f;)m=b(c),s(c,p,g),c=m;s(f,p,g)},y=({el:c,anchor:f})=>{let p;for(;c&&c!==f;)p=b(c),r(c),c=p;r(f)},R=(c,f,p,g,m,w,k,x,C)=>{f.type==="svg"?k="svg":f.type==="math"&&(k="mathml"),c==null?I(f,p,g,m,w,k,x,C):Q(c,f,m,w,k,x,C)},I=(c,f,p,g,m,w,k,x)=>{let C,v;const{props:S,shapeFlag:P,transition:L,dirs:N}=c;if(C=c.el=o(c.type,w,S&&S.is,S),P&8?d(C,c.children):P&16&&J(c.children,C,null,g,m,Gn(c,w),k,x),N&&Be(c,null,g,"created"),q(C,c,c.scopeId,k,g),S){for(const ee in S)ee!=="value"&&!St(ee)&&i(C,ee,null,S[ee],w,c.children,g,m,qe);"value"in S&&i(C,"value",null,S.value,w),(v=S.onVnodeBeforeMount)&&Pe(v,g,c)}N&&Be(c,null,g,"beforeMount");const W=Ii(m,L);W&&L.beforeEnter(C),s(C,f,p),((v=S&&S.onVnodeMounted)||W||N)&&$e(()=>{v&&Pe(v,g,c),W&&L.enter(C),N&&Be(c,null,g,"mounted")},m)},q=(c,f,p,g,m)=>{if(p&&T(c,p),g)for(let w=0;w{for(let v=C;v{const x=f.el=c.el;let{patchFlag:C,dynamicChildren:v,dirs:S}=f;C|=c.patchFlag&16;const P=c.props||te,L=f.props||te;let N;if(p&&ft(p,!1),(N=L.onVnodeBeforeUpdate)&&Pe(N,p,f,c),S&&Be(f,c,p,"beforeUpdate"),p&&ft(p,!0),v?B(c.dynamicChildren,v,x,p,g,Gn(f,m),w):k||E(c,f,x,null,p,g,Gn(f,m),w,!1),C>0){if(C&16)ie(x,f,P,L,p,g,m);else if(C&2&&P.class!==L.class&&i(x,"class",null,L.class,m),C&4&&i(x,"style",P.style,L.style,m),C&8){const W=f.dynamicProps;for(let ee=0;ee{N&&Pe(N,p,f,c),S&&Be(f,c,p,"updated")},g)},B=(c,f,p,g,m,w,k)=>{for(let x=0;x{if(p!==g){if(p!==te)for(const x in p)!St(x)&&!(x in g)&&i(c,x,p[x],null,k,f.children,m,w,qe);for(const x in g){if(St(x))continue;const C=g[x],v=p[x];C!==v&&x!=="value"&&i(c,x,v,C,k,f.children,m,w,qe)}"value"in g&&i(c,"value",p.value,g.value,k)}},_e=(c,f,p,g,m,w,k,x,C)=>{const v=f.el=c?c.el:l(""),S=f.anchor=c?c.anchor:l("");let{patchFlag:P,dynamicChildren:L,slotScopeIds:N}=f;N&&(x=x?x.concat(N):N),c==null?(s(v,p,g),s(S,p,g),J(f.children||[],p,S,m,w,k,x,C)):P>0&&P&64&&L&&c.dynamicChildren?(B(c.dynamicChildren,L,p,m,w,k,x),(f.key!=null||m&&f===m.subTree)&&Ei(c,f,!0)):E(c,f,p,S,m,w,k,x,C)},ce=(c,f,p,g,m,w,k,x,C)=>{f.slotScopeIds=x,c==null?f.shapeFlag&512?m.ctx.activate(f,p,g,k,C):Ce(f,p,g,m,w,k,C):Te(c,f,C)},Ce=(c,f,p,g,m,w,k)=>{const x=c.component=aa(c,g,m);if(Oi(c)&&(x.ctx.renderer=xt),ca(x),x.asyncDep){if(m&&m.registerDep(x,O,k),!c.el){const C=x.subTree=j(Je);re(null,C,f,p)}}else O(x,c,f,p,m,w,k)},Te=(c,f,p)=>{const g=f.component=c.component;if(gl(c,f,p))if(g.asyncDep&&!g.asyncResolved){z(g,f,p);return}else g.next=f,ul(g.update),g.effect.dirty=!0,g.update();else f.el=c.el,g.vnode=f},O=(c,f,p,g,m,w,k)=>{const x=()=>{if(c.isMounted){let{next:S,bu:P,u:L,parent:N,vnode:W}=c;{const wt=Li(c);if(wt){S&&(S.el=W.el,z(c,S,k)),wt.asyncDep.then(()=>{c.isUnmounted||x()});return}}let ee=S,X;ft(c,!1),S?(S.el=W.el,z(c,S,k)):S=W,P&&Kn(P),(X=S.props&&S.props.onVnodeBeforeUpdate)&&Pe(X,N,S,W),ft(c,!0);const he=zn(c),Oe=c.subTree;c.subTree=he,V(Oe,he,_(Oe.el),nn(Oe),c,m,w),S.el=he.el,ee===null&&ml(c,he.el),L&&$e(L,m),(X=S.props&&S.props.onVnodeUpdated)&&$e(()=>Pe(X,N,S,W),m)}else{let S;const{el:P,props:L}=f,{bm:N,m:W,parent:ee}=c,X=$t(f);if(ft(c,!1),N&&Kn(N),!X&&(S=L&&L.onVnodeBeforeMount)&&Pe(S,ee,f),ft(c,!0),P&&Vn){const he=()=>{c.subTree=zn(c),Vn(P,c.subTree,c,m,null)};X?f.type.__asyncLoader().then(()=>!c.isUnmounted&&he()):he()}else{const he=c.subTree=zn(c);V(null,he,p,g,c,m,w),f.el=he.el}if(W&&$e(W,m),!X&&(S=L&&L.onVnodeMounted)){const he=f;$e(()=>Pe(S,ee,he),m)}(f.shapeFlag&256||ee&&$t(ee.vnode)&&ee.vnode.shapeFlag&256)&&c.a&&$e(c.a,m),c.isMounted=!0,f=p=g=null}},C=c.effect=new _s(x,Ee,()=>ks(v),c.scope),v=c.update=()=>{C.dirty&&C.run()};v.id=c.uid,ft(c,!0),v()},z=(c,f,p)=>{f.component=c;const g=c.vnode.props;c.vnode=f,c.next=null,Ml(c,f.props,g,p),Fl(c,f.children,p),Xe(),Xs(c),Ze()},E=(c,f,p,g,m,w,k,x,C=!1)=>{const v=c&&c.children,S=c?c.shapeFlag:0,P=f.children,{patchFlag:L,shapeFlag:N}=f;if(L>0){if(L&128){yt(v,P,p,g,m,w,k,x,C);return}else if(L&256){Le(v,P,p,g,m,w,k,x,C);return}}N&8?(S&16&&qe(v,m,w),P!==v&&d(p,P)):S&16?N&16?yt(v,P,p,g,m,w,k,x,C):qe(v,m,w,!0):(S&8&&d(p,""),N&16&&J(P,p,g,m,w,k,x,C))},Le=(c,f,p,g,m,w,k,x,C)=>{c=c||Ct,f=f||Ct;const v=c.length,S=f.length,P=Math.min(v,S);let L;for(L=0;LS?qe(c,m,w,!0,!1,P):J(f,p,g,m,w,k,x,C,P)},yt=(c,f,p,g,m,w,k,x,C)=>{let v=0;const S=f.length;let P=c.length-1,L=S-1;for(;v<=P&&v<=L;){const N=c[v],W=f[v]=C?st(f[v]):Me(f[v]);if(Mt(N,W))V(N,W,p,null,m,w,k,x,C);else break;v++}for(;v<=P&&v<=L;){const N=c[P],W=f[L]=C?st(f[L]):Me(f[L]);if(Mt(N,W))V(N,W,p,null,m,w,k,x,C);else break;P--,L--}if(v>P){if(v<=L){const N=L+1,W=NL)for(;v<=P;)Ue(c[v],m,w,!0),v++;else{const N=v,W=v,ee=new Map;for(v=W;v<=L;v++){const Ie=f[v]=C?st(f[v]):Me(f[v]);Ie.key!=null&&ee.set(Ie.key,v)}let X,he=0;const Oe=L-W+1;let wt=!1,Ns=0;const Ot=new Array(Oe);for(v=0;v=Oe){Ue(Ie,m,w,!0);continue}let je;if(Ie.key!=null)je=ee.get(Ie.key);else for(X=W;X<=L;X++)if(Ot[X-W]===0&&Mt(Ie,f[X])){je=X;break}je===void 0?Ue(Ie,m,w,!0):(Ot[je-W]=v+1,je>=Ns?Ns=je:wt=!0,V(Ie,f[je],p,null,m,w,k,x,C),he++)}const Fs=wt?Gl(Ot):Ct;for(X=Fs.length-1,v=Oe-1;v>=0;v--){const Ie=W+v,je=f[Ie],Us=Ie+1{const{el:w,type:k,transition:x,children:C,shapeFlag:v}=c;if(v&6){ct(c.component.subTree,f,p,g);return}if(v&128){c.suspense.move(f,p,g);return}if(v&64){k.move(c,f,p,xt);return}if(k===de){s(w,f,p);for(let P=0;Px.enter(w),m);else{const{leave:P,delayLeave:L,afterLeave:N}=x,W=()=>s(w,f,p),ee=()=>{P(w,()=>{W(),N&&N()})};L?L(w,W,ee):ee()}else s(w,f,p)},Ue=(c,f,p,g=!1,m=!1)=>{const{type:w,props:k,ref:x,children:C,dynamicChildren:v,shapeFlag:S,patchFlag:P,dirs:L,memoIndex:N}=c;if(P===-2&&(m=!1),x!=null&&wn(x,null,p,c,!0),N!=null&&(f.renderCache[N]=void 0),S&256){f.ctx.deactivate(c);return}const W=S&1&&L,ee=!$t(c);let X;if(ee&&(X=k&&k.onVnodeBeforeUnmount)&&Pe(X,f,c),S&6)ao(c.component,p,g);else{if(S&128){c.suspense.unmount(p,g);return}W&&Be(c,null,f,"beforeUnmount"),S&64?c.type.remove(c,f,p,xt,g):v&&(w!==de||P>0&&P&64)?qe(v,f,p,!1,!0):(w===de&&P&384||!m&&S&16)&&qe(C,f,p),g&&Ms(c)}(ee&&(X=k&&k.onVnodeUnmounted)||W)&&$e(()=>{X&&Pe(X,f,c),W&&Be(c,null,f,"unmounted")},p)},Ms=c=>{const{type:f,el:p,anchor:g,transition:m}=c;if(f===de){lo(p,g);return}if(f===Wt){y(c);return}const w=()=>{r(p),m&&!m.persisted&&m.afterLeave&&m.afterLeave()};if(c.shapeFlag&1&&m&&!m.persisted){const{leave:k,delayLeave:x}=m,C=()=>k(p,w);x?x(c.el,w,C):C()}else w()},lo=(c,f)=>{let p;for(;c!==f;)p=b(c),r(c),c=p;r(f)},ao=(c,f,p)=>{const{bum:g,scope:m,update:w,subTree:k,um:x,m:C,a:v}=c;fr(C),fr(v),g&&Kn(g),m.stop(),w&&(w.active=!1,Ue(k,c,f,p)),x&&$e(x,f),$e(()=>{c.isUnmounted=!0},f),f&&f.pendingBranch&&!f.isUnmounted&&c.asyncDep&&!c.asyncResolved&&c.suspenseId===f.pendingId&&(f.deps--,f.deps===0&&f.resolve())},qe=(c,f,p,g=!1,m=!1,w=0)=>{for(let k=w;kc.shapeFlag&6?nn(c.component.subTree):c.shapeFlag&128?c.suspense.next():b(c.anchor||c.el);let jn=!1;const Ds=(c,f,p)=>{c==null?f._vnode&&Ue(f._vnode,null,null,!0):V(f._vnode||null,c,f,null,null,null,p),jn||(jn=!0,Xs(),bn(),jn=!1),f._vnode=c},xt={p:V,um:Ue,m:ct,r:Ms,mt:Ce,mc:J,pc:E,pbc:B,n:nn,o:e};let Bn,Vn;return t&&([Bn,Vn]=t(xt)),{render:Ds,hydrate:Bn,createApp:Ol(Ds,Bn)}}function Gn({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ft({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Ii(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ei(e,t,n=!1){const s=e.children,r=t.children;if(D(s)&&D(r))for(let i=0;i>1,e[n[l]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function Li(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Li(t)}function fr(e){if(e)for(let t=0;t_t(Jl);function Pi(e,t){return Is(e,null,t)}const un={};function We(e,t,n){return Is(e,t,n)}function Is(e,t,{immediate:n,deep:s,flush:r,once:i,onTrack:o,onTrigger:l}=te){if(t&&i){const I=t;t=(...q)=>{I(...q),R()}}const a=xe,u=I=>s===!0?I:rt(I,s===!1?1:void 0);let d,_=!1,b=!1;if(we(e)?(d=()=>e.value,_=vn(e)):Ut(e)?(d=()=>u(e),_=!0):D(e)?(b=!0,_=e.some(I=>Ut(I)||vn(I)),d=()=>e.map(I=>{if(we(I))return I.value;if(Ut(I))return u(I);if(U(I))return Ge(I,a,2)})):U(e)?t?d=()=>Ge(e,a,2):d=()=>(T&&T(),Fe(e,a,3,[F])):d=Ee,t&&s){const I=d;d=()=>rt(I())}let T,F=I=>{T=h.onStop=()=>{Ge(I,a,4),T=h.onStop=void 0}},V;if(Fn)if(F=Ee,t?n&&Fe(t,a,3,[d(),b?[]:void 0,F]):d(),r==="sync"){const I=Xl();V=I.__watcherHandles||(I.__watcherHandles=[])}else return Ee;let ue=b?new Array(e.length).fill(un):un;const re=()=>{if(!(!h.active||!h.dirty))if(t){const I=h.run();(s||_||(b?I.some((q,J)=>ot(q,ue[J])):ot(I,ue)))&&(T&&T(),Fe(t,a,3,[I,ue===un?void 0:b&&ue[0]===un?[]:ue,F]),ue=I)}else h.run()};re.allowRecurse=!!t;let ae;r==="sync"?ae=re:r==="post"?ae=()=>$e(re,a&&a.suspense):(re.pre=!0,a&&(re.id=a.uid),ae=()=>ks(re));const h=new _s(d,Ee,ae),y=Eo(),R=()=>{h.stop(),y&&fs(y.effects,h)};return t?n?re():ue=h.run():r==="post"?$e(h.run.bind(h),a&&a.suspense):h.run(),V&&V.push(R),R}function Zl(e,t,n){const s=this.proxy,r=le(e)?e.includes(".")?Ri(s,e):()=>s[e]:e.bind(s,s);let i;U(t)?i=t:(i=t.handler,n=t);const o=en(this),l=Is(r,i.bind(s),n);return o(),l}function Ri(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r{rt(s,t,n)});else if(Nr(e)){for(const s in e)rt(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&rt(e[s],t,n)}return e}const Oi=e=>e.type.__isKeepAlive;function Ql(e,t){Hi(e,"a",t)}function ea(e,t){Hi(e,"da",t)}function Hi(e,t,n=xe){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Dn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)Oi(r.parent.vnode)&&ta(s,t,n,r),r=r.parent}}function ta(e,t,n,s){const r=Dn(t,e,s,!0);Nn(()=>{fs(s[t],r)},n)}function Mi(e,t){e.shapeFlag&6&&e.component?Mi(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}const na=e=>e.__isTeleport,de=Symbol.for("v-fgt"),It=Symbol.for("v-txt"),Je=Symbol.for("v-cmt"),Wt=Symbol.for("v-stc"),Kt=[];let De=null;function A(e=!1){Kt.push(De=e?null:[])}function sa(){Kt.pop(),De=Kt[Kt.length-1]||null}let Jt=1;function dr(e){Jt+=e}function Di(e){return e.dynamicChildren=Jt>0?De||Ct:null,sa(),Jt>0&&De&&De.push(e),e}function H(e,t,n,s,r,i){return Di(M(e,t,n,s,r,i,!0))}function be(e,t,n,s,r){return Di(j(e,t,n,s,r,!0))}function Cn(e){return e?e.__v_isVNode===!0:!1}function Mt(e,t){return e.type===t.type&&e.key===t.key}const Ni=({key:e})=>e!=null?e:null,_n=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?le(e)||we(e)||U(e)?{i:ge,r:e,k:t,f:!!n}:e:null);function M(e,t=null,n=null,s=0,r=null,i=e===de?0:1,o=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ni(t),ref:t&&_n(t),scopeId:Mn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ge};return l?(Es(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=le(n)?8:16),Jt>0&&!o&&De&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&De.push(a),a}const j=ra;function ra(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===vl)&&(e=Je),Cn(e)){const l=Et(e,t,!0);return n&&Es(l,n),Jt>0&&!i&&De&&(l.shapeFlag&6?De[De.indexOf(e)]=l:De.push(l)),l.patchFlag=-2,l}if(_a(e)&&(e=e.__vccOpts),t){t=ia(t);let{class:l,style:a}=t;l&&!le(l)&&(t.class=Se(l)),ne(a)&&(ti(a)&&!D(a)&&(a=pe({},a)),t.style=Pn(a))}const o=le(e)?1:yl(e)?128:na(e)?64:ne(e)?4:U(e)?2:0;return M(e,t,n,s,r,o,i,!0)}function ia(e){return e?ti(e)||wi(e)?pe({},e):e:null}function Et(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:a}=e,u=t?Ls(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Ni(u),ref:t&&t.ref?n&&i?D(i)?i.concat(_n(t)):[i,_n(t)]:_n(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==de?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Et(e.ssContent),ssFallback:e.ssFallback&&Et(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&Mi(d,a.clone(d)),d}function Qt(e=" ",t=0){return j(It,null,e,t)}function ld(e,t){const n=j(Wt,null,e);return n.staticCount=t,n}function Z(e="",t=!1){return t?(A(),be(Je,null,e)):j(Je,null,e)}function Me(e){return e==null||typeof e=="boolean"?j(Je):D(e)?j(de,null,e.slice()):typeof e=="object"?st(e):j(It,null,String(e))}function st(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Et(e)}function Es(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(D(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Es(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!wi(t)?t._ctx=ge:r===3&&ge&&(ge.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else U(t)?(t={default:t,_ctx:ge},n=32):(t=String(t),s&64?(n=16,t=[Qt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ls(...e){const t={};for(let n=0;n{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};kn=t("__VUE_INSTANCE_SETTERS__",n=>xe=n),as=t("__VUE_SSR_SETTERS__",n=>Fn=n)}const en=e=>{const t=xe;return kn(e),e.scope.on(),()=>{e.scope.off(),kn(t)}},hr=()=>{xe&&xe.scope.off(),kn(null)};function Fi(e){return e.vnode.shapeFlag&4}let Fn=!1;function ca(e,t=!1){t&&as(t);const{props:n,children:s}=e.vnode,r=Fi(e);Hl(e,n,r,t),Nl(e,s);const i=r?ua(e,t):void 0;return t&&as(!1),i}function ua(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$l);const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?da(e):null,i=en(e);Xe();const o=Ge(s,e,0,[e.props,r]);if(Ze(),i(),Mr(o)){if(o.then(hr,hr),t)return o.then(l=>{pr(e,l,t)}).catch(l=>{On(l,e,0)});e.asyncDep=o}else pr(e,o,t)}else Ui(e,t)}function pr(e,t,n){U(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ne(t)&&(e.setupState=ii(t)),Ui(e,n)}let _r;function Ui(e,t,n){const s=e.type;if(!e.render){if(!t&&_r&&!s.render){const r=s.template||$s(e).template;if(r){const{isCustomElement:i,compilerOptions:o}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,u=pe(pe({isCustomElement:i,delimiters:l},o),a);s.render=_r(r,u)}}e.render=s.render||Ee}{const r=en(e);Xe();try{Al(e)}finally{Ze(),r()}}}const fa={get(e,t){return Ae(e,"get",""),e[t]}};function da(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,fa),slots:e.slots,emit:e.emit,expose:t}}function Un(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ii(hn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bt)return Bt[n](e)},has(t,n){return n in t||n in Bt}})):e.proxy}const ha=/(?:^|[-_])(\w)/g,pa=e=>e.replace(ha,t=>t.toUpperCase()).replace(/[-_]/g,"");function ji(e,t=!0){return U(e)?e.displayName||e.name:e.name||t&&e.__name}function Bi(e,t,n=!1){let s=ji(t);if(!s&&t.__file){const r=t.__file.match(/([^/\\]+)\.\w+$/);r&&(s=r[1])}if(!s&&e&&e.parent){const r=i=>{for(const o in i)if(i[o]===t)return o};s=r(e.components||e.parent.type.components)||r(e.appContext.components)}return s?pa(s):n?"App":"Anonymous"}function _a(e){return U(e)&&"__vccOpts"in e}const K=(e,t)=>Zo(e,t,Fn);function mt(e,t,n){const s=arguments.length;return s===2?ne(t)&&!D(t)?Cn(t)?j(e,null,[t]):j(e,t):j(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Cn(n)&&(n=[n]),j(e,t,n))}const ga="3.4.31";/** +* @vue/runtime-dom v3.4.31 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const ma="http://www.w3.org/2000/svg",va="http://www.w3.org/1998/Math/MathML",ze=typeof document!="undefined"?document:null,gr=ze&&ze.createElement("template"),ba={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?ze.createElementNS(ma,e):t==="mathml"?ze.createElementNS(va,e):n?ze.createElement(e,{is:n}):ze.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>ze.createTextNode(e),createComment:e=>ze.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ze.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{gr.innerHTML=s==="svg"?`${e}`:s==="mathml"?`${e}`:e;const l=gr.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ya=Symbol("_vtc");function xa(e,t,n){const s=e[ya];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Sn=Symbol("_vod"),Vi=Symbol("_vsh"),wa={beforeMount(e,{value:t},{transition:n}){e[Sn]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Dt(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Dt(e,!0),s.enter(e)):s.leave(e,()=>{Dt(e,!1)}):Dt(e,t))},beforeUnmount(e,{value:t}){Dt(e,t)}};function Dt(e,t){e.style.display=t?e[Sn]:"none",e[Vi]=!t}const Ca=Symbol(""),ka=/(^|;)\s*display\s*:/;function Sa(e,t,n){const s=e.style,r=le(n);let i=!1;if(n&&!r){if(t)if(le(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&gn(s,l,"")}else for(const o in t)n[o]==null&&gn(s,o,"");for(const o in n)o==="display"&&(i=!0),gn(s,o,n[o])}else if(r){if(t!==n){const o=s[Ca];o&&(n+=";"+o),s.cssText=n,i=ka.test(n)}}else t&&e.removeAttribute("style");Sn in e&&(e[Sn]=i?s.display:"",e[Vi]&&(s.display="none"))}const mr=/\s*!important$/;function gn(e,t,n){if(D(n))n.forEach(s=>gn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ta(e,t);mr.test(n)?e.setProperty(vt(s),n.replace(mr,""),"important"):e[s]=n}}const vr=["Webkit","Moz","ms"],Jn={};function Ta(e,t){const n=Jn[t];if(n)return n;let s=Ke(t);if(s!=="filter"&&s in e)return Jn[t]=s;s=Ln(s);for(let r=0;rXn||(Pa.then(()=>Xn=0),Xn=Date.now());function Oa(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Fe(Ha(s,n.value),t,5,[s])};return n.value=e,n.attached=Ra(),n}function Ha(e,t){if(D(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const Cr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ma=(e,t,n,s,r,i,o,l,a)=>{const u=r==="svg";t==="class"?xa(e,s,u):t==="style"?Sa(e,n,s):Xt(t)?us(t)||Ea(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Da(e,t,s,u))?($a(e,t,s,i,o,l,a),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&yr(e,t,s,u,o,t!=="value")):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),yr(e,t,s,u))};function Da(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Cr(t)&&U(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Cr(t)&&le(n)?!1:t in e}const Na=pe({patchProp:Ma},ba);let Zn,kr=!1;function Fa(){return Zn=kr?Zn:zl(Na),kr=!0,Zn}const Ua=(...e)=>{const t=Fa().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Ba(s);if(r)return n(r,!0,ja(r))},t};function ja(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ba(e){return le(e)?document.querySelector(e):e}var Va='{"lang":"en-US","title":"Swagger-PHP","description":"Generate OpenAPI documentation for your RESTful API.","base":"/swagger-php/","head":[],"themeConfig":{"repo":"zircote/swagger-php","docsDir":"docs","docsBranch":"master","editLinks":false,"editLinkText":"Edit this page on GitHub","nav":[{"text":"User Guide","link":"/guide/"},{"text":"Reference","link":"/reference/"},{"text":"OpenApi","link":"https://learn.openapis.org/"},{"text":"Releases","link":"https://github.com/zircote/swagger-php/releases"}],"sidebar":{"/guide/":[{"text":"Introduction","children":[{"text":"What is Swagger-PHP?","link":"/guide/"},{"text":"Installation","link":"/guide/installation"},{"text":"Generating OpenAPI documents","link":"/guide/generating-openapi-documents"}]},{"text":"Annotating your code","children":[{"text":"Attributes","link":"/guide/attributes"},{"text":"Annotations","link":"/guide/annotations"},{"text":"Required elements","link":"/guide/required-elements"},{"text":"Common techniques","link":"/guide/common-techniques"}]},{"text":"Upgrading","children":[{"text":"Migration from 3.x to 4.x","link":"/guide/migrating-to-v4"},{"text":"Migration from 2.x to 3.x","link":"/guide/migrating-to-v3"}]},{"text":"Other","children":[{"text":"Cookbook","link":"/guide/cookbook"},{"text":"FAQ","link":"/guide/faq"},{"text":"Under the hood","link":"/guide/under-the-hood"},{"text":"Related Projects","link":"/related-projects"}]}],"/reference/":[{"text":"Reference","children":[{"text":"Attributes","link":"/reference/attributes"},{"text":"Annotations","link":"/reference/annotations"}]},{"text":"Api","children":[{"text":"Generator","link":"/reference/generator"},{"text":"Processors","link":"/reference/processors"}]}]}},"locales":{},"langs":{},"scrollOffset":90}';const Wi=/^https?:/i,Ne=typeof window!="undefined";function Wa(e,t){t.sort((n,s)=>{const r=s.split("/").length-n.split("/").length;return r!==0?r:s.length-n.length});for(const n of t)if(e.startsWith(n))return n}function Sr(e,t){const n=Wa(t,Object.keys(e));return n?e[n]:void 0}function Ka(e){const{locales:t}=e.themeConfig||{},n=e.locales;return t&&n?Object.keys(t).reduce((s,r)=>(s[r]={label:t[r].label,lang:n[r].lang},s),{}):{}}function qa(e,t){t=za(e,t);const n=Sr(e.locales||{},t),s=Sr(e.themeConfig.locales||{},t);return Object.assign({},e,n,{themeConfig:Object.assign({},e.themeConfig,s,{locales:{}}),lang:(n||e).lang,locales:{},langs:Ka(e)})}function za(e,t){if(!Ne)return t;const n=e.base,s=n.endsWith("/")?n.slice(0,-1):n;return t.slice(s.length)}const Ki=Symbol(),tn=Qo(Ya(Va));function Ya(e){return JSON.parse(e)}function Ga(e){const t=K(()=>qa(tn.value,e.path));return{site:t,theme:K(()=>t.value.themeConfig),page:K(()=>e.data),frontmatter:K(()=>e.data.frontmatter),lang:K(()=>t.value.lang),localePath:K(()=>{const{langs:n,lang:s}=t.value,r=Object.keys(n).find(i=>n[i].lang===s);return Lt(r||"/")}),title:K(()=>e.data.title?e.data.title+" | "+t.value.title:t.value.title),description:K(()=>e.data.description||t.value.description)}}function ve(){const e=_t(Ki);if(!e)throw new Error("vitepress data not properly injected in app");return e}function Ja(e,t){return`${e}${t}`.replace(/\/+/g,"/")}function Lt(e){return Wi.test(e)?e:Ja(tn.value.base,e)}function qi(e){let t=e.replace(/\.html$/,"");if(t=decodeURIComponent(t),t.endsWith("/")&&(t+="index"),Ne){const n="/swagger-php/";t=t.slice(n.length).replace(/\//g,"_")+".md";const s=__VP_HASH_MAP__[t.toLowerCase()];t=`${n}assets/${t}.${s}.js`}else t=`./${t.slice(1).replace(/\//g,"_")}.md.js`;return t}const zi=Symbol(),Tr="http://a.com",Yi={relativePath:"",title:"404",description:"Not Found",headers:[],frontmatter:{},lastUpdated:0},Xa=()=>({path:"/",component:null,data:Yi});function Za(e,t){const n=Rt(Xa());function s(o=Ne?location.href:"/"){const l=new URL(o,Tr);return!l.pathname.endsWith("/")&&!l.pathname.endsWith(".html")&&(l.pathname+=".html",o=l.pathname+l.search+l.hash),Ne&&(history.replaceState({scrollPosition:window.scrollY},document.title),history.pushState(null,"",o)),i(o)}let r=null;async function i(o,l=0,a=!1){const u=new URL(o,Tr),d=r=u.pathname;try{let _=e(d);if("then"in _&&typeof _.then=="function"&&(_=await _),r===d){r=null;const{default:b,__pageData:T}=_;if(!b)throw new Error(`Invalid route component: ${b}`);n.path=d,n.component=hn(b),n.data=hn(JSON.parse(T)),Ne&&ai(()=>{if(u.hash&&!l){let F=null;try{F=document.querySelector(decodeURIComponent(u.hash))}catch(V){console.warn(V)}if(F){$r(F,u.hash);return}}window.scrollTo(0,l)})}}catch(_){if(_.message.match(/fetch/)||console.error(_),!a)try{const b=await fetch(tn.value.base+"hashmap.json");window.__VP_HASH_MAP__=await b.json(),await i(o,l,!0);return}catch{}r===d&&(r=null,n.path=d,n.component=t?hn(t):null,n.data=Yi)}}return Ne&&(window.addEventListener("click",o=>{const l=o.target.closest("a");if(l){const{href:a,protocol:u,hostname:d,pathname:_,hash:b,target:T}=l,F=window.location,V=_.match(/\.\w+$/);!o.ctrlKey&&!o.shiftKey&&!o.altKey&&!o.metaKey&&T!=="_blank"&&u===F.protocol&&d===F.hostname&&!(V&&V[0]!==".html")&&(o.preventDefault(),_===F.pathname?b&&b!==F.hash&&(history.pushState(null,"",b),window.dispatchEvent(new Event("hashchange")),$r(l,b,l.classList.contains("header-anchor"))):s(a))}},{capture:!0}),window.addEventListener("popstate",o=>{i(location.href,o.state&&o.state.scrollPosition||0)}),window.addEventListener("hashchange",o=>{o.preventDefault()})),{route:n,go:s}}function Qa(){const e=_t(zi);if(!e)throw new Error("useRouter() is called without provider.");return e}function at(){return Qa().route}function $r(e,t,n=!1){let s=null;try{s=e.classList.contains("header-anchor")?e:document.querySelector(decodeURIComponent(t))}catch(r){console.warn(r)}if(s){let r=tn.value.scrollOffset;typeof r=="string"&&(r=document.querySelector(r).getBoundingClientRect().bottom+24);const i=parseInt(window.getComputedStyle(s).paddingTop,10),o=window.scrollY+s.getBoundingClientRect().top-r+i;!n||Math.abs(o-window.scrollY)>window.innerHeight?window.scrollTo(0,o):window.scrollTo({left:0,top:o,behavior:"smooth"})}}function ec(e,t){let n=[],s=!0;const r=i=>{if(s){s=!1;return}const o=[],l=Math.min(n.length,i.length);for(let a=0;adocument.head.removeChild(a)),i.slice(l).forEach(a=>{const u=Ar(a);document.head.appendChild(u),o.push(u)}),n=o};Pi(()=>{const i=e.data,o=t.value,l=i&&i.title,a=i&&i.description,u=i&&i.frontmatter.head;document.title=(l?l+" | ":"")+o.title,document.querySelector("meta[name=description]").setAttribute("content",a||o.description),r([...u?nc(u):[]])})}function Ar([e,t,n]){const s=document.createElement(e);for(const r in t)s.setAttribute(r,t[r]);return n&&(s.innerHTML=n),s}function tc(e){return e[0]==="meta"&&e[1]&&e[1].name==="description"}function nc(e){return e.filter(t=>!tc(t))}const sc=se({name:"VitePressContent",setup(){const e=at();return()=>mt("div",{style:{position:"relative"}},[e.component?mt(e.component):null])}});var fe=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n};const rc=e=>(Ss("data-v-765646fb"),e=e(),Ts(),e),ic=rc(()=>M("p",{class:"title"},"Debug",-1)),oc={class:"block"};se({__name:"Debug",setup(e){const t=ve(),n=gt(null),s=gt(!1),r=Rt(t);return We(s,i=>{i||(n.value.scrollTop=0)}),(i,o)=>(A(),H("div",{class:Se(["debug",{open:s.value}]),ref_key:"el",ref:n,onClick:o[0]||(o[0]=l=>s.value=!s.value)},[ic,M("pre",oc,me(r),1)],2))}});const lc=/#.*$/,ac=/(index)?\.(md|html)$/,Tn=/\/$/,cc=/^[a-z]+:/i;function Ps(e){return Array.isArray(e)}function Rs(e){return cc.test(e)}function uc(e,t){if(t===void 0)return!1;const n=Ir(`/${e.data.relativePath}`),s=Ir(t);return n===s}function Ir(e){return decodeURI(e).replace(lc,"").replace(ac,"")}function fc(e,t){const n=e.endsWith("/"),s=t.startsWith("/");return n&&s?e.slice(0,-1)+t:!n&&!s?`${e}/${t}`:e+t}function cs(e){return/^\//.test(e)?e:`/${e}`}function Gi(e){return e.replace(/(index)?(\.(md|html))?$/,"")||"/"}function dc(e){return e===!1||e==="auto"||Ps(e)}function hc(e){return e.children!==void 0}function pc(e){return Ps(e)?e.length===0:!e}function Os(e,t){if(dc(e))return e;t=cs(t);for(const n in e)if(t.startsWith(cs(n)))return e[n];return"auto"}function Ji(e){return e.reduce((t,n)=>(n.link&&t.push({text:n.text,link:Gi(n.link)}),hc(n)&&(t=[...t,...Ji(n.children)]),t),[])}function Xi(e){const t=at(),n=Rs(e.value.link);return{props:K(()=>{const r=Er(`/${t.data.relativePath}`);let i=!1;if(e.value.activeMatch)i=new RegExp(e.value.activeMatch).test(r);else{const o=Er(e.value.link);i=o==="/"?o===r:r.startsWith(o)}return{class:{active:i,isExternal:n},href:n?e.value.link:Lt(e.value.link),target:e.value.target||(n?"_blank":null),rel:e.value.rel||(n?"noopener noreferrer":null),"aria-label":e.value.ariaLabel}}),isExternal:n}}function Er(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\.(html|md)$/,"").replace(/\/index$/,"/")}const _c={},gc={class:"icon outbound",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},mc=M("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"},null,-1),vc=M("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"},null,-1),bc=[mc,vc];function yc(e,t){return A(),H("svg",gc,bc)}var Hs=fe(_c,[["render",yc]]);const xc={class:"nav-link"},wc=se({__name:"NavLink",props:{item:{}},setup(e){const n=ws(e),{props:s,isExternal:r}=Xi(n.item);return(i,o)=>(A(),H("div",xc,[M("a",Ls({class:"item"},$(s)),[Qt(me(i.item.text)+" ",1),$(r)?(A(),be(Hs,{key:0})):Z("",!0)],16)]))}});var $n=fe(wc,[["__scopeId","data-v-49fe041d"]]);const Cc={key:0,class:"home-hero"},kc={key:0,class:"figure"},Sc=["src","alt"],Tc={key:1,id:"main-title",class:"title"},$c={key:2,class:"tagline"},Ac=se({__name:"HomeHero",setup(e){const{site:t,frontmatter:n}=ve(),s=K(()=>{const{heroImage:o,heroText:l,tagline:a,actionLink:u,actionText:d}=n.value;return o||l||a||u&&d}),r=K(()=>n.value.heroText||t.value.title),i=K(()=>n.value.tagline||t.value.description);return(o,l)=>s.value?(A(),H("header",Cc,[$(n).heroImage?(A(),H("figure",kc,[M("img",{class:"image",src:$(Lt)($(n).heroImage),alt:$(n).heroAlt},null,8,Sc)])):Z("",!0),r.value?(A(),H("h1",Tc,me(r.value),1)):Z("",!0),i.value?(A(),H("p",$c,me(i.value),1)):Z("",!0),$(n).actionLink&&$(n).actionText?(A(),be($n,{key:3,item:{link:$(n).actionLink,text:$(n).actionText},class:"action"},null,8,["item"])):Z("",!0),$(n).altActionLink&&$(n).altActionText?(A(),be($n,{key:4,item:{link:$(n).altActionLink,text:$(n).altActionText},class:"action alt"},null,8,["item"])):Z("",!0)])):Z("",!0)}});var Ic=fe(Ac,[["__scopeId","data-v-5d8b683d"]]);const Ec={key:0,class:"home-features"},Lc={class:"wrapper"},Pc={class:"container"},Rc={class:"features"},Oc={key:0,class:"title"},Hc={key:1,class:"details"},Mc=se({__name:"HomeFeatures",setup(e){const{frontmatter:t}=ve(),n=K(()=>t.value.features&&t.value.features.length>0),s=K(()=>t.value.features?t.value.features:[]);return(r,i)=>n.value?(A(),H("div",Ec,[M("div",Lc,[M("div",Pc,[M("div",Rc,[(A(!0),H(de,null,Zt(s.value,(o,l)=>(A(),H("section",{key:l,class:"feature"},[o.title?(A(),H("h2",Oc,me(o.title),1)):Z("",!0),o.details?(A(),H("p",Hc,me(o.details),1)):Z("",!0)]))),128))])])])])):Z("",!0)}});var Dc=fe(Mc,[["__scopeId","data-v-245bde66"]]);const Nc={key:0,class:"footer"},Fc={class:"container"},Uc={class:"text"},jc=se({__name:"HomeFooter",setup(e){const{frontmatter:t}=ve();return(n,s)=>$(t).footer?(A(),H("footer",Nc,[M("div",Fc,[M("p",Uc,me($(t).footer),1)])])):Z("",!0)}});var Bc=fe(jc,[["__scopeId","data-v-bff49316"]]);const Vc={class:"home","aria-labelledby":"main-title"},Wc={class:"home-content"},Kc=se({__name:"Home",setup(e){return(t,n)=>{const s=At("Content");return A(),H("main",Vc,[j(Ic),oe(t.$slots,"hero",{},void 0,!0),j(Dc),M("div",Wc,[j(s)]),oe(t.$slots,"features",{},void 0,!0),j(Bc),oe(t.$slots,"footer",{},void 0,!0)])}}});var qc=fe(Kc,[["__scopeId","data-v-8382b818"]]);const zc=["href","aria-label"],Yc=["src"],Gc=se({__name:"NavBarTitle",setup(e){const{site:t,theme:n,localePath:s}=ve();return(r,i)=>(A(),H("a",{class:"nav-bar-title",href:$(s),"aria-label":`${$(t).title}, back to home`},[$(n).logo?(A(),H("img",{key:0,class:"logo",src:$(Lt)($(n).logo),alt:"Logo"},null,8,Yc)):Z("",!0),Qt(" "+me($(t).title),1)],8,zc))}});var Jc=fe(Gc,[["__scopeId","data-v-016a8bd8"]]);function Xc(){const{site:e,localePath:t,theme:n}=ve();return K(()=>{const s=e.value.langs,r=Object.keys(s);if(r.length<2)return null;const o=at().path.replace(t.value,""),l=r.map(u=>({text:s[u].label,link:`${u}${o}`}));return{text:n.value.selectText||"Languages",items:l}})}const Zc=["GitHub","GitLab","Bitbucket"].map(e=>[e,new RegExp(e,"i")]);function Qc(){const{site:e}=ve();return K(()=>{const t=e.value.themeConfig,n=t.docsRepo||t.repo;if(!n)return null;const s=eu(n);return{text:tu(s,t.repoLabel),link:s}})}function eu(e){return Wi.test(e)?e:`https://github.com/${e}`}function tu(e,t){if(t)return t;const n=e.match(/^https?:\/\/[^/]+/);if(!n)return"Source";const s=Zc.find(([r,i])=>i.test(n[0]));return s&&s[0]?s[0]:"Source"}const nu=e=>(Ss("data-v-07381bdb"),e=e(),Ts(),e),su={class:"nav-dropdown-link-item"},ru=nu(()=>M("span",{class:"arrow"},null,-1)),iu={class:"text"},ou={class:"icon"},lu=se({__name:"NavDropdownLinkItem",props:{item:{}},setup(e){const n=ws(e),{props:s,isExternal:r}=Xi(n.item);return(i,o)=>(A(),H("div",su,[M("a",Ls({class:"item"},$(s)),[ru,M("span",iu,me(i.item.text),1),M("span",ou,[$(r)?(A(),be(Hs,{key:0})):Z("",!0)])],16)]))}});var au=fe(lu,[["__scopeId","data-v-07381bdb"]]);const cu=["aria-label"],uu={class:"button-text"},fu={class:"dialog"},du=se({__name:"NavDropdownLink",props:{item:{}},setup(e){const t=at(),n=gt(!1);We(()=>t.path,()=>{n.value=!1});function s(){n.value=!n.value}return(r,i)=>(A(),H("div",{class:Se(["nav-dropdown-link",{open:n.value}])},[M("button",{class:"button","aria-label":r.item.ariaLabel,onClick:s},[M("span",uu,me(r.item.text),1),M("span",{class:Se(["button-arrow",n.value?"down":"right"])},null,2)],8,cu),M("ul",fu,[(A(!0),H(de,null,Zt(r.item.items,o=>(A(),H("li",{key:o.text,class:"dialog-item"},[j(au,{item:o},null,8,["item"])]))),128))])],2))}});var Lr=fe(du,[["__scopeId","data-v-18d75f62"]]);const hu={key:0,class:"nav-links"},pu={key:1,class:"item"},_u={key:2,class:"item"},gu=se({__name:"NavLinks",setup(e){const{theme:t}=ve(),n=Xc(),s=Qc(),r=K(()=>t.value.nav||s.value||n.value);return(i,o)=>r.value?(A(),H("nav",hu,[$(t).nav?(A(!0),H(de,{key:0},Zt($(t).nav,l=>(A(),H("div",{key:l.text,class:"item"},[l.items?(A(),be(Lr,{key:0,item:l},null,8,["item"])):(A(),be($n,{key:1,item:l},null,8,["item"]))]))),128)):Z("",!0),$(n)?(A(),H("div",pu,[j(Lr,{item:$(n)},null,8,["item"])])):Z("",!0),$(s)?(A(),H("div",_u,[j($n,{item:$(s)},null,8,["item"])])):Z("",!0)])):Z("",!0)}});var Zi=fe(gu,[["__scopeId","data-v-35b91e7e"]]);const mu={emits:["toggle"]},vu=M("svg",{class:"icon",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",viewBox:"0 0 448 512"},[M("path",{fill:"currentColor",d:"M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z",class:""})],-1),bu=[vu];function yu(e,t,n,s,r,i){return A(),H("div",{class:"sidebar-button",onClick:t[0]||(t[0]=o=>e.$emit("toggle"))},bu)}var xu=fe(mu,[["render",yu]]);const wu=e=>(Ss("data-v-40587210"),e=e(),Ts(),e),Cu={class:"nav-bar"},ku=wu(()=>M("div",{class:"flex-grow"},null,-1)),Su={class:"nav"},Tu=se({__name:"NavBar",emits:["toggle"],setup(e){return(t,n)=>(A(),H("header",Cu,[j(xu,{onToggle:n[0]||(n[0]=s=>t.$emit("toggle"))}),j(Jc),ku,M("div",Su,[j(Zi)]),oe(t.$slots,"search",{},void 0,!0)]))}});var $u=fe(Tu,[["__scopeId","data-v-40587210"]]);function Au(){let e=null,t=null;const n=Ru(s,300);function s(){const o=Iu(),l=Eu(o);for(let a=0;a ul > li");l&&l!==t.parentElement?(e=l.querySelector("a"),e&&e.classList.add("active")):e=null}function i(o){o&&o.classList.remove("active")}bt(()=>{s(),window.addEventListener("scroll",n)}),_i(()=>{r(decodeURIComponent(location.hash))}),Nn(()=>{window.removeEventListener("scroll",n)})}function Iu(){return[].slice.call(document.querySelectorAll(".sidebar a.sidebar-link-item"))}function Eu(e){return[].slice.call(document.querySelectorAll(".header-anchor")).filter(t=>e.some(n=>n.hash===t.hash))}function Lu(){return document.querySelector(".nav-bar").offsetHeight}function Pr(e){const t=Lu();return e.parentElement.offsetTop-t-15}function Pu(e,t,n){const s=window.scrollY;return e===0&&s===0?[!0,null]:s{n&&clearTimeout(n),s?n=setTimeout(e,t):(e(),s=!0,setTimeout(()=>{s=!1},t))}}function Ou(){const e=at(),{site:t}=ve();return Au(),K(()=>{const n=e.data.headers,s=e.data.frontmatter.sidebar,r=e.data.frontmatter.sidebarDepth;if(s===!1)return[];if(s==="auto")return Rr(n,r);const i=Os(t.value.themeConfig.sidebar,e.data.relativePath);return i===!1?[]:i==="auto"?Rr(n,r):i})}function Rr(e,t){const n=[];if(e===void 0)return[];let s;return e.forEach(({level:r,title:i,slug:o})=>{if(r-1>t)return;const l={text:i,link:`#${o}`};r===2?(s=l,n.push(l)):s&&(s.children||(s.children=[])).push(l)}),n}const Qi=e=>{const t=at(),{site:n,frontmatter:s}=ve(),r=e.depth||1,i=s.value.sidebarDepth||1/0,o=t.data.headers,l=e.item.text,a=Hu(n.value.base,e.item.link),u=e.item.children,d=uc(t,e.item.link),_=r0?mt("ul",{class:"sidebar-links"},t.map(r=>mt(Qi,{item:r,depth:s}))):e&&n?eo(!1,Mu(n),void 0,s):null}function Mu(e){return to(Du(e))}function Du(e){e=e.map(n=>Object.assign({},n));let t;return e.forEach(n=>{n.level===2?t=n:t&&(t.children||(t.children=[])).push(n)}),e.filter(n=>n.level===2)}function to(e){return e.map(t=>({text:t.title,link:`#${t.slug}`,children:t.children?to(t.children):void 0}))}const Nu={key:0,class:"sidebar-links"},Fu=se({__name:"SideBarLinks",setup(e){const t=Ou();return(n,s)=>$(t).length>0?(A(),H("ul",Nu,[(A(!0),H(de,null,Zt($(t),r=>(A(),be($(Qi),{item:r},null,8,["item"]))),256))])):Z("",!0)}});const Uu=se({__name:"SideBar",props:{open:{type:Boolean}},setup(e){return(t,n)=>(A(),H("aside",{class:Se(["sidebar",{open:t.open}])},[j(Zi,{class:"nav"}),oe(t.$slots,"sidebar-top",{},void 0,!0),j(Fu),oe(t.$slots,"sidebar-bottom",{},void 0,!0)],2))}});var ju=fe(Uu,[["__scopeId","data-v-17c48e2f"]]);const Bu=/bitbucket.org/;function Vu(){const{page:e,theme:t,frontmatter:n}=ve(),s=K(()=>{const{repo:i,docsDir:o="",docsBranch:l="master",docsRepo:a=i,editLinks:u}=t.value,d=n.value.editLink!=null?n.value.editLink:u,{relativePath:_}=e.value;return!d||!_||!i?null:Wu(i,a,o,l,_)}),r=K(()=>t.value.editLinkText||"Edit this page");return{url:s,text:r}}function Wu(e,t,n,s,r){return Bu.test(e)?qu(e,t,n,s,r):Ku(e,t,n,s,r)}function Ku(e,t,n,s,r){return(Rs(t)?t:`https://github.com/${t}`).replace(Tn,"")+`/edit/${s}/`+(n?n.replace(Tn,"")+"/":"")+r}function qu(e,t,n,s,r){return(Rs(t)?t:e).replace(Tn,"")+`/src/${s}/`+(n?n.replace(Tn,"")+"/":"")+r+`?mode=edit&spa=0&at=${s}&fileviewer=file-view-default`}const zu={class:"edit-link"},Yu=["href"],Gu=se({__name:"EditLink",setup(e){const{url:t,text:n}=Vu();return(s,r)=>(A(),H("div",zu,[$(t)?(A(),H("a",{key:0,class:"link",href:$(t),target:"_blank",rel:"noopener noreferrer"},[Qt(me($(n))+" ",1),j(Hs,{class:"icon"})],8,Yu)):Z("",!0)]))}});var Ju=fe(Gu,[["__scopeId","data-v-55695e90"]]);const Xu={key:0,class:"last-updated"},Zu={class:"prefix"},Qu={class:"datetime"},ef=se({__name:"LastUpdated",setup(e){const{theme:t,page:n}=ve(),s=K(()=>{const o=t.value.lastUpdated;return o!==void 0&&o!==!1&&n.value.lastUpdated!==0}),r=K(()=>{const o=t.value.lastUpdated;return o===!0?"Last Updated":o}),i=gt("");return bt(()=>{Pi(()=>{i.value=new Date(n.value.lastUpdated).toLocaleString("en-US")})}),(o,l)=>s.value?(A(),H("p",Xu,[M("span",Zu,me(r.value)+":",1),M("span",Qu,me(i.value),1)])):Z("",!0)}});var tf=fe(ef,[["__scopeId","data-v-7e06cdca"]]);const nf={class:"page-footer"},sf={class:"edit"},rf={class:"updated"},of=se({__name:"PageFooter",setup(e){const{page:t}=ve();return(n,s)=>(A(),H("footer",nf,[M("div",sf,[j(Ju)]),M("div",rf,[$(t).lastUpdated?(A(),be(tf,{key:0})):Z("",!0)])]))}});var lf=fe(of,[["__scopeId","data-v-b65b4b36"]]);function af(){const{page:e,theme:t}=ve(),n=K(()=>Gi(cs(e.value.relativePath))),s=K(()=>{const a=Os(t.value.sidebar,n.value);return Ps(a)?Ji(a):[]}),r=K(()=>s.value.findIndex(a=>a.link===n.value)),i=K(()=>{if(t.value.nextLinks!==!1&&r.value>-1&&r.value{if(t.value.prevLinks!==!1&&r.value>0)return s.value[r.value-1]}),l=K(()=>!!i.value||!!o.value);return{next:i,prev:o,hasLinks:l}}const cf={},uf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},ff=M("path",{d:"M19,11H7.4l5.3-5.3c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0l-7,7c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.2-0.1,0.5,0,0.8c0.1,0.1,0.1,0.2,0.2,0.3l7,7c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L7.4,13H19c0.6,0,1-0.4,1-1S19.6,11,19,11z"},null,-1),df=[ff];function hf(e,t){return A(),H("svg",uf,df)}var pf=fe(cf,[["render",hf]]);const _f={},gf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},mf=M("path",{d:"M19.9,12.4c0.1-0.2,0.1-0.5,0-0.8c-0.1-0.1-0.1-0.2-0.2-0.3l-7-7c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l5.3,5.3H5c-0.6,0-1,0.4-1,1s0.4,1,1,1h11.6l-5.3,5.3c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l7-7C19.8,12.6,19.9,12.5,19.9,12.4z"},null,-1),vf=[mf];function bf(e,t){return A(),H("svg",gf,vf)}var yf=fe(_f,[["render",bf]]);const xf={key:0,class:"next-and-prev-link"},wf={class:"container"},Cf={class:"prev"},kf=["href"],Sf={class:"text"},Tf={class:"next"},$f=["href"],Af={class:"text"},If=se({__name:"NextAndPrevLinks",setup(e){const{hasLinks:t,prev:n,next:s}=af();return(r,i)=>$(t)?(A(),H("div",xf,[M("div",wf,[M("div",Cf,[$(n)?(A(),H("a",{key:0,class:"link",href:$(Lt)($(n).link)},[j(pf,{class:"icon icon-prev"}),M("span",Sf,me($(n).text),1)],8,kf)):Z("",!0)]),M("div",Tf,[$(s)?(A(),H("a",{key:0,class:"link",href:$(Lt)($(s).link)},[M("span",Af,me($(s).text),1),j(yf,{class:"icon icon-next"})],8,$f)):Z("",!0)])])])):Z("",!0)}});var Ef=fe(If,[["__scopeId","data-v-e65a9748"]]);const Lf={class:"page"},Pf={class:"container"},Rf=se({__name:"Page",setup(e){return(t,n)=>{const s=At("Content");return A(),H("main",Lf,[M("div",Pf,[oe(t.$slots,"top",{},void 0,!0),j(s,{class:"content"}),j(lf),j(Ef),oe(t.$slots,"bottom",{},void 0,!0)])])}}});var Of=fe(Rf,[["__scopeId","data-v-8fcebc32"]]);const Hf={key:0,id:"ads-container"},Mf=se({__name:"Layout",setup(e){const t=()=>null,n=t,s=t,r=t,i=at(),{site:o,page:l,theme:a,frontmatter:u}=ve(),d=K(()=>!!u.value.customLayout),_=K(()=>!!u.value.home),b=K(()=>Object.keys(o.value.langs).length>1),T=K(()=>{const h=a.value;return u.value.navbar===!1||h.navbar===!1?!1:o.value.title||h.logo||h.repo||h.nav}),F=gt(!1),V=K(()=>u.value.home||u.value.sidebar===!1?!1:!pc(Os(a.value.sidebar,i.data.relativePath))),ue=h=>{F.value=typeof h=="boolean"?h:!F.value},re=ue.bind(null,!1);We(i,re);const ae=K(()=>[{"no-navbar":!T.value,"sidebar-open":F.value,"no-sidebar":!V.value}]);return(h,y)=>{const R=At("Content"),I=At("Debug");return A(),H(de,null,[M("div",{class:Se(["theme",ae.value])},[T.value?(A(),be($u,{key:0,onToggle:ue},{search:Re(()=>[oe(h.$slots,"navbar-search",{},()=>[$(a).algolia?(A(),be($(r),{key:0,options:$(a).algolia,multilang:b.value},null,8,["options","multilang"])):Z("",!0)])]),_:3})):Z("",!0),j(ju,{open:F.value},{"sidebar-top":Re(()=>[oe(h.$slots,"sidebar-top")]),"sidebar-bottom":Re(()=>[oe(h.$slots,"sidebar-bottom")]),_:3},8,["open"]),M("div",{class:"sidebar-mask",onClick:y[0]||(y[0]=q=>ue(!1))}),d.value?(A(),be(R,{key:1})):_.value?oe(h.$slots,"home",{key:2},()=>[j(qc,null,{hero:Re(()=>[oe(h.$slots,"home-hero")]),features:Re(()=>[oe(h.$slots,"home-features")]),footer:Re(()=>[oe(h.$slots,"home-footer")]),_:3})]):(A(),be(Of,{key:3},{top:Re(()=>[oe(h.$slots,"page-top-ads",{},()=>[$(a).carbonAds&&$(a).carbonAds.carbon?(A(),H("div",Hf,[(A(),be($(n),{key:"carbon"+$(l).relativePath,code:$(a).carbonAds.carbon,placement:$(a).carbonAds.placement},null,8,["code","placement"]))])):Z("",!0)]),oe(h.$slots,"page-top")]),bottom:Re(()=>[oe(h.$slots,"page-bottom"),oe(h.$slots,"page-bottom-ads",{},()=>[$(a).carbonAds&&$(a).carbonAds.custom?(A(),be($(s),{key:"custom"+$(l).relativePath,code:$(a).carbonAds.custom,placement:$(a).carbonAds.placement},null,8,["code","placement"])):Z("",!0)])]),_:3}))],2),j(I)],64)}}}),Df={class:"theme"},Nf=M("h1",null,"404",-1),Ff=["href"],Uf=se({__name:"NotFound",setup(e){const{site:t}=ve(),n=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."];function s(){return n[Math.floor(Math.random()*n.length)]}return(r,i)=>(A(),H("div",Df,[Nf,M("blockquote",null,me(s()),1),M("a",{href:$(t).base,"aria-label":"go to home"},"Take me home.",8,Ff)]))}}),jf={Layout:Mf,NotFound:Uf},no=Symbol("addTab"),so=Symbol("updateTab"),ro=Symbol("deleteTab"),io=Symbol("tabsProvider");function fn(e,t){const n=_t(e,t);if(typeof n>"u")throw new Error(`Could not resolve ${e.description}`);return n}const Bf=["data-tab-id","aria-hidden"],Vf=se({__name:"Tab",props:{panelClass:{default:"tabs-component-panel"},id:{default:void 0},name:null,prefix:{default:""},suffix:{default:""},isDisabled:{type:Boolean,default:!1},navItemClass:{default:void 0},navItemLinkClass:{default:void 0}},setup(e,{expose:t}){const n=e,s=gt(!1),r=fn(io),i=fn(no),o=fn(so),l=fn(ro),a=n.prefix+n.name+n.suffix,u=n.id?n.id:n.name.toLowerCase().replace(/ /g,"-"),d=u+"-pane",_=K(()=>"#"+(n.isDisabled?"":u));return We(()=>r.activeTabHash,()=>{s.value=_.value===r.activeTabHash}),We(()=>Object.assign({},n),()=>{o(u,{name:n.name,header:n.prefix+n.name+n.suffix,isDisabled:n.isDisabled,hash:_.value,index:r.tabs.length,computedId:u,paneId:d,navItemClass:n.navItemClass,navItemLinkClass:n.navItemLinkClass})}),pi(()=>{i({name:n.name,header:a,isDisabled:n.isDisabled,hash:_.value,index:r.tabs.length,computedId:u,paneId:d,navItemClass:n.navItemClass,navItemLinkClass:n.navItemLinkClass})}),gi(()=>{l(u)}),t({header:a,computedId:u,paneId:d,hash:_,isActive:s}),(b,T)=>Tl((A(),H("section",{ref:"tab",id:d,"data-tab-id":$(u),"aria-hidden":!s.value,class:Se(e.panelClass),role:"tabpanel",tabindex:"-1"},[oe(b.$slots,"default")],10,Bf)),[[wa,s.value]])}});class Wf{get(t){const n=localStorage.getItem(t);if(n===null)return null;const s=JSON.parse(n);return s?new Date(s.expires)({useUrlFragment:!0,defaultTabHash:void 0,storageKey:void 0})},wrapperClass:{default:"tabs-component"},panelsWrapperClass:{default:"tabs-component-panels"},navClass:{default:"tabs-component-tabs"},navItemClass:{default:"tabs-component-tab"},navItemDisabledClass:{default:"is-disabled"},navItemActiveClass:{default:"is-active"},navItemInactiveClass:{default:"is-inactive"},navItemLinkClass:{default:"tabs-component-tab-a"},navItemLinkActiveClass:{default:"is-active"},navItemLinkInactiveClass:{default:"is-inactive"},navItemLinkDisabledClass:{default:"is-disabled"}},emits:["changed","clicked"],setup(e,{expose:t,emit:n}){const s=e,r=Rt({activeTabHash:"",lastActiveTabHash:"",tabs:[]});Ft(io,r),Ft(no,a=>{r.tabs.push(a)}),Ft(so,(a,u)=>{const d=r.tabs.findIndex(_=>_.computedId===a);u.isActive=r.tabs[d].isActive,r.tabs[d]=u}),Ft(ro,a=>{const u=r.tabs.findIndex(d=>d.computedId===a);r.tabs.splice(u,1)});const i=K(()=>{let a;return s.options.storageKey&&(a=s.options.storageKey),!a&&s.id&&(a=`vue-tabs-component.${s.id}.cache.${window.location.host}${window.location.pathname}`),a||(a=`vue-tabs-component.cache.${window.location.host}${window.location.pathname}`),a}),o=(a,u)=>{u&&!s.options.useUrlFragment&&u.preventDefault();const d=l(a);if(d){if(u&&d.isDisabled){u.preventDefault();return}if(r.lastActiveTabHash===d.hash){n("clicked",{tab:d});return}r.tabs.forEach(_=>{_.isActive=_.hash===d.hash}),n("changed",{tab:d}),r.lastActiveTabHash=r.activeTabHash=d.hash,!(s.cacheLifetime<=0)&&Or.set(i.value,d.hash,s.cacheLifetime)}},l=a=>r.tabs.find(u=>u.hash===a);return bt(()=>{if(r.tabs.length){if(window.addEventListener("hashchange",()=>o(window.location.hash)),l(window.location.hash)){o(window.location.hash);return}if(s.cacheLifetime>0){const a=Or.get(i.value);if(a!==null&&l(a)){o(a);return}}if(s.options.defaultTabHash&&l("#"+s.options.defaultTabHash)){o("#"+s.options.defaultTabHash);return}o(r.tabs[0].hash)}}),t({...ws(r),selectTab:o,findTab:l}),(a,u)=>(A(),H("div",{class:Se(e.wrapperClass),id:e.id},[M("ul",{role:"tablist",class:Se(e.navClass)},[(A(!0),H(de,null,Zt(r.tabs,(d,_)=>{var b,T;return A(),H("li",{key:_,class:Se([(b=d.navItemClass)!=null?b:e.navItemClass,d.isDisabled?e.navItemDisabledClass:"",d.isActive?e.navItemActiveClass:d.isDisabled?"":e.navItemInactiveClass]),role:"presentation"},[M("a",{role:"tab",class:Se([(T=d.navItemLinkClass)!=null?T:e.navItemLinkClass,d.isDisabled?e.navItemLinkDisabledClass:"",d.isActive?e.navItemLinkActiveClass:d.isDisabled?"":e.navItemLinkInactiveClass]),"aria-controls":d.paneId,"aria-selected":d.isActive,href:d.hash,onClick:F=>o(d.hash,F),innerHTML:d.header,tabindex:"0"},null,10,qf)],2)}),128))],2),M("div",{class:Se(e.panelsWrapperClass)},[oe(a.$slots,"default")],2)],10,Kf))}}),Yf={props:{id:{type:String,default:null}},computed:{anId(){return this.id+"-an"},atId(){return this.id+"-at"}}};function Gf(e,t,n,s,r,i){const o=At("tab"),l=At("tabs");return A(),H("div",null,[j(l,{options:{useUrlFragment:!1}},{default:Re(()=>[j(o,{id:i.atId,name:"Attributes"},{default:Re(()=>[oe(e.$slots,"at")]),_:3},8,["id"]),j(o,{id:i.anId,name:"Annotations"},{default:Re(()=>[oe(e.$slots,"an")]),_:3},8,["id"])]),_:3})])}var Jf=fe(Yf,[["render",Gf]]);var An={...jf,enhanceApp({app:e,router:t,siteData:n}){e.component("tabs",zf),e.component("tab",Vf),e.component("codeblock",Jf)}};const Qn=new Set,oo=()=>document.createElement("link"),Xf=e=>{const t=oo();t.rel="prefetch",t.href=e,document.head.appendChild(t)},Zf=e=>{const t=new XMLHttpRequest;t.open("GET",e,t.withCredentials=!0),t.send()};let dn;const Qf=Ne&&(dn=oo())&&dn.relList&&dn.relList.supports&&dn.relList.supports("prefetch")?Xf:Zf;function ed(){if(!Ne||!window.IntersectionObserver)return;let e;if((e=navigator.connection)&&(e.saveData||/2g/.test(e.effectiveType)))return;const t=window.requestIdleCallback||setTimeout;let n=null;const s=()=>{n&&n.disconnect(),n=new IntersectionObserver(i=>{i.forEach(o=>{if(o.isIntersecting){const l=o.target;n.unobserve(l);const{pathname:a}=l;if(!Qn.has(a)){Qn.add(a);const u=qi(a);Qf(u)}}})}),t(()=>{document.querySelectorAll("#app a").forEach(i=>{const{target:o,hostname:l,pathname:a}=i,u=a.match(/\.\w+$/);u&&u[0]!==".html"||o!=="_blank"&&l===location.hostname&&(a!==location.pathname?n.observe(i):Qn.add(a))})})};bt(s);const r=at();We(()=>r.path,s),Nn(()=>{n&&n.disconnect()})}const td=se({setup(e,{slots:t}){const n=gt(!1);return bt(()=>{n.value=!0}),()=>n.value&&t.default?t.default():null}}),nd=An.NotFound||(()=>"404 Not Found"),sd={name:"VitePressApp",setup(){const{site:e}=ve();return bt(()=>{We(()=>e.value.lang,t=>{document.documentElement.lang=t},{immediate:!0})}),ed(),()=>mt(An.Layout)}};function rd(){const e=od(),t=id();t.provide(zi,e);const n=Ga(e.route);return t.provide(Ki,n),t.component("Content",sc),t.component("ClientOnly",td),t.component("Debug",()=>null),Object.defineProperty(t.config.globalProperties,"$frontmatter",{get(){return n.frontmatter.value}}),An.enhanceApp&&An.enhanceApp({app:t,router:e,siteData:tn}),{app:t,router:e,data:n}}function id(){return Ua(sd)}function od(){let e=Ne,t;return Za(n=>{let s=qi(n);return e&&(t=s),(e||t===s)&&(s=s.replace(/\.js$/,".lean.js")),Ne?(e=!1,fo(()=>import(s),[])):require(s)},nd)}if(Ne){const{app:e,router:t,data:n}=rd();t.go().then(()=>{ec(t.route,n.site),e.mount("#app")})}export{fe as _,ld as a,j as b,H as c,rd as createApp,M as d,Qt as e,A as o,At as r,Re as w}; diff --git a/assets/guide_annotations.md.8cc52798.js b/assets/guide_annotations.md.8cc52798.js new file mode 100644 index 00000000..c561aea6 --- /dev/null +++ b/assets/guide_annotations.md.8cc52798.js @@ -0,0 +1,76 @@ +import{_ as n,c as s,o as a,a as t}from"./app.850f5e05.js";const q='{"title":"Annotations","description":"","frontmatter":{},"headers":[{"level":2,"title":"Doctrine","slug":"doctrine"},{"level":2,"title":"Escaping","slug":"escaping"},{"level":2,"title":"Arrays and Objects","slug":"arrays-and-objects"},{"level":2,"title":"Constants","slug":"constants"}],"relativePath":"guide/annotations.md"}',o={},e=t(`

Annotations

Namespace

Using a namespace alias simplifies typing and improves readability.

All annotations are in the OpenApi\\Annotations namespace.

Since Annotations are technically PHP comments, adding use OpenApi\\Annotations as OA; is strictly speaking not necessary. However, doctrine will be quite specific about whether an alias is valid or not.

swagger-php will automatically register the @OA alias so all annotations can be used using the @OA shortcut without any additional work.

Doctrine

Annotations are PHP comments (docblocks) containing doctrine style annotations.

INFO

All documentation related to doctrine applies to annotations only.

Example:

<?php
+
+use OpenApi\\Annotations as OA;
+
+/**
+ * @OA\\Info(title="My First API", version="0.1")
+ */
+class OpenApi {}
+
+class MyController {
+
+    /**
+     * @OA\\Get(
+     *     path="/api/resource.json",
+     *     @OA\\Response(response="200", description="An example resource")
+     * )
+     */
+    public function resource() {
+        // ...
+    }
+}
+

Escaping

Escaping double quotes

Double quotes can be escaped by doubling them rather than using \\

For example:

    @OA\\Schema(
+       title="Request",
+       schema="Request",
+       example={
+          "configuration":"{""formConfig"":123}"
+       }
+     )
+

Arrays and Objects

Doctrine annotations support arrays, but use { and } instead of [ and ].

Doctrine also supports objects, which also use { and } and require the property names to be surrounded with ".

DON'T WRITE

/**
+ * @OA\\Info(
+ *   title="My first API",
+ *   version="1.0.0",
+ *   contact={
+ *     "email": "support@example.com"
+ *   }
+ * )
+ */
+

This "works" but most objects have an annotation with the same name as the property, such as @OA\\Contact for contact:

WRITE

/**
+ * @OA\\Info(
+ *   title="My first API",
+ *   version="1.0.0",
+ *   @OA\\Contact(
+ *     email="support@example.com"
+ *   )
+ * )
+ */
+

This also adds validation, so when you misspell a property or forget a required property, it will trigger a PHP warning.

For example, if you write emial="support@example.com", swagger-php would generate a notice with Unexpected field "emial" for @OA\\Contact(), expecting "name", "email", ...

Placing multiple annotations of the same type will result in an array of objects. For objects, the key is defined by the field with the same name as the annotation: response in a @OA\\Response, property in a @OA\\Property, etc.

/**
+ * @OA\\Get(
+ *   path="/products",
+ *   summary="list products",
+ *   @OA\\Response(
+ *     response=200,
+ *     description="A list with products"
+ *   ),
+ *   @OA\\Response(
+ *     response="default",
+ *     description="an ""unexpected"" error"
+ *   )
+ * )
+ */
+

Results in

openapi: 3.0.0
+paths:
+  /products:
+    get:
+      summary: "list products"
+      responses:
+        "200":
+          description: "A list with products"
+        default:
+          description: 'an "unexpected" error'
+

Constants

You can use constants inside doctrine annotations.

define("API_HOST", ($env === "production") ? "example.com" : "localhost");
+
/**
+ * @OA\\Server(url=API_HOST)
+ */
+

TIP

Using the CLI you might need to include the php file with the constants using the --bootstrap options.

> openapi --bootstrap constants.php
+
`,28),p=[e];function c(i,l,u,r,d,k){return a(),s("div",null,p)}var g=n(o,[["render",c]]);export{q as __pageData,g as default}; diff --git a/assets/guide_annotations.md.8cc52798.lean.js b/assets/guide_annotations.md.8cc52798.lean.js new file mode 100644 index 00000000..2599ebb6 --- /dev/null +++ b/assets/guide_annotations.md.8cc52798.lean.js @@ -0,0 +1 @@ +import{_ as n,c as s,o as a,a as t}from"./app.850f5e05.js";const q='{"title":"Annotations","description":"","frontmatter":{},"headers":[{"level":2,"title":"Doctrine","slug":"doctrine"},{"level":2,"title":"Escaping","slug":"escaping"},{"level":2,"title":"Arrays and Objects","slug":"arrays-and-objects"},{"level":2,"title":"Constants","slug":"constants"}],"relativePath":"guide/annotations.md"}',o={},e=t("",28),p=[e];function c(i,l,u,r,d,k){return a(),s("div",null,p)}var g=n(o,[["render",c]]);export{q as __pageData,g as default}; diff --git a/assets/guide_attributes.md.3e0b725a.js b/assets/guide_attributes.md.3e0b725a.js new file mode 100644 index 00000000..2a2f80d9 --- /dev/null +++ b/assets/guide_attributes.md.3e0b725a.js @@ -0,0 +1,13 @@ +import{_ as s,c as n,o as a,a as t}from"./app.850f5e05.js";const b='{"title":"Attributes","description":"","frontmatter":{},"headers":[{"level":2,"title":"Nesting","slug":"nesting"}],"relativePath":"guide/attributes.md"}',e={},p=t(`

Attributes

Namespace

Using a namespace alias simplifies typing and improves readability.

All attributes are in the OpenApi\\Attributes namespace.

Nesting

Similar to annotations attributes can be top level or nested. However, attributes may be put at the same level if there is no ambiguity. swagger-php will then merge attributes according to the defined rules about parent/child relationships.

Example

Nested:

    #[OA\\Get(
+        path: '/api/users',
+        responses: [
+            new OA\\Response(response: 200, description: 'AOK'),
+            new OA\\Response(response: 401, description: 'Not allowed'),
+        ]
+    )]
+    public function users() { /* ... */ }
+

Not nested:

    #[OA\\Get(path: '/api/users')]
+    #[OA\\Response(response: 200, description: 'AOK')]
+    #[OA\\Response(response: 401, description: 'Not allowed')]
+    public function users() { /* ... */ }
+

Depending on how much nesting there is this can make things a bit simpler and easier to read.

Top level only

Automatic merging of attributes works only at the top level - in the example that would be the method users().

`,11),c=[p];function o(i,l,u,r,k,m){return a(),n("div",null,c)}var g=s(e,[["render",o]]);export{b as __pageData,g as default}; diff --git a/assets/guide_attributes.md.3e0b725a.lean.js b/assets/guide_attributes.md.3e0b725a.lean.js new file mode 100644 index 00000000..360addcd --- /dev/null +++ b/assets/guide_attributes.md.3e0b725a.lean.js @@ -0,0 +1 @@ +import{_ as s,c as n,o as a,a as t}from"./app.850f5e05.js";const b='{"title":"Attributes","description":"","frontmatter":{},"headers":[{"level":2,"title":"Nesting","slug":"nesting"}],"relativePath":"guide/attributes.md"}',e={},p=t("",11),c=[p];function o(i,l,u,r,k,m){return a(),n("div",null,c)}var g=s(e,[["render",o]]);export{b as __pageData,g as default}; diff --git a/assets/guide_common-techniques.md.e2af46b9.js b/assets/guide_common-techniques.md.e2af46b9.js new file mode 100644 index 00000000..dbd141c2 --- /dev/null +++ b/assets/guide_common-techniques.md.e2af46b9.js @@ -0,0 +1,216 @@ +import{_ as n,c as s,o as a,a as e}from"./app.850f5e05.js";const h='{"title":"Common techniques","description":"","frontmatter":{},"headers":[{"level":2,"title":"Annotation placement","slug":"annotation-placement"},{"level":2,"title":"Context awareness","slug":"context-awareness"},{"level":2,"title":"Response media type","slug":"response-media-type"},{"level":2,"title":"Using references - $ref","slug":"using-references-ref"},{"level":2,"title":"Array parameters in query","slug":"array-parameters-in-query"},{"level":2,"title":"Vendor extensions","slug":"vendor-extensions"},{"level":2,"title":"Enums","slug":"enums"},{"level":3,"title":"Enum cases as value","slug":"enum-cases-as-value"},{"level":2,"title":"Enum schemas","slug":"enum-schemas"}],"relativePath":"guide/common-techniques.md"}',t={},p=e(`

Common techniques

Annotation placement

You shouldn't place all annotations inside one big block, but scatter them throughout your codebase as close to the relevant source code as appropriate.

swagger-php will scan your project and merge all meta-data into one @OA\\OpenApi annotation.

WARNING

As of swagger-php v4 all annotations or attributes must be associated with a structural element (class, method, parameter or enum)

Context awareness

swagger-php looks at the context of the annotation and will augment it with things like property name, data type (doctype and native type hints) as well as a couple other things.

This means in a lot of cases it is not necessary to explicitly document all details.

Example

<?php
+
+/**
+ * @OA\\Schema()
+ */
+class Product {
+
+    /**
+     * The product name,
+     * @var string
+     * @OA\\Property()
+     */
+    public $name;
+}
+

Results in

openapi: 3.0.0
+components:
+  schemas:
+    Product:
+      properties:
+        name:
+          description: "The product name"
+          type: string
+      type: object
+

As if you'd written

    /**
+     * The product name
+     * @var string
+     *
+     * @OA\\Property(
+     *   property="name",
+     *   type="string",
+     *   description="The product name"
+     * )
+     */
+    public $name;
+

Response media type

The @OA\\MediaType is used to describe the content:

/**
+ * @OA\\Response(
+ *     response=200,
+ *     description="successful operation",
+ *     @OA\\MediaType(
+ *         mediaType="application/json",
+ *         @OA\\Schema(ref="#/components/schemas/User"),
+ *     )
+ * ),
+ */
+

But because most API requests and responses are JSON, the @OA\\JsonContent allows you to simplify this by writing:

/**
+ * @OA\\Response(
+ *     response=200,
+ *     description="successful operation",
+ *     @OA\\JsonContent(ref="#/components/schemas/User"),
+ * )
+ */
+

During processing the @OA\\JsonContent unfolds to @OA\\MediaType( mediaType="application/json", @OA\\Schema(...) and will generate the same output.

Using references - $ref

It's quite common that endpoints have some overlap in either their request or response data. To keep things DRY (Don't Repeat Yourself) the specification allows reusing components using $ref's

/**
+ * @OA\\Schema(
+ *   schema="product_id",
+ *   type="integer",
+ *   format="int64",
+ *   description="The unique identifier of a product in our catalog"
+ * )
+ */
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    product_id:
+      description: "The unique identifier of a product in our catalog"
+      type: integer
+      format: int64
+

This doesn't do anything by itself, but now you can reference this fragment by its path in the document tree #/components/schemas/product_id

    /**
+     * @OA\\Property(ref="#/components/schemas/product_id")
+     */
+    public $id;
+

Examples

There are more uses cases on how to use refs in the using-refs example.

Array parameters in query

Depending on style-values @OA\\Parameter(in="query", name="param", ...) might create urls like this: path?param=123&param=abc which do not work when reading the param values in PHP.

The solution is to change the name param into param[] which will create path?param[]=123&param[]=abc and results in a PHP array.

Vendor extensions

The specification allows for custom properties as long as they start with "x-". Therefore, all swagger-php annotations have an x property which accepts an array (map) and will unfold into "x-" properties.

/**
+ * @OA\\Info(
+ *   title="Example",
+ *   version="1.0.0",
+ *   x={
+ *     "some-name": "a-value",
+ *     "another": 2,
+ *     "complex-type": {
+ *       "supported":{
+ *         {"version": "1.0", "level": "baseapi"},
+ *         {"version": "2.1", "level": "fullapi"},
+ *       }
+ *     }
+ *   }
+ * )
+ */
+

Results in:

openapi: 3.0.0
+info:
+  title: Example
+  version: 1
+  x-some-name: a-value
+  x-another: 2
+  x-complex-type:
+    supported:
+      - version: "1.0"
+        level: baseapi
+      - version: "2.1"
+        level: fullapi
+

Enums

PHP 8.1 enums are supported in two main use cases.

Enum cases as value

Enum cases can be used as value in an enum list just like a string, integer or any other primitive type.

Basic enum:

use OpenApi\\Attributes as OAT;
+
+enum Suit
+{
+    case Hearts;
+    case Diamonds;
+    case Clubs;
+    case Spades;
+}
+
+class Model
+{
+    #[OAT\\Property(enum: [Suit::Hearts, Suit::Diamonds])]
+    protected array $someSuits;
+}
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    Model:
+      properties:
+        someSuits:
+          type: array
+          enum:
+            - Hearts
+            - Diamonds
+      type: object
+
+

Backed enums

If the enum is a backed enum, the case backing value is used instead of the name.

Enum schemas

The simples way of using enums is to annotate them as Schema. This allows you to reference them like any other schema in your spec.

use OpenApi\\Attributes as OAT;
+
+#[OAT\\Schema()]
+enum Colour
+{
+    case GREEN;
+    case BLUE;
+    case RED;
+}
+
+#[OAT\\Schema()]
+class Product
+{
+    #[OAT\\Property()]
+    public Colour $colour;
+}
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    Colour:
+      type: string
+      enum:
+        - GREEN
+        - BLUE
+        - RED
+    Product:
+      properties:
+        colour:
+          $ref: '#/components/schemas/Colour'
+      type: object
+

Backed enums

For backed enums there exist two rules that determine whether the name or backing value is used:

  1. If no schema type is given, the enum name is used.
  2. If a schema type is given, and it matches the backing type, the enum backing value is used.

Using the name of a backed enum:

use OpenApi\\Attributes as OAT;
+
+#[OAT\\Schema()]
+enum Colour: int
+{
+    case GREEN = 1;
+    case BLUE = 2;
+    case RED = 3;
+}
+
+#[OAT\\Schema()]
+class Product
+{
+    #[OAT\\Property()]
+    public Colour $colour;
+}
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    Colour:
+      type: string
+      enum:
+        - GREEN
+        - BLUE
+        - RED
+    Product:
+      properties:
+        colour:
+          $ref: '#/components/schemas/Colour'
+      type: object
+

Using the backing value:

use OpenApi\\Attributes as OAT;
+
+#[OAT\\Schema(type: 'integer')]
+enum Colour: int
+{
+    case GREEN = 1;
+    case BLUE = 2;
+    case RED = 3;
+}
+
+#[OAT\\Schema()]
+class Product
+{
+    #[OAT\\Property()]
+    public Colour $colour;
+}
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    Colour:
+      type: integer
+      enum:
+        - 1
+        - 2
+        - 3
+    Product:
+      properties:
+        colour:
+          $ref: '#/components/schemas/Colour'
+      type: object
+
`,62),o=[p];function c(l,u,i,r,k,d){return a(),s("div",null,o)}var y=n(t,[["render",c]]);export{h as __pageData,y as default}; diff --git a/assets/guide_common-techniques.md.e2af46b9.lean.js b/assets/guide_common-techniques.md.e2af46b9.lean.js new file mode 100644 index 00000000..a9637a72 --- /dev/null +++ b/assets/guide_common-techniques.md.e2af46b9.lean.js @@ -0,0 +1 @@ +import{_ as n,c as s,o as a,a as e}from"./app.850f5e05.js";const h='{"title":"Common techniques","description":"","frontmatter":{},"headers":[{"level":2,"title":"Annotation placement","slug":"annotation-placement"},{"level":2,"title":"Context awareness","slug":"context-awareness"},{"level":2,"title":"Response media type","slug":"response-media-type"},{"level":2,"title":"Using references - $ref","slug":"using-references-ref"},{"level":2,"title":"Array parameters in query","slug":"array-parameters-in-query"},{"level":2,"title":"Vendor extensions","slug":"vendor-extensions"},{"level":2,"title":"Enums","slug":"enums"},{"level":3,"title":"Enum cases as value","slug":"enum-cases-as-value"},{"level":2,"title":"Enum schemas","slug":"enum-schemas"}],"relativePath":"guide/common-techniques.md"}',t={},p=e("",62),o=[p];function c(l,u,i,r,k,d){return a(),s("div",null,o)}var y=n(t,[["render",c]]);export{h as __pageData,y as default}; diff --git a/assets/guide_cookbook.md.2d416869.js b/assets/guide_cookbook.md.2d416869.js new file mode 100644 index 00000000..714900d7 --- /dev/null +++ b/assets/guide_cookbook.md.2d416869.js @@ -0,0 +1,496 @@ +import{_ as o,c as p,b as c,w as a,a as e,r as u,o as l,d as n,e as s}from"./app.850f5e05.js";const O='{"title":"Cookbook","description":"","frontmatter":{},"headers":[{"level":2,"title":"x-tagGroups","slug":"x-taggroups"},{"level":2,"title":"Adding examples to @OA\\\\Response","slug":"adding-examples-to-oa-response"},{"level":2,"title":"External documentation","slug":"external-documentation"},{"level":2,"title":"Properties with union types","slug":"properties-with-union-types"},{"level":2,"title":"Referencing a security scheme","slug":"referencing-a-security-scheme"},{"level":2,"title":"File upload with headers","slug":"file-upload-with-headers"},{"level":2,"title":"Set the XML root name","slug":"set-the-xml-root-name"},{"level":2,"title":"upload multipart/form-data","slug":"upload-multipart-form-data"},{"level":2,"title":"Default security scheme for all endpoints","slug":"default-security-scheme-for-all-endpoints"},{"level":2,"title":"Nested objects","slug":"nested-objects"},{"level":2,"title":"Documenting union type response data using oneOf","slug":"documenting-union-type-response-data-using-oneof"},{"level":2,"title":"Reusing responses","slug":"reusing-responses"},{"level":2,"title":"mediaType=\\"/\\"","slug":"mediatype"},{"level":2,"title":"Warning about Multiple response with same response=\\"200\\"","slug":"warning-about-multiple-response-with-same-response-200"},{"level":2,"title":"Callbacks","slug":"callbacks"},{"level":2,"title":"(Mostly) virtual models","slug":"mostly-virtual-models"},{"level":2,"title":"Using class name as type instead of references","slug":"using-class-name-as-type-instead-of-references"},{"level":2,"title":"Enums","slug":"enums"},{"level":2,"title":"Multi value query parameter: &q[]=1&q[]=1","slug":"multi-value-query-parameter-q-1-q-1"},{"level":2,"title":"Custom response classes","slug":"custom-response-classes"},{"level":2,"title":"Annotating class constants","slug":"annotating-class-constants"}],"relativePath":"guide/cookbook.md"}',i={},r=e(`

Cookbook

x-tagGroups

OpenApi has the concept of grouping endpoints using tags. On top of that, some tools (redocly, for example) support further grouping via the vendor extension x-tagGroups.

/**
+ * @OA\\OpenApi(
+ *   x={
+ *       "tagGroups"=
+ *           {{"name"="User Management", "tags"={"Users", "API keys", "Admin"}}
+ *       }
+ *   }
+ * )
+ */
+

Adding examples to @OA\\Response

/*
+ * @OA\\Response(
+ *     response=200,
+ *     description="OK",
+ *     @OA\\JsonContent(
+ *         oneOf={
+ *             @OA\\Schema(ref="#/components/schemas/Result"),
+ *             @OA\\Schema(type="boolean")
+ *         },
+ *         @OA\\Examples(example="result", value={"success": true}, summary="An result object."),
+ *         @OA\\Examples(example="bool", value=false, summary="A boolean value."),
+ *     )
+ * )
+ */
+

External documentation

OpenApi allows a single reference to external documentation. This is a part of the top level @OA\\OpenApi.

/**
+ * @OA\\OpenApi(
+ *   @OA\\ExternalDocumentation(
+ *     description="More documentation here...",
+ *     url="https://example.com/externaldoc1/"
+ *   )
+ * )
+ */
+

TIP

If no @OA\\OpenApi is configured, swagger-php will create one automatically.

That means the above example would also work with just the OA\\ExternalDocumentation annotation.

/**
+ * @OA\\ExternalDocumentation(
+ *   description="More documentation here...",
+ *   url="https://example.com/externaldoc1/"
+ * )
+ */
+

Properties with union types

Sometimes properties or even lists (arrays) may contain data of different types. This can be expressed using oneOf.

/**
+ * @OA\\Schema(
+ *      schema="StringList",
+ *      @OA\\Property(property="value", type="array", @OA\\Items(anyOf={@OA\\Schema(type="string")}))
+ * )
+ * @OA\\Schema(
+ *      schema="String",
+ *      @OA\\Property(property="value", type="string")
+ * )
+ * @OA\\Schema(
+ *      schema="Object",
+ *      @OA\\Property(property="value", type="object")
+ * )
+ * @OA\\Schema(
+ *     schema="mixedList",
+ *     @OA\\Property(property="fields", type="array", @OA\\Items(oneOf={
+ *         @OA\\Schema(ref="#/components/schemas/StringList"),
+ *         @OA\\Schema(ref="#/components/schemas/String"),
+ *         @OA\\Schema(ref="#/components/schemas/Object")
+ *     }))
+ * )
+ */
+

This will resolve into this YAML

openapi: 3.0.0
+components:
+  schemas:
+    StringList:
+      properties:
+        value:
+          type: array
+          items:
+            anyOf:
+              -
+                type: string
+      type: object
+    String:
+      properties:
+        value:
+          type: string
+      type: object
+    Object:
+      properties:
+        value:
+          type: object
+      type: object
+    mixedList:
+      properties:
+        fields:
+          type: array
+          items:
+            oneOf:
+              -
+                $ref: '#/components/schemas/StringList'
+              -
+                $ref: '#/components/schemas/String'
+              -
+                $ref: '#/components/schemas/Object'
+      type: object
+

Referencing a security scheme

An API might have zero or more security schemes. These are defined at the top level and vary from simple to complex:

/**
+ * @OA\\SecurityScheme(
+ *     type="apiKey",
+ *     name="api_key",
+ *     in="header",
+ *     securityScheme="api_key"
+ * )
+ *
+ * @OA\\SecurityScheme(
+ *   type="oauth2",
+ *   securityScheme="petstore_auth",
+ *   @OA\\Flow(
+ *      authorizationUrl="http://petstore.swagger.io/oauth/dialog",
+ *      flow="implicit",
+ *      scopes={
+ *         "read:pets": "read your pets",
+ *         "write:pets": "modify pets in your account"
+ *      }
+ *   )
+ * )
+ */
+

To declare an endpoint as secure and define what security schemes are available to authenticate a client it needs to be added to the operation, for example:

/**
+ * @OA\\Get(
+ *      path="/api/secure/",
+ *      summary="Requires authentication"
+ *    ),
+ *    security={ {"api_key": {}} }
+ * )
+ */
+

Endpoints can support multiple security schemes and have custom options too:

/**
+ * @OA\\Get(
+ *      path="/api/secure/",
+ *      summary="Requires authentication"
+ *    ),
+ *    security={
+ *      { "api_key": {} },
+ *      { "petstore_auth": {"write:pets", "read:pets"} }
+ *    }
+ * )
+ */
+

File upload with headers

/**
+ * @OA\\Post(
+ *   path="/v1/media/upload",
+ *   summary="Upload document",
+ *   description="",
+ *   tags={"Media"},
+ *   @OA\\RequestBody(
+ *     required=true,
+ *     @OA\\MediaType(
+ *       mediaType="application/octet-stream",
+ *       @OA\\Schema(
+ *         required={"content"},
+ *         @OA\\Property(
+ *           description="Binary content of file",
+ *           property="content",
+ *           type="string",
+ *           format="binary"
+ *         )
+ *       )
+ *     )
+ *   ),
+ *   @OA\\Response(
+ *     response=200, description="Success",
+ *     @OA\\Schema(type="string")
+ *   ),
+ *   @OA\\Response(
+ *     response=400, description="Bad Request"
+ *   )
+ * )
+ */
+

Set the XML root name

The OA\\Xml annotation may be used to set the XML root element for a given @OA\\XmlContent response body

/**
+ * @OA\\Schema(
+ *     schema="Error",
+ *     @OA\\Property(property="message"),
+ *     @OA\\Xml(name="details")
+ * )
+ */
+
+/**
+ * @OA\\Post(
+ *     path="/foobar",
+ *     @OA\\Response(
+ *         response=400,
+ *         description="Request error",
+ *         @OA\\XmlContent(ref="#/components/schemas/Error",
+ *           @OA\\Xml(name="error")
+ *        )
+ *     )
+ * )
+ */
+

upload multipart/form-data

Form posts are @OA\\Post requests with a multipart/form-data @OA\\RequestBody. The relevant bit looks something like this

/**
+ * @OA\\Post(
+ *   path="/v1/user/update",
+ *   summary="Form post",
+ *   @OA\\RequestBody(
+ *     @OA\\MediaType(
+ *       mediaType="multipart/form-data",
+ *       @OA\\Schema(
+ *         @OA\\Property(property="name"),
+ *         @OA\\Property(
+ *           description="file to upload",
+ *           property="avatar",
+ *           type="string",
+ *           format="binary",
+ *         ),
+ *       )
+ *     )
+ *   ),
+ *   @OA\\Response(response=200, description="Success")
+ * )
+ */
+

Default security scheme for all endpoints

Unless specified each endpoint needs to declare what security schemes it supports. However, there is a way to also configure security schemes globally for the whole API.

This is done on the @OA\\OpenApi annotation:

`,32),d=n("div",{class:"language-php"},[n("pre",null,[n("code",null,[n("span",{class:"token php language-php"},[n("span",{class:"token delimiter important"},""),s(),n("span",{class:"token punctuation"},"["),n("span",{class:"token punctuation"},"]"),n("span",{class:"token punctuation"},"]"),n("span",{class:"token punctuation"},"]"),s(` +`),n("span",{class:"token punctuation"},")")]),n("span",{class:"token delimiter punctuation"},"]")]),s(` +`),n("span",{class:"token attribute"},[n("span",{class:"token delimiter punctuation"},"#["),n("span",{class:"token attribute-content"},[n("span",{class:"token attribute-class-name class-name class-name-fully-qualified"},[s("OAT"),n("span",{class:"token punctuation"},"\\"),s("Components")]),n("span",{class:"token punctuation"},"("),s(` + `),n("span",{class:"token attribute-class-name class-name"},"securitySchemes"),n("span",{class:"token punctuation"},":"),s(),n("span",{class:"token punctuation"},"["),s(` + `),n("span",{class:"token attribute-class-name class-name"},"new"),s(),n("span",{class:"token attribute-class-name class-name class-name-fully-qualified"},[s("OAT"),n("span",{class:"token punctuation"},"\\"),s("SecurityScheme")]),n("span",{class:"token punctuation"},"("),s(` + `),n("span",{class:"token attribute-class-name class-name"},"securityScheme"),n("span",{class:"token punctuation"},":"),s(),n("span",{class:"token string single-quoted-string"},"'bearerAuth'"),n("span",{class:"token punctuation"},","),s(` + `),n("span",{class:"token attribute-class-name class-name"},"type"),n("span",{class:"token punctuation"},":"),s(),n("span",{class:"token string single-quoted-string"},"'http'"),n("span",{class:"token punctuation"},","),s(` + `),n("span",{class:"token attribute-class-name class-name"},"scheme"),n("span",{class:"token punctuation"},":"),s(),n("span",{class:"token string single-quoted-string"},"'bearer'"),s(` + `),n("span",{class:"token punctuation"},")"),s(` + `),n("span",{class:"token punctuation"},"]"),s(` +`),n("span",{class:"token punctuation"},")")]),n("span",{class:"token delimiter punctuation"},"]")]),s(` +`),n("span",{class:"token keyword"},"class"),s(),n("span",{class:"token class-name-definition class-name"},"OpenApiSpec"),s(` +`),n("span",{class:"token punctuation"},"{"),s(` +`),n("span",{class:"token punctuation"},"}"),s(` +`)])])])],-1),k=n("div",{class:"language-php"},[n("pre",null,[n("code",null,[n("span",{class:"token php language-php"},[n("span",{class:"token delimiter important"},"Nested objects

Complex, nested data structures are defined by nesting @OA\\Property annotations inside others (with type="object").

/**
+ *  @OA\\Schema(
+ *    schema="Profile",
+ *    type="object",
+*
+ *    @OA\\Property(
+ *      property="Status",
+ *      type="string",
+ *      example="0"
+ *    ),
+ *
+ *    @OA\\Property(
+ *      property="Group",
+ *      type="object",
+ *
+ *      @OA\\Property(
+ *        property="ID",
+ *        description="ID de grupo",
+ *        type="number",
+ *        example=-1
+ *      ),
+ *
+ *      @OA\\Property(
+ *        property="Name",
+ *        description="Nombre de grupo",
+ *        type="string",
+ *        example="Superadmin"
+ *      )
+ *    )
+ *  )
+ */
+
+

Documenting union type response data using oneOf

A response with either a single or a list of QualificationHolder's.

/**
+ * @OA\\Response(
+ *     response=200,
+ *     @OA\\JsonContent(
+ *         oneOf={
+ *             @OA\\Schema(ref="#/components/schemas/QualificationHolder"),
+ *             @OA\\Schema(
+ *                 type="array",
+ *                 @OA\\Items(ref="#/components/schemas/QualificationHolder")
+ *             )
+ *         }
+ *     )
+ * )
+ */
+

Reusing responses

Global responses are found under /components/responses and can be referenced/shared just like schema definitions (models)

/**
+ * @OA\\Response(
+ *   response="product",
+ *   description="All information about a product",
+ *   @OA\\JsonContent(ref="#/components/schemas/Product")
+ * )
+ */
+class ProductResponse {}
+
+ // ...
+
+class ProductController
+{
+    /**
+     * @OA\\Get(
+     *   tags={"Products"},
+     *   path="/products/{product_id}",
+     *   @OA\\Response(
+     *       response="default",
+     *       ref="#/components/responses/product"
+     *   )
+     * )
+     */
+    public function getProduct($id)
+    {
+    }
+}
+

\`response\` parameter is always required

Even if referencing a shared response definition, the response parameter is still required.

mediaType="/"

Using */* as mediaType is not possible using annotations.

Example:

/**
+ * @OA\\MediaType(
+ *     mediaType="*/*",
+ *     @OA\\Schema(type="string",format="binary")
+ * )
+ */
+

The doctrine annotations library used for parsing annotations does not handle this and will interpret the */ bit as the end of the comment.

Using just * or application/octet-stream might be usable workarounds.

Warning about Multiple response with same response="200"

There are two scenarios where this can happen

  1. A single endpoint contains two responses with the same response value.
  2. There are multiple global response declared, again more than one with the same response value.

Callbacks

The API does include basic support for callbacks. However, this needs to be set up mostly manually.

Example

/**
+ *     ...
+ *
+ *     callbacks={
+ *         "onChange"={
+ *              "{$request.query.callbackUrl}"={
+ *                  "post": {
+ *                      "requestBody": @OA\\RequestBody(
+ *                          description="subscription payload",
+ *                          @OA\\MediaType(mediaType="application/json", @OA\\Schema(
+ *                              @OA\\Property(property="timestamp", type="string", format="date-time", description="time of change")
+ *                          ))
+ *                      )
+ *                  },
+ *                  "responses": {
+ *                      "202": {
+ *                          "description": "Your server implementation should return this HTTP status code if the data was received successfully"
+ *                      }
+ *                  }
+ *              }
+ *         }
+ *     }
+ *
+ *     ...
+ *
+ */
+

(Mostly) virtual models

Typically, a model is annotated by adding a @OA\\Schema annotation to the class and then individual @OA\\Property annotations to the individually declared class properties.

It is possible, however, to nest O@\\Property annotations inside a schema even without properties. In fact, all that is needed is a code anchor - e.g. an empty class.

use OpenApi\\Attributes as OA;
+
+#[OA\\Schema(
+    properties: [
+        'name' => new OA\\Property(property: 'name', type: 'string'),
+        'email' => new OA\\Property(property: 'email', type: 'string'),
+    ]
+)]
+class User {}
+

Using class name as type instead of references

Typically, when referencing schemas this is done using $ref's

#[OAT\\Schema(schema: 'user')]
+class User
+{
+}
+
+#[OAT\\Schema()]
+class Book
+{
+    /**
+     * @var User
+     */
+    #[OAT\\Property(ref: '#/components/schemas/user')]
+    public $author;
+}
+

This works, but is not very convenient.

First, when using custom schema names (schema: 'user'), this needs to be taken into account everywhere. Secondly, having to write ref: '#/components/schemas/user' is tedious and error-prone.

Using attributes all this changes as we can take advantage of PHP itself by referring to a schema by its (fully qualified) class name.

With the same User schema as before, the Book::author property could be written in a few different ways

    #[OAT\\Property()]
+    public User author;
+

or

    /**
+     * @var User
+     */
+    #[OAT\\Property()]
+    public author;
+

or

    #[OAT\\Property(type: User::class)]
+    public author;
+

Enums

As of PHP 8.1 there is native support for enum's.

swagger-php supports enums in much the same way as class names can be used to reference schemas.

Example

#[Schema()]
+enum State
+{
+    case OPEN;
+    case MERGED;
+    case DECLINED;
+}
+
+#[Schema()]
+class PullRequest
+   #[OAT\\Property()]
+   public State $state
+}
+

However, in this case the schema generated for State will be an enum:

components:
+  schemas:
+    PullRequest:
+      properties:
+        state:
+          $ref: '#/components/schemas/State'
+      type: object
+    State:
+      type: string
+      enum:
+        - OPEN
+        - MERGED
+        - DECLINED
+

Multi value query parameter: &q[]=1&q[]=1

PHP allows to have query parameters multiple times in the url and will combine the values to an array if the parameter name uses trailing []. In fact, it is possible to create nested arrays too by using more than one pair of [].

In terms of OpenAPI, the parameters can be considered a single parameter with a list of values.

/**
+ * @OA\\Get(
+ *     path="/api/endpoint",
+ *     description="The endpoint",
+ *     operationId="endpoint",
+ *     tags={"endpoints"},
+ *     @OA\\Parameter(
+ *         name="things[]",
+ *         in="query",
+ *         description="A list of things.",
+ *         required=false,
+ *         @OA\\Schema(
+ *             type="array",
+ *             @OA\\Items(type="integer")
+ *         )
+ *     ),
+ *     @OA\\Response(response="200", description="All good")
+ * )
+ */
+

The corresponding bit of the spec will look like this:

      parameters:
+        -
+          name: 'things[]'
+          in: query
+          description: 'A list of things.'
+          required: false
+          schema:
+            type: array
+            items:
+              type: integer
+

swagger-ui will show a form that allows to add/remove items (integer values in this case) to/from a list and post those values as something like ?things[]=1&things[]=2&things[]=0

Custom response classes

Even with using refs there is a bit of overhead in sharing responses. One way around that is to write your own response classes. The beauty is that in your custom __construct() method you can prefill as much as you need.

Best of all, this works for both annotations and attributes.

Example:

use OpenApi\\Attributes as OA;
+
+/**
+ * @Annotation
+ */
+#[\\Attribute(\\Attribute::TARGET_CLASS | \\Attribute::TARGET_METHOD | \\Attribute::IS_REPEATABLE)]
+class BadRequest extends OA\\Response
+{
+    public function __construct()
+    {
+        parent::__construct(response: 400, description: 'Bad request');
+    }
+}
+
+class Controller
+{
+
+    #[OA\\Get(path: '/foo', responses: [new BadRequest()])]
+    public function get()
+    {
+    }
+
+    #[OA\\Post(path: '/foo')]
+    #[BadRequest]
+    public function post()
+    {
+    }
+
+    /**
+     * @OA\\Delete(
+     *     path="/foo",
+     *     @BadRequest()
+     * )
+     */
+    public function delete()
+    {
+    }
+}
+

Annotations only?

If you are only interested in annotations you canleave out the attribute setup line (#[\\Attribute...) for BadRequest.

Furthermore, your custom annotations should extend from the OpenApi\\Annotations namespace.

Annotating class constants

use OpenApi\\Attributes as OA;
+
+#[OA\\Schema()]
+class Airport
+{
+    #[OA\\Property(property='kind')]
+    public const KIND = 'Airport';
+}
+

The const property is supported in OpenApi 3.1.0.

components:
+  schemas:
+    Airport:
+        properties:
+          kind:
+            type: string
+            const: Airport
+

For 3.0.0 this is serialized into a single value enum.

components:
+  schemas:
+    Airport:
+        properties:
+          kind:
+            type: string
+            enum:
+              - Airport
+
`,65);function h(y,q,g,f,b,A){const t=u("codeblock");return l(),p("div",null,[r,c(t,{id:"minimal"},{at:a(()=>[d]),an:a(()=>[k]),_:1}),m])}var w=o(i,[["render",h]]);export{O as __pageData,w as default}; diff --git a/assets/guide_cookbook.md.2d416869.lean.js b/assets/guide_cookbook.md.2d416869.lean.js new file mode 100644 index 00000000..96dc2d0d --- /dev/null +++ b/assets/guide_cookbook.md.2d416869.lean.js @@ -0,0 +1,38 @@ +import{_ as o,c as p,b as c,w as a,a as e,r as u,o as l,d as n,e as s}from"./app.850f5e05.js";const O='{"title":"Cookbook","description":"","frontmatter":{},"headers":[{"level":2,"title":"x-tagGroups","slug":"x-taggroups"},{"level":2,"title":"Adding examples to @OA\\\\Response","slug":"adding-examples-to-oa-response"},{"level":2,"title":"External documentation","slug":"external-documentation"},{"level":2,"title":"Properties with union types","slug":"properties-with-union-types"},{"level":2,"title":"Referencing a security scheme","slug":"referencing-a-security-scheme"},{"level":2,"title":"File upload with headers","slug":"file-upload-with-headers"},{"level":2,"title":"Set the XML root name","slug":"set-the-xml-root-name"},{"level":2,"title":"upload multipart/form-data","slug":"upload-multipart-form-data"},{"level":2,"title":"Default security scheme for all endpoints","slug":"default-security-scheme-for-all-endpoints"},{"level":2,"title":"Nested objects","slug":"nested-objects"},{"level":2,"title":"Documenting union type response data using oneOf","slug":"documenting-union-type-response-data-using-oneof"},{"level":2,"title":"Reusing responses","slug":"reusing-responses"},{"level":2,"title":"mediaType=\\"/\\"","slug":"mediatype"},{"level":2,"title":"Warning about Multiple response with same response=\\"200\\"","slug":"warning-about-multiple-response-with-same-response-200"},{"level":2,"title":"Callbacks","slug":"callbacks"},{"level":2,"title":"(Mostly) virtual models","slug":"mostly-virtual-models"},{"level":2,"title":"Using class name as type instead of references","slug":"using-class-name-as-type-instead-of-references"},{"level":2,"title":"Enums","slug":"enums"},{"level":2,"title":"Multi value query parameter: &q[]=1&q[]=1","slug":"multi-value-query-parameter-q-1-q-1"},{"level":2,"title":"Custom response classes","slug":"custom-response-classes"},{"level":2,"title":"Annotating class constants","slug":"annotating-class-constants"}],"relativePath":"guide/cookbook.md"}',i={},r=e("",32),d=n("div",{class:"language-php"},[n("pre",null,[n("code",null,[n("span",{class:"token php language-php"},[n("span",{class:"token delimiter important"},""),s(),n("span",{class:"token punctuation"},"["),n("span",{class:"token punctuation"},"]"),n("span",{class:"token punctuation"},"]"),n("span",{class:"token punctuation"},"]"),s(` +`),n("span",{class:"token punctuation"},")")]),n("span",{class:"token delimiter punctuation"},"]")]),s(` +`),n("span",{class:"token attribute"},[n("span",{class:"token delimiter punctuation"},"#["),n("span",{class:"token attribute-content"},[n("span",{class:"token attribute-class-name class-name class-name-fully-qualified"},[s("OAT"),n("span",{class:"token punctuation"},"\\"),s("Components")]),n("span",{class:"token punctuation"},"("),s(` + `),n("span",{class:"token attribute-class-name class-name"},"securitySchemes"),n("span",{class:"token punctuation"},":"),s(),n("span",{class:"token punctuation"},"["),s(` + `),n("span",{class:"token attribute-class-name class-name"},"new"),s(),n("span",{class:"token attribute-class-name class-name class-name-fully-qualified"},[s("OAT"),n("span",{class:"token punctuation"},"\\"),s("SecurityScheme")]),n("span",{class:"token punctuation"},"("),s(` + `),n("span",{class:"token attribute-class-name class-name"},"securityScheme"),n("span",{class:"token punctuation"},":"),s(),n("span",{class:"token string single-quoted-string"},"'bearerAuth'"),n("span",{class:"token punctuation"},","),s(` + `),n("span",{class:"token attribute-class-name class-name"},"type"),n("span",{class:"token punctuation"},":"),s(),n("span",{class:"token string single-quoted-string"},"'http'"),n("span",{class:"token punctuation"},","),s(` + `),n("span",{class:"token attribute-class-name class-name"},"scheme"),n("span",{class:"token punctuation"},":"),s(),n("span",{class:"token string single-quoted-string"},"'bearer'"),s(` + `),n("span",{class:"token punctuation"},")"),s(` + `),n("span",{class:"token punctuation"},"]"),s(` +`),n("span",{class:"token punctuation"},")")]),n("span",{class:"token delimiter punctuation"},"]")]),s(` +`),n("span",{class:"token keyword"},"class"),s(),n("span",{class:"token class-name-definition class-name"},"OpenApiSpec"),s(` +`),n("span",{class:"token punctuation"},"{"),s(` +`),n("span",{class:"token punctuation"},"}"),s(` +`)])])])],-1),k=n("div",{class:"language-php"},[n("pre",null,[n("code",null,[n("span",{class:"token php language-php"},[n("span",{class:"token delimiter important"},"[d]),an:a(()=>[k]),_:1}),m])}var w=o(i,[["render",h]]);export{O as __pageData,w as default}; diff --git a/assets/guide_faq.md.b1f45c64.js b/assets/guide_faq.md.b1f45c64.js new file mode 100644 index 00000000..e148b439 --- /dev/null +++ b/assets/guide_faq.md.b1f45c64.js @@ -0,0 +1,88 @@ +import{_ as n,c as e,o as a,a as s}from"./app.850f5e05.js";const k='{"title":"FAQ","description":"","frontmatter":{},"headers":[{"level":2,"title":"Warning: Required @OA\\\\Info() not found","slug":"warning-required-oa-info-not-found"},{"level":2,"title":"Annotations missing","slug":"annotations-missing"},{"level":2,"title":"Skipping unknown \\\\SomeClass","slug":"skipping-unknown-someclass"},{"level":3,"title":"Using the -b --bootstrap option","slug":"using-the-b-bootstrap-option"},{"level":3,"title":"Namespace mismatch","slug":"namespace-mismatch"},{"level":2,"title":"No output from openapi command line tool","slug":"no-output-from-openapi-command-line-tool"}],"relativePath":"guide/faq.md"}',t={},o=s(`

FAQ

Warning: Required @OA\\Info() not found

With adding support for PHP attributes in version 4, some architectural changes had to be made.

One of those changes is that placing annotations in your source files is now subject to the same limitations as attributes. These limits are dictated by the PHP reflection API, specifically where it provides access to attributes and doc comments.

This means stand-alone annotations are no longer supported and ignored as swagger-php cannot "see" them any more.

Supported locations:

  • class
  • interface
  • trait
  • method
  • property
  • class/interface const

Most commonly this manifests with a warning about the required @OA\\Info not being found. While most annotations have specific related code, the info annotation (and a few more) is kind of global.

The simplest solution to avoid this issue is to add a 'dummy' class to the docblock and add all 'global' annotations (e.g. Tag, Server, SecurityScheme, etc.) in a single docblock to that class.

/**
+ * @OA\\Tag(
+ *     name="user",
+ *     description="User related operations"
+ * )
+ * @OA\\Info(
+ *     version="1.0",
+ *     title="Example API",
+ *     description="Example info",
+ *     @OA\\Contact(name="Swagger API Team")
+ * )
+ * @OA\\Server(
+ *     url="https://example.localhost",
+ *     description="API server"
+ * )
+ */
+class OpenApiSpec
+{
+}
+

As of version 4.8 the doctrine/annotations library is optional and might cause the same message.

If this is the case, doctrine annotations must be installed separately:

composer require doctrine/annotations
+

Annotations missing

Another side effect of using reflection is that swagger-php "can't see" multiple consecutive docblocks any more as the PHP reflection API only provides access to the docblock closest to a given structural element.

class Controller
+{
+    /**
+     * @OA\\Delete(
+     *      path="/api/v0.0.2/notifications/{id}",
+     *      operationId="deleteNotificationById",
+     *      summary="Delete notification by ID",
+     *      @OA\\Parameter(name="id", in="path", @OA\\Schema(type="integer")),
+     *      @OA\\Response(response=200, description="OK"),
+     *      @OA\\Response(response=400, description="Bad Request")
+     * )
+     */
+    /**
+     * Delete notification by ID.
+     *
+     * @param Request $request
+     * @param AppNotification $notification
+     *
+     * @return Response
+     * @throws Exception
+     */
+    public function destroy(Request $request, AppNotification $notification) {
+        //
+    }
+}
+

In this case the simplest solution is to merge both docblocks. As an additional benefit the duplication of the summary can be avoided.

In this improved version swagger-php will automatically use the docblock summary just as explicitly done above.

class Controller
+{
+    /**
+     * Delete notification by ID.
+     *
+     * @OA\\Delete(
+     *      path="/api/v0.0.2/notifications/{id}",
+     *      operationId="deleteNotificationById",
+     *      @OA\\Parameter(name="id", in="path", @OA\\Schema(type="integer")),
+     *      @OA\\Response(response=200, description="OK"),
+     *      @OA\\Response(response=400, description="Bad Request")
+     * )
+     *
+     * @param Request $request
+     * @param AppNotification $notification
+     *
+     * @return Response
+     * @throws Exception
+     */
+    public function destroy(Request $request, AppNotification $notification) {
+        //
+    }
+}
+

Resulting spec:

openapi: 3.0.0
+paths:
+  '/api/v0.0.2/notifications/{id}':
+    delete:
+      summary: 'XDelete notification by ID.'
+      operationId: deleteNotificationById
+      parameters:
+        -
+          name: id
+          in: path
+          schema:
+            type: integer
+      responses:
+        '200':
+          description: OK
+        '400':
+          description: 'Bad Request'
+
+

Skipping unknown \\SomeClass

This message means that swagger-php has tried to use reflection to inspect \\SomeClass and that PHP could not find/load that class. Effectively, this means that class_exists("\\SomeClass") returns false.

Using the -b --bootstrap option

There are a number of reasons why this could happen. If you are using the openapi command line tool from a global installation typically the application classloader (composer) is not active. With you application root being myapp you could try:

openapi -b myapp/vendor/autoload.php myapp/src
+

The -b allows to execute some extra PHP code to load whatever is needed to register your apps classloader with PHP.

Namespace mismatch

Another reason for this error could be that your class actually has the wrong namespace (or no namespace at all!).

Depending on your framework this might still work in the context of your app, but the composer autoloader alone might not be able to load your class (assuming you are using composer).

No output from openapi command line tool

Depending on your PHP configuration, running the openapi command line tool might result in no output at all.

The reason for this is that openapi currently uses the error_log function for all output.

So if this is configured to write to a file, then it will seem like the command is broken.

`,34),i=[o];function p(c,l,r,u,d,h){return a(),e("div",null,i)}var f=n(t,[["render",p]]);export{k as __pageData,f as default}; diff --git a/assets/guide_faq.md.b1f45c64.lean.js b/assets/guide_faq.md.b1f45c64.lean.js new file mode 100644 index 00000000..bd3ee232 --- /dev/null +++ b/assets/guide_faq.md.b1f45c64.lean.js @@ -0,0 +1 @@ +import{_ as n,c as e,o as a,a as s}from"./app.850f5e05.js";const k='{"title":"FAQ","description":"","frontmatter":{},"headers":[{"level":2,"title":"Warning: Required @OA\\\\Info() not found","slug":"warning-required-oa-info-not-found"},{"level":2,"title":"Annotations missing","slug":"annotations-missing"},{"level":2,"title":"Skipping unknown \\\\SomeClass","slug":"skipping-unknown-someclass"},{"level":3,"title":"Using the -b --bootstrap option","slug":"using-the-b-bootstrap-option"},{"level":3,"title":"Namespace mismatch","slug":"namespace-mismatch"},{"level":2,"title":"No output from openapi command line tool","slug":"no-output-from-openapi-command-line-tool"}],"relativePath":"guide/faq.md"}',t={},o=s("",34),i=[o];function p(c,l,r,u,d,h){return a(),e("div",null,i)}var f=n(t,[["render",p]]);export{k as __pageData,f as default}; diff --git a/assets/guide_generating-openapi-documents.md.9bb1fdd6.js b/assets/guide_generating-openapi-documents.md.9bb1fdd6.js new file mode 100644 index 00000000..2ae51bc6 --- /dev/null +++ b/assets/guide_generating-openapi-documents.md.9bb1fdd6.js @@ -0,0 +1,30 @@ +import{_ as a,c as n,o as s,a as e}from"./app.850f5e05.js";const m='{"title":"Generating OpenAPI documents","description":"","frontmatter":{},"headers":[{"level":2,"title":"./bin/openapi","slug":"bin-openapi"},{"level":2,"title":"Using PHP","slug":"using-php"}],"relativePath":"guide/generating-openapi-documents.md"}',t={},p=e(`

Generating OpenAPI documents

./bin/openapi

swagger-php includes a command line tool ./bin/openapi. This can be used to generate OpenAPI documents.

> ./vendor/bin/openapi app -o openapi.yaml
+

Output Format

By default the output format is YAML. If a filename is given (via --output or -o) the tool will use the file extension to determine the format.

The --format option can be used to force a specific format.

For a list of all available options use the -h option

> ./bin/openapi -h
+
+Usage: openapi [--option value] [/path/to/project ...]
+
+Options:
+  --config (-c)     Generator config
+                    ex: -c operationId.hash=false
+  --legacy (-l)     Use legacy TokenAnalyser; default is the new ReflectionAnalyser
+  --output (-o)     Path to store the generated documentation.
+                    ex: --output openapi.yaml
+  --exclude (-e)    Exclude path(s).
+                    ex: --exclude vendor,library/Zend
+  --pattern (-n)    Pattern of files to scan.
+                    ex: --pattern "*.php" or --pattern "/\\.(phps|php)$/"
+  --bootstrap (-b)  Bootstrap a php file for defining constants, etc.
+                    ex: --bootstrap config/constants.php
+  --processor (-p)  Register an additional processor.
+  --format (-f)     Force yaml or json.
+  --debug (-d)      Show additional error information.
+  --version         The OpenAPI version; defaults to 3.0.0.
+  --help (-h)       Display this help message.
+

Using PHP

Depending on your use case PHP code can also be used to generate OpenAPI documents in a more dynamic way.

In its simplest form this may look something like

<?php
+require("vendor/autoload.php");
+
+$openapi = \\OpenApi\\Generator::scan(['/path/to/project']);
+
+header('Content-Type: application/x-yaml');
+echo $openapi->toYaml();
+

Programming API

Details about the swagger-php API can be found in the reference.

`,12),o=[p];function c(i,l,r,u,d,k){return s(),n("div",null,o)}var g=a(t,[["render",c]]);export{m as __pageData,g as default}; diff --git a/assets/guide_generating-openapi-documents.md.9bb1fdd6.lean.js b/assets/guide_generating-openapi-documents.md.9bb1fdd6.lean.js new file mode 100644 index 00000000..888f4a9c --- /dev/null +++ b/assets/guide_generating-openapi-documents.md.9bb1fdd6.lean.js @@ -0,0 +1 @@ +import{_ as a,c as n,o as s,a as e}from"./app.850f5e05.js";const m='{"title":"Generating OpenAPI documents","description":"","frontmatter":{},"headers":[{"level":2,"title":"./bin/openapi","slug":"bin-openapi"},{"level":2,"title":"Using PHP","slug":"using-php"}],"relativePath":"guide/generating-openapi-documents.md"}',t={},p=e("",12),o=[p];function c(i,l,r,u,d,k){return s(),n("div",null,o)}var g=a(t,[["render",c]]);export{m as __pageData,g as default}; diff --git a/assets/guide_index.md.29bf901a.js b/assets/guide_index.md.29bf901a.js new file mode 100644 index 00000000..a107b24b --- /dev/null +++ b/assets/guide_index.md.29bf901a.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as o}from"./app.850f5e05.js";const m='{"title":"What is Swagger-PHP?","description":"","frontmatter":{},"headers":[],"relativePath":"guide/index.md"}',n={},s=o('

What is Swagger-PHP?

swagger-php is a library that extracts API metadata from your PHP source code files.

The idea is to add swagger-php annotations or attributes next to the relevant PHP code in your application. These will contain the details about your API and swagger-php will convert those into machine-readable OpenAPI documentation.

By adding your API documentation next to the corresponding source code (same file!) makes it easy to keep it up-to-date as all details can be modified in one place.

Annotating vs. Annotations

When talking about annotating your code we mean the act of adding meta-data to your codebase. This can be done by either adding Annotations or Attributes.

Requirements

Using swagger-php requires a minimum of PHP\xA07.2 for using annotations and at least PHP\xA08.1 to use attributes.

',6),i=[s];function r(c,d,p,h,l,g){return a(),t("div",null,i)}var _=e(n,[["render",r]]);export{m as __pageData,_ as default}; diff --git a/assets/guide_index.md.29bf901a.lean.js b/assets/guide_index.md.29bf901a.lean.js new file mode 100644 index 00000000..04b522b3 --- /dev/null +++ b/assets/guide_index.md.29bf901a.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as o}from"./app.850f5e05.js";const m='{"title":"What is Swagger-PHP?","description":"","frontmatter":{},"headers":[],"relativePath":"guide/index.md"}',n={},s=o("",6),i=[s];function r(c,d,p,h,l,g){return a(),t("div",null,i)}var _=e(n,[["render",r]]);export{m as __pageData,_ as default}; diff --git a/assets/guide_installation.md.34074778.js b/assets/guide_installation.md.34074778.js new file mode 100644 index 00000000..4392067d --- /dev/null +++ b/assets/guide_installation.md.34074778.js @@ -0,0 +1,3 @@ +import{_ as e,c as a,o,a as t}from"./app.850f5e05.js";const u='{"title":"Installation","description":"","frontmatter":{},"headers":[{"level":2,"title":"Per project","slug":"per-project"},{"level":2,"title":"Globally","slug":"globally"}],"relativePath":"guide/installation.md"}',r={},l=t(`

Installation

Per project

We recommend adding swagger-php to your project using Composer

> composer require zircote/swagger-php
+

Globally

Alternatively, use the composer global argument to install swagger-php globally.

> composer global require zircote/swagger-php
+

PATH variables

Remember to add the ~/.composer/vendor/bin directory to the PATH in your environment.

`,8),s=[l];function n(c,i,p,d,h,g){return o(),a("div",null,s)}var m=e(r,[["render",n]]);export{u as __pageData,m as default}; diff --git a/assets/guide_installation.md.34074778.lean.js b/assets/guide_installation.md.34074778.lean.js new file mode 100644 index 00000000..d7ffffb5 --- /dev/null +++ b/assets/guide_installation.md.34074778.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o,a as t}from"./app.850f5e05.js";const u='{"title":"Installation","description":"","frontmatter":{},"headers":[{"level":2,"title":"Per project","slug":"per-project"},{"level":2,"title":"Globally","slug":"globally"}],"relativePath":"guide/installation.md"}',r={},l=t("",8),s=[l];function n(c,i,p,d,h,g){return o(),a("div",null,s)}var m=e(r,[["render",n]]);export{u as __pageData,m as default}; diff --git a/assets/guide_migrating-to-v3.md.549bb338.js b/assets/guide_migrating-to-v3.md.549bb338.js new file mode 100644 index 00000000..a9fe0188 --- /dev/null +++ b/assets/guide_migrating-to-v3.md.549bb338.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a as o}from"./app.850f5e05.js";const u='{"title":"Migrating to v3","description":"","frontmatter":{},"headers":[{"level":2,"title":"The default output changed from json to yaml","slug":"the-default-output-changed-from-json-to-yaml"},{"level":2,"title":"Updated CLI","slug":"updated-cli"},{"level":2,"title":"Changed annotations","slug":"changed-annotations"},{"level":3,"title":"SWG is renamed to OA","slug":"swg-is-renamed-to-oa"},{"level":3,"title":"@SWG\\\\Swagger() is renamed to @OA\\\\OpenApi()","slug":"swg-swagger-is-renamed-to-oa-openapi"},{"level":3,"title":"@SWG\\\\Path() is renamed to @OA\\\\PathItem()","slug":"swg-path-is-renamed-to-oa-pathitem"},{"level":3,"title":"@SWG\\\\Definition() is removed","slug":"swg-definition-is-removed"},{"level":3,"title":"@SWG\\\\Path is removed","slug":"swg-path-is-removed"},{"level":3,"title":"Consumes, produces field is removed from OpenAPI specification","slug":"consumes-produces-field-is-removed-from-openapi-specification"},{"level":3,"title":"Rename parameter references","slug":"rename-parameter-references"},{"level":3,"title":"Rename response references","slug":"rename-response-references"},{"level":3,"title":"Renamed cli","slug":"renamed-cli"},{"level":3,"title":"More details about differences:","slug":"more-details-about-differences"}],"relativePath":"guide/migrating-to-v3.md"}',r={},i=o('

Migrating to v3

Swagger-PHP 3.x generates an openapi.json file that follows the OpenAPI Version 3.0.x Specification.

If you need to output the older 2.x specification use OpenApi-php 2.x

The default output changed from json to yaml

This aligns better with the direction of the swagger documentation and examples. Annotations can't be used as string anymore, you'll need to call toYaml() or toJson() if you prefer the json format.

Updated CLI

  • Added colors
  • No output for successful execution (Removed summary)
  • non-zero exit when an error occurred.
  • Defaults to yaml
  • Defaults to stdout. To save to openapi.yaml use -o or >

Changed annotations

SWG is renamed to OA

The namespace is renamed from SWG (Swagger) to OA (OpenApi)

@SWG\\Swagger() is renamed to @OA\\OpenApi()

@SWG\\Path() is renamed to @OA\\PathItem()

The specification uses the term "Path Item Object", updated the annotation to reflect that.

@SWG\\Definition() is removed

Use @OA\\Schema() instead of @OA\\Definition() and update the references from "#/definitions/something" to "#/components/schemas/something".

@SWG\\Path is removed

Use @OA\\PathItem instead of @SWG\\Path and update references.

Consumes, produces field is removed from OpenAPI specification

Use @OA\\MediaType to set data format.

Rename parameter references

Rename #/parameters/{parameter_name} to #/components/parameters/{parameter_name}

Rename response references

Rename #/responses/{response} to #/components/responses/{response}

Renamed cli

Renamed swagger to openapi

More details about differences:

A Visual Guide to What's New in Swagger 3.0

',27),n=[i];function s(d,h,l,c,p,m){return t(),a("div",null,n)}var g=e(r,[["render",s]]);export{u as __pageData,g as default}; diff --git a/assets/guide_migrating-to-v3.md.549bb338.lean.js b/assets/guide_migrating-to-v3.md.549bb338.lean.js new file mode 100644 index 00000000..811c6f3e --- /dev/null +++ b/assets/guide_migrating-to-v3.md.549bb338.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a as o}from"./app.850f5e05.js";const u='{"title":"Migrating to v3","description":"","frontmatter":{},"headers":[{"level":2,"title":"The default output changed from json to yaml","slug":"the-default-output-changed-from-json-to-yaml"},{"level":2,"title":"Updated CLI","slug":"updated-cli"},{"level":2,"title":"Changed annotations","slug":"changed-annotations"},{"level":3,"title":"SWG is renamed to OA","slug":"swg-is-renamed-to-oa"},{"level":3,"title":"@SWG\\\\Swagger() is renamed to @OA\\\\OpenApi()","slug":"swg-swagger-is-renamed-to-oa-openapi"},{"level":3,"title":"@SWG\\\\Path() is renamed to @OA\\\\PathItem()","slug":"swg-path-is-renamed-to-oa-pathitem"},{"level":3,"title":"@SWG\\\\Definition() is removed","slug":"swg-definition-is-removed"},{"level":3,"title":"@SWG\\\\Path is removed","slug":"swg-path-is-removed"},{"level":3,"title":"Consumes, produces field is removed from OpenAPI specification","slug":"consumes-produces-field-is-removed-from-openapi-specification"},{"level":3,"title":"Rename parameter references","slug":"rename-parameter-references"},{"level":3,"title":"Rename response references","slug":"rename-response-references"},{"level":3,"title":"Renamed cli","slug":"renamed-cli"},{"level":3,"title":"More details about differences:","slug":"more-details-about-differences"}],"relativePath":"guide/migrating-to-v3.md"}',r={},i=o("",27),n=[i];function s(d,h,l,c,p,m){return t(),a("div",null,n)}var g=e(r,[["render",s]]);export{u as __pageData,g as default}; diff --git a/assets/guide_migrating-to-v4.md.714a0f1b.js b/assets/guide_migrating-to-v4.md.714a0f1b.js new file mode 100644 index 00000000..85b879be --- /dev/null +++ b/assets/guide_migrating-to-v4.md.714a0f1b.js @@ -0,0 +1,48 @@ +import{_ as a,c as n,o as s,a as e}from"./app.850f5e05.js";const m='{"title":"Migrating to v4","description":"","frontmatter":{},"headers":[{"level":2,"title":"Overview","slug":"overview"},{"level":2,"title":"Annotations as PHP attributes","slug":"annotations-as-php-attributes"},{"level":3,"title":"Using annotations","slug":"using-annotations"},{"level":3,"title":"Using attributes","slug":"using-attributes"},{"level":2,"title":"Optional nesting","slug":"optional-nesting"},{"level":2,"title":"Annotations must be associated with a structural element","slug":"annotations-must-be-associated-with-a-structural-element"},{"level":2,"title":"The PathParameter annotation","slug":"the-pathparameter-annotation"},{"level":2,"title":"The Attachable annotation","slug":"the-attachable-annotation"},{"level":2,"title":"Removed deprecated elements","slug":"removed-deprecated-elements"},{"level":3,"title":"\\\\Openapi\\\\Analysis::processors()","slug":"openapi-analysis-processors"},{"level":3,"title":"\\\\Openapi\\\\Analyser::$whitelist","slug":"openapi-analyser-whitelist"},{"level":3,"title":"\\\\Openapi\\\\Analyser::$defaultImports","slug":"openapi-analyser-defaultimports"},{"level":3,"title":"\\\\Openapi\\\\Logger","slug":"openapi-logger"},{"level":2,"title":"Improvements to the Generator class","slug":"improvements-to-the-generator-class"}],"relativePath":"guide/migrating-to-v4.md"}',t={},o=e(`

Migrating to v4

Overview

  • As of PHP 8.1 annotations may be used as PHP attributes instead. That means all references to annotations in this document also apply to attributes.
  • If you haven't switched to attributes yet, the Doctrine annotations library must be installed manually: composer require doctrine/annotations
  • Annotations now must be associated with a structural element (class, trait, interface), a method, property or const.
  • A new annotation PathParameter was added for improved framework support.
  • A new annotation Attachable was added to simplify custom processing. Attachable can be used to attach arbitrary data to any given annotation.
  • Deprecated elements have been removed
    • \\Openapi\\Analysis::processors()
    • \\Openapi\\Analyser::$whitelist
    • \\Openapi\\Analyser::$defaultImports
    • \\Openapi\\Logger
  • Legacy support is available via the previous TokenAnalyser
  • Improvements to the Generator class

Annotations as PHP attributes

While PHP attributes have been around since PHP 8.0 they were lacking the ability to be nested. This changes with PHP 8.1 which allows to use new in initializers.

Swagger-php attributes also make use of named arguments, so attribute parameters can be (mostly) typed. There are some limitations to type hints which can only be resolved once support for PHP 7.x is dropped.

Using annotations


+use OpenApi\\Annotations as OA;
+
+/**
+ * @OA\\Info(
+ *   version="1.0.0",
+ *   title="My API",
+ *   @OA\\License(name="MIT"),
+ *   @OA\\Attachable()
+ * )
+ */
+class OpenApiSpec
+{
+}
+

Using attributes


+use OpenApi\\Attributes as OA;
+
+#[OA\\Info(
+    version: '1.0.0',
+    title: 'My API',
+    attachables: [new OA\\Attachable()]
+)]
+#[OA\\License(name: 'MIT')]
+class OpenApiSpec
+{
+}
+

Optional nesting

One of the few differences between annotations and attributes visible in the above example is that the OA\\License attribute is not nested within OA\\Info. Nesting of attributes is possible and required in certain cases however, in cases where there is no ambiguity attributes may be all written on the top level and swagger-php will do the rest.

Annotations must be associated with a structural element

The (now legacy) way of parsing PHP files meant that docblocks could live in a file without a single line of actual PHP code.

PHP Attributes cannot exist in isolation; they need code to be associated with and then are available via reflection on the associated structural element. In order to allow to keep supporting annotations and the code simple it made sense to treat annotations and attributes the same in this respect.

The PathParameter annotation

As annotation this is just a short form for

   @OA\\Parameter(in='body')
+

Things get more interesting when it comes to using it as attribute, though. In the context of a controller you can now do something like

class MyController
+{
+    #[OA\\Get(path: '/products/{product_id}')]
+    public function getProduct(
+        #[OA\\PathParameter] string $product_id)
+    {
+    }
+}
+

Here it avoids having to duplicate details about the $product_id parameter and the simple use of the attribute will pick up typehints automatically.

The Attachable annotation

Technically these were added in version 3.3.0, however they become really useful only with version 4.

The attachable annotation is similar to the OpenApi vendor extension x=. The main difference are that

  1. Attachables allow complex structures and strong typing
  2. Attachables are not added to the generated spec.

Their main purpose is to make customizing swagger-php easier by allowing to add arbitrary data to any annotation.

One possible use case could be custom annotations. Classes extending Attachable are allowed to limit the allowed parent annotations. This means it would be easy to create a new attribute to flag certain endpoints as private and exclude them under certain conditions from the spec (via a custom processor).

Removed deprecated elements

\\Openapi\\Analysis::processors()

Processors have been moved into the Generator class incl. some new convenience methods.

\\Openapi\\Analyser::$whitelist

This has been replaced with the Generator namespaces property.

\\Openapi\\Analyser::$defaultImports

This has been replaced with the Generator aliases property.

\\Openapi\\Logger

This class has been removed completely. Instead, you may configure a PSR-3 logger.

Improvements to the Generator class

The removal of deprecated static config options means that the Generator class now is the main entry point into swagger-php when used programmatically.

To make the migration as simple as possible a new Generator::withContext(callable) has been added. This allows to use parts of the library (an Analyser instance, for example) within the context of a Generator instance.

Example:

$analyser = createMyAnalyser();
+
+$analysis = (new Generator())
+    ->addAlias('fo', 'My\\\\Attribute\\\\Namespace')
+    ->addNamespace('Other\\\\Annotations\\\\')
+    ->withContext(function (Generator $generator, Analysis $analysis, Context $context) use ($analyser) {
+        $analyser->setGenerator($generator);
+        $analysis = $analyser->fromFile('my_code.php', $context);
+        $analysis->process($generator->getProcessors());
+
+        return $analysis;
+    });
+
`,41),p=[o];function i(c,l,r,u,d,h){return s(),n("div",null,p)}var g=a(t,[["render",i]]);export{m as __pageData,g as default}; diff --git a/assets/guide_migrating-to-v4.md.714a0f1b.lean.js b/assets/guide_migrating-to-v4.md.714a0f1b.lean.js new file mode 100644 index 00000000..63e4e9f4 --- /dev/null +++ b/assets/guide_migrating-to-v4.md.714a0f1b.lean.js @@ -0,0 +1 @@ +import{_ as a,c as n,o as s,a as e}from"./app.850f5e05.js";const m='{"title":"Migrating to v4","description":"","frontmatter":{},"headers":[{"level":2,"title":"Overview","slug":"overview"},{"level":2,"title":"Annotations as PHP attributes","slug":"annotations-as-php-attributes"},{"level":3,"title":"Using annotations","slug":"using-annotations"},{"level":3,"title":"Using attributes","slug":"using-attributes"},{"level":2,"title":"Optional nesting","slug":"optional-nesting"},{"level":2,"title":"Annotations must be associated with a structural element","slug":"annotations-must-be-associated-with-a-structural-element"},{"level":2,"title":"The PathParameter annotation","slug":"the-pathparameter-annotation"},{"level":2,"title":"The Attachable annotation","slug":"the-attachable-annotation"},{"level":2,"title":"Removed deprecated elements","slug":"removed-deprecated-elements"},{"level":3,"title":"\\\\Openapi\\\\Analysis::processors()","slug":"openapi-analysis-processors"},{"level":3,"title":"\\\\Openapi\\\\Analyser::$whitelist","slug":"openapi-analyser-whitelist"},{"level":3,"title":"\\\\Openapi\\\\Analyser::$defaultImports","slug":"openapi-analyser-defaultimports"},{"level":3,"title":"\\\\Openapi\\\\Logger","slug":"openapi-logger"},{"level":2,"title":"Improvements to the Generator class","slug":"improvements-to-the-generator-class"}],"relativePath":"guide/migrating-to-v4.md"}',t={},o=e("",41),p=[o];function i(c,l,r,u,d,h){return s(),n("div",null,p)}var g=a(t,[["render",i]]);export{m as __pageData,g as default}; diff --git a/assets/guide_required-elements.md.ef909293.js b/assets/guide_required-elements.md.ef909293.js new file mode 100644 index 00000000..97433d03 --- /dev/null +++ b/assets/guide_required-elements.md.ef909293.js @@ -0,0 +1,62 @@ +import{_ as o,c,b as p,w as a,a as t,r as i,o as l,d as n,e as s}from"./app.850f5e05.js";const O='{"title":"Required elements","description":"","frontmatter":{},"headers":[{"level":2,"title":"Minimum required annotations","slug":"minimum-required-annotations"},{"level":2,"title":"Optional elements","slug":"optional-elements"}],"relativePath":"guide/required-elements.md"}',u={},r=t('

Required elements

The OpenAPI specification defines a minimum set of information for a valid document.

For the most part that consists of some general information about the API like name, version and at least one endpoint.

The endpoint, in turn, needs to have a path and at least one response.

Minimum required annotations

With the above in mind a minimal API with a single endpoint could look like this:

',6),k=n("div",{class:"language-php"},[n("pre",null,[n("code",null,[n("span",{class:"token php language-php"},[n("span",{class:"token delimiter important"},"with the resulting OpenAPI document like this

openapi: 3.0.0
+info:
+  title: 'My First API'
+  version: '0.1'
+paths:
+  /api/data.json:
+    get:
+      operationId: 236f26ae21b015a60adbce41f8f316e3
+      responses:
+        '200':
+          description: 'The data'
+

Code locations

Attributes and annotations can be added anywhere on declarations in code as defined by the PHP docs. These are limited to the extent of what the PHP Reflection APIs supports.

Optional elements

Looking at the generated document you will notice that there are some elements that swagger-php adds automatically when they are missing.

For the most part those are @OA\\OpenApi, @OA\\Components and @OA\\PathItem.

`,6);function h(_,f,g,y,b,A){const e=i("codeblock");return l(),c("div",null,[r,p(e,{id:"minimal"},{at:a(()=>[k]),an:a(()=>[d]),_:1}),m])}var q=o(u,[["render",h]]);export{O as __pageData,q as default}; diff --git a/assets/guide_required-elements.md.ef909293.lean.js b/assets/guide_required-elements.md.ef909293.lean.js new file mode 100644 index 00000000..d691c060 --- /dev/null +++ b/assets/guide_required-elements.md.ef909293.lean.js @@ -0,0 +1,51 @@ +import{_ as o,c,b as p,w as a,a as t,r as i,o as l,d as n,e as s}from"./app.850f5e05.js";const O='{"title":"Required elements","description":"","frontmatter":{},"headers":[{"level":2,"title":"Minimum required annotations","slug":"minimum-required-annotations"},{"level":2,"title":"Optional elements","slug":"optional-elements"}],"relativePath":"guide/required-elements.md"}',u={},r=t("",6),k=n("div",{class:"language-php"},[n("pre",null,[n("code",null,[n("span",{class:"token php language-php"},[n("span",{class:"token delimiter important"},"[k]),an:a(()=>[d]),_:1}),m])}var q=o(u,[["render",h]]);export{O as __pageData,q as default}; diff --git a/assets/guide_under-the-hood.md.58a1fa15.js b/assets/guide_under-the-hood.md.58a1fa15.js new file mode 100644 index 00000000..d7ce63e9 --- /dev/null +++ b/assets/guide_under-the-hood.md.58a1fa15.js @@ -0,0 +1,3 @@ +import{_ as e,c as t,o as a,a as o}from"./app.850f5e05.js";const g='{"title":"Under the hood","description":"","frontmatter":{},"headers":[{"level":2,"title":"Processing flow","slug":"processing-flow"},{"level":2,"title":"Context","slug":"context"},{"level":2,"title":"Analysis","slug":"analysis"},{"level":2,"title":"Documentation","slug":"documentation"},{"level":3,"title":"Installation","slug":"installation"},{"level":3,"title":"Workflow","slug":"workflow"}],"relativePath":"guide/under-the-hood.md"}',n={},i=o(`

Under the hood

Processing flow

  • The Generator iterates over the given sources (Symfony Finder, file/directory list, etc)
  • The configured analyser (AnalyserInterface) reads the files and builds an Analysis object. Default (as of v4) is the ReflectionAnalyser. Alternatively, there is the TokenAnalyser which was the default in v3.
  • The Analysis object and its annotations are then processed by the configured processors.
  • If enabled, the analysis/annotations are validated.
  • The root OpenApi annotation then contains all annotations and is serialized into YAML/JSON.

Context

Each annotation is associated with a unique Context instance. This contains details, collected by the parser/analyser, about the PHP context where the annotation was found.

Typically, there will be a processor that uses the data to augment/enrich the annotation.

Examples of the data collected:

  • class/interface/trait/enum names
  • property names
  • doctype or native type hints
  • file name and line number

Analysis

Contains all detected annotations and other relevant meta-data.

It uses a SplObjectStorage instance to store the parsed annotations.

Documentation

This documentation is generated with VitePress

Installation

cd docs
+npm install vitepress 
+

Workflow

  • Edit .md files in the docs folder
  • Update annotation / attribute PHP docblocks.
    These will be extracted during publishing into the reference section.
  • Run 'composer docs:build' to check for any errors
  • Run 'composer docs:dev' to test the generated documentation locally (localhost:3000)
  • Create PR and update master
  • Manually trigger the gh-pages workflow to update the online docs.

The last step requires commit rights on zircote/swagger-php.

`,18),s=[i];function l(r,d,c,h,u,p){return a(),t("div",null,s)}var m=e(n,[["render",l]]);export{g as __pageData,m as default}; diff --git a/assets/guide_under-the-hood.md.58a1fa15.lean.js b/assets/guide_under-the-hood.md.58a1fa15.lean.js new file mode 100644 index 00000000..26d2b721 --- /dev/null +++ b/assets/guide_under-the-hood.md.58a1fa15.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as o}from"./app.850f5e05.js";const g='{"title":"Under the hood","description":"","frontmatter":{},"headers":[{"level":2,"title":"Processing flow","slug":"processing-flow"},{"level":2,"title":"Context","slug":"context"},{"level":2,"title":"Analysis","slug":"analysis"},{"level":2,"title":"Documentation","slug":"documentation"},{"level":3,"title":"Installation","slug":"installation"},{"level":3,"title":"Workflow","slug":"workflow"}],"relativePath":"guide/under-the-hood.md"}',n={},i=o("",18),s=[i];function l(r,d,c,h,u,p){return a(),t("div",null,s)}var m=e(n,[["render",l]]);export{g as __pageData,m as default}; diff --git a/assets/index.md.56757007.js b/assets/index.md.56757007.js new file mode 100644 index 00000000..baf2605e --- /dev/null +++ b/assets/index.md.56757007.js @@ -0,0 +1,53 @@ +import{_ as o,c,b as i,w as a,a as s,r as l,o as p,d as n,e}from"./app.850f5e05.js";const x='{"title":"Home","description":"","frontmatter":{"home":true,"actionText":"User Guide \u2192","actionLink":"/guide/","features":[{"title":"OpenAPI conformant","details":"Generate OpenAPI documents in version 3.0 or 3.1."},{"title":"Document your API inside PHP source code","details":"Using swagger-php lets you write the API documentation inside the PHP source files which helps keeping the documentation up-to-date."},{"title":"Annotation and Attribute support","details":"Annotations can be either docblocks or PHP 8.1 attributes."}]},"headers":[{"level":3,"title":"1. Install with composer:","slug":"_1-install-with-composer"},{"level":3,"title":"2. Update your code","slug":"_2-update-your-code"},{"level":3,"title":"3. Generate OpenAPI documentation","slug":"_3-generate-openapi-documentation"},{"level":3,"title":"4. Explore and interact with your API","slug":"_4-explore-and-interact-with-your-api"},{"level":2,"title":"Links","slug":"links"}],"relativePath":"index.md"}',r={},u=s(`

1. Install with composer:

> composer require zircote/swagger-php
+

2. Update your code

Add swagger-php attributes or annotations to your source code.

`,4),d=n("div",{class:"language-php"},[n("pre",null,[n("code",null,[n("span",{class:"token php language-php"},[n("span",{class:"token delimiter important"},"3. Generate OpenAPI documentation
> ./bin/openapi src -o openapi.yaml
+

4. Explore and interact with your API

Use an OpenAPI tool like Swagger UI to explore and interact with your API.

`,6);function m(g,_,f,b,A,w){const t=l("codeblock");return p(),c("div",null,[u,i(t,{id:"minimal"},{at:a(()=>[d]),an:a(()=>[k]),_:1}),h])}var P=o(r,[["render",m]]);export{x as __pageData,P as default}; diff --git a/assets/index.md.56757007.lean.js b/assets/index.md.56757007.lean.js new file mode 100644 index 00000000..d41e3f83 --- /dev/null +++ b/assets/index.md.56757007.lean.js @@ -0,0 +1,51 @@ +import{_ as o,c,b as i,w as a,a as s,r as l,o as p,d as n,e}from"./app.850f5e05.js";const x='{"title":"Home","description":"","frontmatter":{"home":true,"actionText":"User Guide \u2192","actionLink":"/guide/","features":[{"title":"OpenAPI conformant","details":"Generate OpenAPI documents in version 3.0 or 3.1."},{"title":"Document your API inside PHP source code","details":"Using swagger-php lets you write the API documentation inside the PHP source files which helps keeping the documentation up-to-date."},{"title":"Annotation and Attribute support","details":"Annotations can be either docblocks or PHP 8.1 attributes."}]},"headers":[{"level":3,"title":"1. Install with composer:","slug":"_1-install-with-composer"},{"level":3,"title":"2. Update your code","slug":"_2-update-your-code"},{"level":3,"title":"3. Generate OpenAPI documentation","slug":"_3-generate-openapi-documentation"},{"level":3,"title":"4. Explore and interact with your API","slug":"_4-explore-and-interact-with-your-api"},{"level":2,"title":"Links","slug":"links"}],"relativePath":"index.md"}',r={},u=s("",4),d=n("div",{class:"language-php"},[n("pre",null,[n("code",null,[n("span",{class:"token php language-php"},[n("span",{class:"token delimiter important"},"[d]),an:a(()=>[k]),_:1}),h])}var P=o(r,[["render",m]]);export{x as __pageData,P as default}; diff --git a/assets/reference_annotations.md.93df9735.js b/assets/reference_annotations.md.93df9735.js new file mode 100644 index 00000000..d8a7758b --- /dev/null +++ b/assets/reference_annotations.md.93df9735.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a as r}from"./app.850f5e05.js";const b='{"title":"Annotation Reference","description":"","frontmatter":{},"headers":[{"level":2,"title":"Annotations","slug":"annotations"},{"level":3,"title":"AdditionalProperties","slug":"additionalproperties"},{"level":3,"title":"Attachable","slug":"attachable"},{"level":3,"title":"Components","slug":"components"},{"level":3,"title":"Contact","slug":"contact"},{"level":3,"title":"CookieParameter","slug":"cookieparameter"},{"level":3,"title":"Delete","slug":"delete"},{"level":3,"title":"Discriminator","slug":"discriminator"},{"level":3,"title":"Examples","slug":"examples"},{"level":3,"title":"ExternalDocumentation","slug":"externaldocumentation"},{"level":3,"title":"Flow","slug":"flow"},{"level":3,"title":"Get","slug":"get"},{"level":3,"title":"Head","slug":"head"},{"level":3,"title":"Header","slug":"header"},{"level":3,"title":"HeaderParameter","slug":"headerparameter"},{"level":3,"title":"Info","slug":"info"},{"level":3,"title":"Items","slug":"items"},{"level":3,"title":"JsonContent","slug":"jsoncontent"},{"level":3,"title":"License","slug":"license"},{"level":3,"title":"Link","slug":"link"},{"level":3,"title":"MediaType","slug":"mediatype"},{"level":3,"title":"OpenApi","slug":"openapi"},{"level":3,"title":"Options","slug":"options"},{"level":3,"title":"Parameter","slug":"parameter"},{"level":3,"title":"Patch","slug":"patch"},{"level":3,"title":"PathItem","slug":"pathitem"},{"level":3,"title":"PathParameter","slug":"pathparameter"},{"level":3,"title":"Post","slug":"post"},{"level":3,"title":"Property","slug":"property"},{"level":3,"title":"Put","slug":"put"},{"level":3,"title":"QueryParameter","slug":"queryparameter"},{"level":3,"title":"RequestBody","slug":"requestbody"},{"level":3,"title":"Response","slug":"response"},{"level":3,"title":"Schema","slug":"schema"},{"level":3,"title":"SecurityScheme","slug":"securityscheme"},{"level":3,"title":"Server","slug":"server"},{"level":3,"title":"ServerVariable","slug":"servervariable"},{"level":3,"title":"Tag","slug":"tag"},{"level":3,"title":"Trace","slug":"trace"},{"level":3,"title":"Webhook","slug":"webhook"},{"level":3,"title":"Xml","slug":"xml"},{"level":3,"title":"XmlContent","slug":"xmlcontent"}],"relativePath":"reference/annotations.md"}',n={},s=r('

Annotation Reference

This page is generated automatically from the swagger-php sources.

For improvements head over to GitHub and create a PR \u{1F609}

In addition to this page, there are also a number of examples which might help you out.

Annotations

AdditionalProperties

Allowed in


Schema, Property, Items, JsonContent, XmlContent, AdditionalProperties

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Attachable

A container for custom data to be attached to an annotation.

These will be ignored by swagger-php but can be used for custom processing.

Allowed in


AdditionalProperties, Components, Contact, Delete, Discriminator, Examples, ExternalDocumentation, Flow, Get, Head, Header, Info, Items, JsonContent, License, Link, MediaType, OpenApi, Operation, Options, Parameter, Patch, PathItem, PathParameter, Post, Property, Put, RequestBody, Response, Schema, SecurityScheme, Server, ServerVariable, Tag, Trace, Webhook, Xml, XmlContent

Components

Holds a set of reusable objects for different aspects of the OA.

All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.

Allowed in


OpenApi

Nested elements


Response, Parameter, PathParameter, RequestBody, Examples, Header, SecurityScheme, Link, Schema, Attachable

Properties


callbacks : array

Reusable Callbacks.

Reference


Contact

Contact information for the exposed API.

Allowed in


Info

Nested elements


Attachable

Properties


name : string

The identifying name of the contact person/organization.

url : string

The URL pointing to the contact information.

email : string

The email address of the contact person/organization.

Reference


CookieParameter

A @OA\\Request cookie parameter.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


in

This takes 'cookie' as the default location.

Delete

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Discriminator

The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.

This object is based on the JSON Schema Specification and uses a predefined subset of it. On top of this subset, there are extensions provided by this specification to allow for more complete documentation.

Allowed in


Schema, Property, AdditionalProperties, Items, JsonContent, XmlContent

Nested elements


Attachable

Properties


propertyName : string

The name of the property in the payload that will hold the discriminator value.

mapping : string[]

An object to hold mappings between payload values and schema names or references.

Reference


Examples

Allowed in


Components, Schema, Parameter, PathParameter, MediaType, JsonContent, XmlContent

Nested elements


Attachable

Properties


ref : string|class-string|object

The relative or absolute path to an example.

See: Using refs

example : string

The key into `#/components/examples`.

summary : string

Short description for the example.

description : string

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

value : int|string|array

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

externalValue : string

An URL that points to the literal example.

This provides the capability to reference examples that cannot easily be included
in JSON or YAML documents.

The value field and externalValue field are mutually exclusive.

ExternalDocumentation

Allows referencing an external resource for extended documentation.

Allowed in


OpenApi, Tag, Schema, AdditionalProperties, Property, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Items, JsonContent, XmlContent

Nested elements


Attachable

Properties


description : string

A short description of the target documentation. GFM syntax can be used for rich text representation.

url : string

The URL for the target documentation.

Reference


Flow

Configuration details for a supported OAuth Flow.

Allowed in


SecurityScheme

Nested elements


Attachable

Properties


authorizationUrl : string

The authorization url to be used for this flow.

This must be in the form of an url.

tokenUrl : string

The token URL to be used for this flow.

This must be in the form of an url.

refreshUrl : string

The URL to be used for obtaining refresh tokens.

This must be in the form of an url.

flow : string

Flow name.

One of ['implicit', 'password', 'authorizationCode', 'clientCredentials'].

scopes : array

The available scopes for the OAuth2 security scheme.

A map between the scope name and a short description for it.

Reference


Get

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Allowed in


Components, Response

Nested elements


Schema, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to the endpoint.

See: Using refs

header : string

No details available.

description : string

A brief description of the parameter.

This could contain examples of use.
CommonMark syntax MAY be used for rich text representation.

required : bool

No details available.

deprecated : bool

Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.

allowEmptyValue : bool

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored.

Reference


HeaderParameter

A @OA\\Request header parameter.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


in

This takes 'header' as the default location.

Info

The object provides metadata about the API.

The metadata may be used by the clients if needed and may be presented in editing or documentation generation tools for convenience.

Allowed in


OpenApi

Nested elements


Contact, License, Attachable

Properties


title : string

The title of the application.

description : string

A short description of the application.

CommonMark syntax may be used for rich text representation.

termsOfService : string

An URL to the Terms of Service for the API.

Must be in the format of an url.

version : string

The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).

Reference


Items

The description of an item in a Schema with type array.

Allowed in


Property, AdditionalProperties, Schema, JsonContent, XmlContent, Items

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

JsonContent

Shorthand for a json response.

Use as @OA\\Schema inside a Response and MediaType->'application/json' will be generated.

Nested elements


Discriminator, Items, Property, ExternalDocumentation, AdditionalProperties, Examples, Attachable

License

License information for the exposed API.

Allowed in


Info

Nested elements


Attachable

Properties


name : string

The license name used for the API.

identifier : string

An SPDX license expression for the API. The `identifier` field is mutually exclusive of the `url` field.

url : string

An URL to the license used for the API. This MUST be in the form of a URL.

The `url` field is mutually exclusive of the `identifier` field.

Reference


The Link object represents a possible design-time link for a response.

The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.

Unlike dynamic links (i.e. links provided in the response payload), the OA linking mechanism does not require link information in the runtime response.

For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation.

Allowed in


Components, Response

Nested elements


Server, Attachable

Properties


ref : string|class-string|object

No details available.

See: Using refs

link : string

The key into MediaType->links array.

operationRef : string

A relative or absolute reference to an OA operation.

This field is mutually exclusive of the operationId field, and must point to an Operation object.

Relative values may be used to locate an existing Operation object in the OpenAPI definition.

operationId : string

The name of an existing, resolvable OA operation, as defined with a unique operationId.

This field is mutually exclusive of the operationRef field.

parameters : array<string,mixed>

A map representing parameters to pass to an operation as specified with operationId or identified via
operationRef.

The key is the parameter name to be used, whereas the value can be a constant or an expression to
be evaluated and passed to the linked operation.
The parameter name can be qualified using the parameter location [{in}.]{name} for operations
that use the same parameter name in different locations (e.g. path.id).

requestBody

A literal value or {expression} to use as a request body when calling the target operation.

description : string

A description of the link.

CommonMark syntax may be used for rich text representation.

Reference


MediaType

Each Media Type object provides schema and examples for the media type identified by its key.

Allowed in


Response, RequestBody

Nested elements


Schema, Examples, Attachable

Properties


mediaType : string

The key into Operation->content array.

example

Example of the media type.

The example object should be in the correct format as specified by the media type.
The example object is mutually exclusive of the examples object.

Furthermore, if referencing a schema which contains an example,
the example value shall override the example provided by the schema.

encoding : array<string,mixed>

A map between a property name and its encoding information.

The key, being the property name, must exist in the schema as a property.

The encoding object shall only apply to requestBody objects when the media type is multipart or
application/x-www-form-urlencoded.

Reference


OpenApi

This is the root document object for the API specification.

Nested elements


Info, Server, PathItem, Components, Tag, ExternalDocumentation, Webhook, Attachable

Properties


openapi : string

The semantic version number of the OpenAPI Specification version that the OpenAPI document uses.

The openapi field should be used by tooling specifications and clients to interpret the OpenAPI document.

A version specified via `Generator::setVersion()` will overwrite this value.

This is not related to the API info::version string.

security : array

A declaration of which security mechanisms can be used across the API.

The list of values includes alternative security requirement objects that can be used.
Only one of the security requirement objects need to be satisfied to authorize a request.
Individual operations can override this definition.
To make security optional, an empty security requirement `({})` can be included in the array.

Reference


Options

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Parameter

Describes a single operation parameter.

A unique parameter is defined by a combination of a name and location.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to the endpoint.

See: Using refs

parameter : string

The key into Components::parameters or PathItem::parameters array.

name : string

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

in : string

The location of the parameter.

Possible values are "query", "header", "path" or "cookie".

description : string

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

required : bool

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

style : string

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

example

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

content : array<MediaType>|JsonContent|XmlContent|Attachable

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

matrix

Path-style parameters defined by RFC6570.

See: RFC6570

label

Label style parameters defined by RFC6570.

See: RFC6570

form

Form style parameters defined by RFC6570.

This option replaces collectionFormat with a csv (when explode is false) or multi (when explode is true) value from OpenAPI 2.0.

See: RFC6570

simple : array

Simple style parameters defined by RFC6570.

This option replaces collectionFormat with a csv value from OpenAPI 2.0.

See: RFC6570

spaceDelimited : array

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

deepObject

Provides a simple way of rendering nested objects using form parameters.

Reference


Patch

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

PathItem

Describes the operations available on a single path.

A Path Item may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer, but they will not know which operations and parameters are available.

Allowed in


OpenApi

Nested elements


Get, Post, Put, Delete, Patch, Trace, Head, Options, Parameter, PathParameter, Server, Attachable

Properties


ref : string|class-string|object

No details available.

See: Using refs

summary : string

An optional, string summary, intended to apply to all operations in this path.

description : string

An optional, string description, intended to apply to all operations in this path.

path : string

Key for the Path Object (OpenApi->paths array).

Reference


PathParameter

A @OA\\Request path parameter.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


in

This takes 'path' as the default location.

required

No details available.

Post

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Property

Allowed in


AdditionalProperties, Schema, JsonContent, XmlContent, Property, Items

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Properties


property : string

The key into Schema->properties array.

Put

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

QueryParameter

A @OA\\Request query parameter.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


in

This takes 'query' as the default location.

RequestBody

Describes a single request body.

Allowed in


Components, Delete, Get, Head, Operation, Options, Patch, Post, Trace, Put

Nested elements


MediaType, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to a request body.

See: Using refs

request : string

The key into Components->requestBodies array.

description : string

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

required : bool

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

Reference


Response

Describes a single response from an API Operation, including design-time, static links to operations based on the response.

Allowed in


Components, Operation, Get, Post, Put, Patch, Delete, Head, Options, Trace

Nested elements


MediaType, Header, Link, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to a response.

See: Using refs

response : string|int

The key into Operations->responses array.

A HTTP status code or default.

description : string

A short description of the response.

CommonMark syntax may be used for rich text representation.

Reference


Schema

The definition of input and output data types.

These types can be objects, but also primitives and arrays.

This object is based on the JSON Schema Specification and uses a predefined subset of it. On top of this subset, there are extensions provided by this specification to allow for more complete documentation.

Allowed in


Components, Parameter, PathParameter, MediaType, Header

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Examples, Xml, AdditionalProperties, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to the endpoint.

See: Using refs

schema : string

The key into Components->schemas array.

title : string

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

type : string|non-empty-array<string>

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string

The extending format for the previously mentioned type. See Data Type Formats for further details.

collectionFormat : string

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|int|float

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|int|float

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

pattern : string

A string instance is considered valid if the regular expression matches the instance successfully.

maxItems : int

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

enum : array<string|int|float|bool|\\UnitEnum>|class-string

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

multipleOf : int|float

A numeric instance is valid against "multipleOf" if the result of the division of the instance by this
property's value is an integer.

readOnly : bool

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

example

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\\OpenApi\\Attributes\\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\\OpenApi\\Attributes\\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\\OpenApi\\Attributes\\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

not

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.29.

additionalItems

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.10.

contains

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.14.

patternProperties

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.19.

dependencies

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.21.

propertyNames

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.22.

const

http://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.1.3.

Reference


SecurityScheme

Allowed in


Components

Nested elements


Flow, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to a security scheme.

See: Using refs

securityScheme : string

The key into OpenApi->security array.

type : string|non-empty-array<string>

The type of the security scheme.

description : string

A short description for security scheme.

name : string

The name of the header or query parameter to be used.

in : string

Required The location of the API key.

bearerFormat : string

A hint to the client to identify how the bearer token is formatted.

Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.

scheme : string

The name of the HTTP Authorization scheme.

See: RFC7235

openIdConnectUrl : string

OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.

Reference


Server

An object representing a server.

Allowed in


OpenApi, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Link

Nested elements


ServerVariable, Attachable

Properties


url : string

An URL to the target host.

This URL supports Server Variables and may be relative,
to indicate that the host location is relative to the location where the OpenAPI document is being served.
Variable substitutions will be made when a variable is named in {brackets}.

description : string

An optional string describing the host designated by the URL.

CommonMark syntax may be used for rich text representation.

Reference


ServerVariable

An object representing a server variable for server URL template substitution.

Allowed in


Server

Nested elements


Attachable

Properties


serverVariable : string

The key into Server->variables array.

enum : array<string|int|float|bool|\\UnitEnum>|class-string

An enumeration of values to be used if the substitution options are from a limited set.

default : string

The default value to use for substitution, and to send, if an alternate value is not supplied.

Unlike the Schema Object's default, this value must be provided by the consumer.

variables : array

A map between a variable name and its value.

The value is used for substitution in the server's URL template.

description : string

An optional description for the server variable.

CommonMark syntax MAY be used for rich text representation.

Reference


Tag

Allowed in


OpenApi

Nested elements


ExternalDocumentation, Attachable

Properties


name : string

The name of the tag.

description : string

A short description for the tag. GFM syntax can be used for rich text representation.

Reference


Trace

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Webhook

Acts like a PathItem with the main difference being that it requires webhook instead of path.

Allowed in


OpenApi

Nested elements


Get, Post, Put, Delete, Patch, Trace, Head, Options, Parameter, PathParameter, Server, Attachable

Properties


webhook : string

Key for the webhooks map.

Xml

Allowed in


AdditionalProperties, Schema, Property, Schema, Items, XmlContent

Nested elements


Attachable

Properties


name : string

Replaces the name of the element/attribute used for the described schema property.

When defined within the Items Object (items), it will affect the name of the individual XML elements within the list.
When defined alongside type being array (outside the items), it will affect the wrapping element
and only if wrapped is true.

If wrapped is false, it will be ignored.

namespace : string

The URL of the namespace definition. Value SHOULD be in the form of a URL.

prefix : string

The prefix to be used for the name.

attribute : bool

Declares whether the property definition translates to an attribute instead of an element.

Default value is false.

wrapped : bool

MAY be used only for an array definition.

Signifies whether the array is wrapped (for example <books><book/><book/></books>)
or unwrapped (<book/><book/>).

Default value is false. The definition takes effect only when defined alongside type being array (outside the items).

Reference


XmlContent

Shorthand for a xml response.

Use as @OA\\Schema inside a Response and MediaType->'application/xml' will be generated.

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Examples, Attachable

',490),o=[s];function i(d,h,p,l,c,f){return t(),a("div",null,o)}var u=e(n,[["render",i]]);export{b as __pageData,u as default}; diff --git a/assets/reference_annotations.md.93df9735.lean.js b/assets/reference_annotations.md.93df9735.lean.js new file mode 100644 index 00000000..4fdafa78 --- /dev/null +++ b/assets/reference_annotations.md.93df9735.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a as r}from"./app.850f5e05.js";const b='{"title":"Annotation Reference","description":"","frontmatter":{},"headers":[{"level":2,"title":"Annotations","slug":"annotations"},{"level":3,"title":"AdditionalProperties","slug":"additionalproperties"},{"level":3,"title":"Attachable","slug":"attachable"},{"level":3,"title":"Components","slug":"components"},{"level":3,"title":"Contact","slug":"contact"},{"level":3,"title":"CookieParameter","slug":"cookieparameter"},{"level":3,"title":"Delete","slug":"delete"},{"level":3,"title":"Discriminator","slug":"discriminator"},{"level":3,"title":"Examples","slug":"examples"},{"level":3,"title":"ExternalDocumentation","slug":"externaldocumentation"},{"level":3,"title":"Flow","slug":"flow"},{"level":3,"title":"Get","slug":"get"},{"level":3,"title":"Head","slug":"head"},{"level":3,"title":"Header","slug":"header"},{"level":3,"title":"HeaderParameter","slug":"headerparameter"},{"level":3,"title":"Info","slug":"info"},{"level":3,"title":"Items","slug":"items"},{"level":3,"title":"JsonContent","slug":"jsoncontent"},{"level":3,"title":"License","slug":"license"},{"level":3,"title":"Link","slug":"link"},{"level":3,"title":"MediaType","slug":"mediatype"},{"level":3,"title":"OpenApi","slug":"openapi"},{"level":3,"title":"Options","slug":"options"},{"level":3,"title":"Parameter","slug":"parameter"},{"level":3,"title":"Patch","slug":"patch"},{"level":3,"title":"PathItem","slug":"pathitem"},{"level":3,"title":"PathParameter","slug":"pathparameter"},{"level":3,"title":"Post","slug":"post"},{"level":3,"title":"Property","slug":"property"},{"level":3,"title":"Put","slug":"put"},{"level":3,"title":"QueryParameter","slug":"queryparameter"},{"level":3,"title":"RequestBody","slug":"requestbody"},{"level":3,"title":"Response","slug":"response"},{"level":3,"title":"Schema","slug":"schema"},{"level":3,"title":"SecurityScheme","slug":"securityscheme"},{"level":3,"title":"Server","slug":"server"},{"level":3,"title":"ServerVariable","slug":"servervariable"},{"level":3,"title":"Tag","slug":"tag"},{"level":3,"title":"Trace","slug":"trace"},{"level":3,"title":"Webhook","slug":"webhook"},{"level":3,"title":"Xml","slug":"xml"},{"level":3,"title":"XmlContent","slug":"xmlcontent"}],"relativePath":"reference/annotations.md"}',n={},s=r("",490),o=[s];function i(d,h,p,l,c,f){return t(),a("div",null,o)}var u=e(n,[["render",i]]);export{b as __pageData,u as default}; diff --git a/assets/reference_attributes.md.0f7b8389.js b/assets/reference_attributes.md.0f7b8389.js new file mode 100644 index 00000000..fbd8bfea --- /dev/null +++ b/assets/reference_attributes.md.0f7b8389.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as n}from"./app.850f5e05.js";const u='{"title":"Attribute Reference","description":"","frontmatter":{},"headers":[{"level":2,"title":"Attributes","slug":"attributes"},{"level":3,"title":"AdditionalProperties","slug":"additionalproperties"},{"level":3,"title":"Attachable","slug":"attachable"},{"level":3,"title":"Components","slug":"components"},{"level":3,"title":"Contact","slug":"contact"},{"level":3,"title":"CookieParameter","slug":"cookieparameter"},{"level":3,"title":"Delete","slug":"delete"},{"level":3,"title":"Discriminator","slug":"discriminator"},{"level":3,"title":"Examples","slug":"examples"},{"level":3,"title":"ExternalDocumentation","slug":"externaldocumentation"},{"level":3,"title":"Flow","slug":"flow"},{"level":3,"title":"Get","slug":"get"},{"level":3,"title":"Head","slug":"head"},{"level":3,"title":"Header","slug":"header"},{"level":3,"title":"HeaderParameter","slug":"headerparameter"},{"level":3,"title":"Info","slug":"info"},{"level":3,"title":"Items","slug":"items"},{"level":3,"title":"JsonContent","slug":"jsoncontent"},{"level":3,"title":"License","slug":"license"},{"level":3,"title":"Link","slug":"link"},{"level":3,"title":"MediaType","slug":"mediatype"},{"level":3,"title":"OpenApi","slug":"openapi"},{"level":3,"title":"Options","slug":"options"},{"level":3,"title":"Parameter","slug":"parameter"},{"level":3,"title":"Patch","slug":"patch"},{"level":3,"title":"PathItem","slug":"pathitem"},{"level":3,"title":"PathParameter","slug":"pathparameter"},{"level":3,"title":"Post","slug":"post"},{"level":3,"title":"Property","slug":"property"},{"level":3,"title":"Put","slug":"put"},{"level":3,"title":"QueryParameter","slug":"queryparameter"},{"level":3,"title":"RequestBody","slug":"requestbody"},{"level":3,"title":"Response","slug":"response"},{"level":3,"title":"Schema","slug":"schema"},{"level":3,"title":"SecurityScheme","slug":"securityscheme"},{"level":3,"title":"Server","slug":"server"},{"level":3,"title":"ServerVariable","slug":"servervariable"},{"level":3,"title":"Tag","slug":"tag"},{"level":3,"title":"Trace","slug":"trace"},{"level":3,"title":"Webhook","slug":"webhook"},{"level":3,"title":"Xml","slug":"xml"},{"level":3,"title":"XmlContent","slug":"xmlcontent"}],"relativePath":"reference/attributes.md"}',s={},r=n('

Attribute Reference

This page is generated automatically from the swagger-php sources.

For improvements head over to GitHub and create a PR \u{1F609}

In addition to this page, there are also a number of examples which might help you out.

Attributes

AdditionalProperties

Allowed in


Schema, Property, Items, JsonContent, XmlContent, AdditionalProperties

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\\Attributes\\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\\Attributes\\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\\Attributes\\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\\Attributes\\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Attachable

Allowed in


AdditionalProperties, Components, Contact, Delete, Discriminator, Examples, ExternalDocumentation, Flow, Get, Head, Header, Info, Items, JsonContent, License, Link, MediaType, OpenApi, Operation, Options, Parameter, Patch, PathItem, PathParameter, Post, Property, Put, RequestBody, Response, Schema, SecurityScheme, Server, ServerVariable, Tag, Trace, Webhook, Xml, XmlContent

Parameters


properties : array

No details available.

Components

Allowed in


OpenApi

Nested elements


Response, Parameter, PathParameter, RequestBody, Examples, Header, SecurityScheme, Link, Schema, Attachable

Parameters


schemas : array<Schema|\\OpenApi\\Annotations\\Schema>|null

Reusable Schemas.

responses : Response[]|null

Reusable Responses.

parameters : Parameter[]|null

Reusable Parameters.

requestBodies : RequestBody[]|null

Reusable Request Bodies.

examples : array<Examples>|null

Reusable Examples.

headers : Header[]|null

Reusable Headers.

securitySchemes : SecurityScheme[]|null

Reusable Security Schemes.

links : Link[]|null

Reusable Links.

callbacks : array|null

Reusable Callbacks.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Contact

Allowed in


Info

Nested elements


Attachable

Parameters


name : string|null

The identifying name of the contact person/organization.

url : string|null

The URL pointing to the contact information.

email : string|null

The email address of the contact person/organization.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

CookieParameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

This takes 'cookie' as the default location.

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\\Attributes\\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Delete

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\\Attributes\\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Discriminator

Allowed in


Schema, Property, AdditionalProperties, Items, JsonContent, XmlContent

Nested elements


Attachable

Parameters


propertyName : string|null

The name of the property in the payload that will hold the discriminator value.

mapping : string[]|null

An object to hold mappings between payload values and schema names or references.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Examples

Allowed in


Components, Schema, Parameter, PathParameter, MediaType, JsonContent, XmlContent

Nested elements


Attachable

Parameters


example : string|null

The key into `#/components/examples`.

summary : string|null

Short description for the example.

description : string|null

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

value : array|string|int|null

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

externalValue : string|null

An URL that points to the literal example.

This provides the capability to reference examples that cannot easily be included
in JSON or YAML documents.

The value field and externalValue field are mutually exclusive.

ref : string|class-string|object|null

The relative or absolute path to an example.

See: Using refs

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

ExternalDocumentation

Allowed in


OpenApi, Tag, Schema, AdditionalProperties, Property, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Items, JsonContent, XmlContent

Nested elements


Attachable

Parameters


description : string|null

A short description of the target documentation. GFM syntax can be used for rich text representation.

url : string|null

The URL for the target documentation.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Flow

Allowed in


SecurityScheme

Nested elements


Attachable

Parameters


authorizationUrl : string|null

The authorization url to be used for this flow.

This must be in the form of an url.

tokenUrl : string|null

The token URL to be used for this flow.

This must be in the form of an url.

refreshUrl : string|null

The URL to be used for obtaining refresh tokens.

This must be in the form of an url.

flow : string|null

Flow name.

One of ['implicit', 'password', 'authorizationCode', 'clientCredentials'].

scopes : array|null

The available scopes for the OAuth2 security scheme.

A map between the scope name and a short description for it.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Get

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\\Attributes\\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\\Attributes\\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Allowed in


Components, Response

Nested elements


Schema, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

header : string|null

No details available.

description : string|null

A brief description of the parameter.

This could contain examples of use.
CommonMark syntax MAY be used for rich text representation.

required : bool|null

No details available.

schema : OpenApi\\Attributes\\Schema|null

Schema object.

deprecated : bool|null

Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

HeaderParameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

This takes 'header' as the default location.

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\\Attributes\\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Info

Allowed in


OpenApi

Nested elements


Contact, License, Attachable

Parameters


version : string|null

The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).

description : string|null

A short description of the application.

CommonMark syntax may be used for rich text representation.

title : string|null

The title of the application.

termsOfService : string|null

An URL to the Terms of Service for the API.

Must be in the format of an url.

contact : OpenApi\\Attributes\\Contact|null

The contact information for the exposed API.

license : OpenApi\\Attributes\\License|null

The license information for the exposed API.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Items

Allowed in


Property, AdditionalProperties, Schema, JsonContent, XmlContent, Items

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\\Attributes\\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\\Attributes\\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\\Attributes\\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\\Attributes\\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

JsonContent

Nested elements


Discriminator, Items, Property, ExternalDocumentation, AdditionalProperties, Examples, Attachable

Parameters


examples : array<Examples>

Examples of the schema.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\\Attributes\\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\\Attributes\\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\\Attributes\\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\\Attributes\\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

License

Allowed in


Info

Nested elements


Attachable

Parameters


name : string|null

The license name used for the API.

identifier : string|null

An SPDX license expression for the API. The `identifier` field is mutually exclusive of the `url` field.

url : string|null

An URL to the license used for the API. This MUST be in the form of a URL.

The `url` field is mutually exclusive of the `identifier` field.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Allowed in


Components, Response

Nested elements


Server, Attachable

Parameters


link : string|null

The key into MediaType->links array.

operationRef : string|null

A relative or absolute reference to an OA operation.

This field is mutually exclusive of the operationId field, and must point to an Operation object.

Relative values may be used to locate an existing Operation object in the OpenAPI definition.

ref : string|class-string|object|null

No details available.

See: Using refs

operationId : string|null

The name of an existing, resolvable OA operation, as defined with a unique operationId.

This field is mutually exclusive of the operationRef field.

parameters : array<string,mixed>

A map representing parameters to pass to an operation as specified with operationId or identified via
operationRef.

The key is the parameter name to be used, whereas the value can be a constant or an expression to
be evaluated and passed to the linked operation.
The parameter name can be qualified using the parameter location [{in}.]{name} for operations
that use the same parameter name in different locations (e.g. path.id).

requestBody : mixed|null

A literal value or {expression} to use as a request body when calling the target operation.

description : string|null

A description of the link.

CommonMark syntax may be used for rich text representation.

server : OpenApi\\Attributes\\Server|null

A server object to be used by the target operation.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

MediaType

Allowed in


Response, RequestBody

Nested elements


Schema, Examples, Attachable

Parameters


mediaType : string|null

The key into Operation->content array.

schema : OpenApi\\Attributes\\Schema|null

The schema defining the type used for the request body.

example : mixed|null

Example of the media type.

The example object should be in the correct format as specified by the media type.
The example object is mutually exclusive of the examples object.

Furthermore, if referencing a schema which contains an example,
the example value shall override the example provided by the schema.

examples : array<Examples>

Examples of the media type.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

encoding : array<string,mixed>

A map between a property name and its encoding information.

The key, being the property name, must exist in the schema as a property.

The encoding object shall only apply to requestBody objects when the media type is multipart or
application/x-www-form-urlencoded.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

OpenApi

Nested elements


Info, Server, PathItem, Components, Tag, ExternalDocumentation, Webhook, Attachable

Parameters


openapi : string

The semantic version number of the OpenAPI Specification version that the OpenAPI document uses.

The openapi field should be used by tooling specifications and clients to interpret the OpenAPI document.

A version specified via `Generator::setVersion()` will overwrite this value.

This is not related to the API info::version string.

info : OpenApi\\Attributes\\Info|null

Provides metadata about the API. The metadata may be used by tooling as required.

servers : Server[]|null

An array of @Server objects, which provide connectivity information to a target server.

If not provided, or is an empty array, the default value would be a Server Object with an url value of /.

security : array|null

A declaration of which security mechanisms can be used across the API.

The list of values includes alternative security requirement objects that can be used.
Only one of the security requirement objects need to be satisfied to authorize a request.
Individual operations can override this definition.
To make security optional, an empty security requirement `({})` can be included in the array.

tags : Tag[]|null

A list of tags used by the specification with additional metadata.

The order of the tags can be used to reflect on their order by the parsing tools.
Not all tags that are used by the Operation Object must be declared.
The tags that are not declared may be organized randomly or based on the tools' logic.
Each tag name in the list must be unique.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation.

paths : PathItem[]|null

The available paths and operations for the API.

components : OpenApi\\Attributes\\Components|null

An element to hold various components for the specification.

webhooks : Webhook[]|null

The available webhooks for the API.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Options

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\\Attributes\\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Parameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

The location of the parameter.

Possible values are "query", "header", "path" or "cookie".

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\\Attributes\\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Patch

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\\Attributes\\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

PathItem

Allowed in


OpenApi

Nested elements


Get, Post, Put, Delete, Patch, Trace, Head, Options, Parameter, PathParameter, Server, Attachable

Parameters


path : string|null

Key for the Path Object (OpenApi->paths array).

ref : string|class-string|object|null

No details available.

See: Using refs

summary : string|null

An optional, string summary, intended to apply to all operations in this path.

description : string|null

An optional, string description, intended to apply to all operations in this path.

get : OpenApi\\Attributes\\Get|null

A definition of a GET operation on this path.

put : OpenApi\\Attributes\\Put|null

A definition of a PUT operation on this path.

post : OpenApi\\Attributes\\Post|null

A definition of a POST operation on this path.

delete : OpenApi\\Attributes\\Delete|null

A definition of a DELETE operation on this path.

options : OpenApi\\Attributes\\Options|null

A definition of a OPTIONS operation on this path.

head : OpenApi\\Attributes\\Head|null

A definition of a HEAD operation on this path.

patch : OpenApi\\Attributes\\Patch|null

A definition of a PATCH operation on this path.

trace : OpenApi\\Attributes\\Trace|null

A definition of a TRACE operation on this path.

servers : Server[]|null

An alternative server array to service all operations in this path.

parameters : Parameter[]|null

A list of parameters that are applicable for all the operations described under this path.

These parameters can be overridden at the operation level, but cannot be removed there.
The list must not include duplicated parameters.
A unique parameter is defined by a combination of a name and location.
The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

PathParameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

This takes 'path' as the default location.

required : bool|null

No details available.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\\Attributes\\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Post

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\\Attributes\\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Property

Allowed in


AdditionalProperties, Schema, JsonContent, XmlContent, Property, Items

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Parameters


property : string|null

The key into Schema->properties array.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\\Attributes\\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\\Attributes\\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\\Attributes\\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\\Attributes\\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Put

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\\Attributes\\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

QueryParameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

This takes 'query' as the default location.

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\\Attributes\\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

RequestBody

Allowed in


Components, Delete, Get, Head, Operation, Options, Patch, Post, Trace, Put

Nested elements


MediaType, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to a request body.

See: Using refs

request : string|null

The key into Components->requestBodies array.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

content : array<MediaType|JsonContent|XmlContent>|MediaType|XmlContent|Attachable|null

The content of the request body.

The key is a media type or media type range and the value describes it. For requests that match multiple keys,
only the most specific key is applicable. e.g. text/plain overrides text/*.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Response

Allowed in


Components, Operation, Get, Post, Put, Patch, Delete, Head, Options, Trace

Nested elements


MediaType, Header, Link, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to a response.

See: Using refs

response : string|int|null

The key into Operations->responses array.

A HTTP status code or default.

description : string|null

A short description of the response.

CommonMark syntax may be used for rich text representation.

headers : Header[]

Maps a header name to its definition.

RFC7230 states header names are case insensitive.

If a response header is defined with the name "Content-Type", it shall be ignored.

See: RFC7230

content : MediaType|JsonContent|XmlContent|Attachable|array<MediaType|Attachable>

A map containing descriptions of potential response payloads.

The key is a media type or media type range and the value describes it.

For responses that match multiple keys, only the most specific key is applicable;
e.g. text/plain overrides text/*.

links : Link[]

A map of operations links that can be followed from the response.

The key of the map is a short name for the link, following the naming constraints of the names for Component
Objects.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Schema

Allowed in


Components, Parameter, PathParameter, MediaType, Header

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Examples, Xml, AdditionalProperties, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\\Attributes\\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\\Attributes\\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\\Attributes\\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

examples : array<Examples>

Examples of the schema.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\\Attributes\\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

const : mixed|null

http://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.1.3.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

SecurityScheme

Allowed in


Components

Nested elements


Flow, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to a security scheme.

See: Using refs

securityScheme : string|null

The key into OpenApi->security array.

type : string|non-empty-array<string>|null

The type of the security scheme.

description : string|null

A short description for security scheme.

name : string|null

The name of the header or query parameter to be used.

in : string|null

Required The location of the API key.

bearerFormat : string|null

A hint to the client to identify how the bearer token is formatted.

Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.

scheme : string|null

The name of the HTTP Authorization scheme.

See: RFC7235

openIdConnectUrl : string|null

OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.

flows : Flow[]

The flow used by the OAuth2 security scheme.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Server

Allowed in


OpenApi, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Link

Nested elements


ServerVariable, Attachable

Parameters


url : string|null

An URL to the target host.

This URL supports Server Variables and may be relative,
to indicate that the host location is relative to the location where the OpenAPI document is being served.
Variable substitutions will be made when a variable is named in {brackets}.

description : string|null

An optional string describing the host designated by the URL.

CommonMark syntax may be used for rich text representation.

variables : ServerVariable[]

A map between a variable name and its value.

The value is used for substitution in the server's URL template.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

ServerVariable

Allowed in


Server

Nested elements


Attachable

Parameters


serverVariable : string|null

The key into Server->variables array.

description : string|null

An optional description for the server variable.

CommonMark syntax MAY be used for rich text representation.

default : string|null

The default value to use for substitution, and to send, if an alternate value is not supplied.

Unlike the Schema Object's default, this value must be provided by the consumer.

enum : array<string|int|float|bool|\\UnitEnum|null>|class-string|null

An enumeration of values to be used if the substitution options are from a limited set.

variables : array|null

A map between a variable name and its value.

The value is used for substitution in the server's URL template.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Tag

Allowed in


OpenApi

Nested elements


ExternalDocumentation, Attachable

Parameters


name : string|null

The name of the tag.

description : string|null

A short description for the tag. GFM syntax can be used for rich text representation.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this tag.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Trace

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\\Attributes\\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Webhook

Allowed in


OpenApi

Nested elements


Get, Post, Put, Delete, Patch, Trace, Head, Options, Parameter, PathParameter, Server, Attachable

Parameters


webhook : string|null

Key for the webhooks map.

path : string|null

Key for the Path Object (OpenApi->paths array).

ref : string|class-string|object|null

No details available.

See: Using refs

summary : string|null

An optional, string summary, intended to apply to all operations in this path.

description : string|null

An optional, string description, intended to apply to all operations in this path.

get : OpenApi\\Attributes\\Get|null

A definition of a GET operation on this path.

put : OpenApi\\Attributes\\Put|null

A definition of a PUT operation on this path.

post : OpenApi\\Attributes\\Post|null

A definition of a POST operation on this path.

delete : OpenApi\\Attributes\\Delete|null

A definition of a DELETE operation on this path.

options : OpenApi\\Attributes\\Options|null

A definition of a OPTIONS operation on this path.

head : OpenApi\\Attributes\\Head|null

A definition of a HEAD operation on this path.

patch : OpenApi\\Attributes\\Patch|null

A definition of a PATCH operation on this path.

trace : OpenApi\\Attributes\\Trace|null

A definition of a TRACE operation on this path.

servers : Server[]|null

An alternative server array to service all operations in this path.

parameters : Parameter[]|null

A list of parameters that are applicable for all the operations described under this path.

These parameters can be overridden at the operation level, but cannot be removed there.
The list must not include duplicated parameters.
A unique parameter is defined by a combination of a name and location.
The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Xml

Allowed in


AdditionalProperties, Schema, Property, Schema, Items, XmlContent

Nested elements


Attachable

Parameters


name : string|null

Replaces the name of the element/attribute used for the described schema property.

When defined within the Items Object (items), it will affect the name of the individual XML elements within the list.
When defined alongside type being array (outside the items), it will affect the wrapping element
and only if wrapped is true.

If wrapped is false, it will be ignored.

namespace : string|null

The URL of the namespace definition. Value SHOULD be in the form of a URL.

prefix : string|null

The prefix to be used for the name.

attribute : bool|null

Declares whether the property definition translates to an attribute instead of an element.

Default value is false.

wrapped : bool|null

MAY be used only for an array definition.

Signifies whether the array is wrapped (for example <books><book/><book/></books>)
or unwrapped (<book/><book/>).

Default value is false. The definition takes effect only when defined alongside type being array (outside the items).

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

XmlContent

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Examples, Attachable

Parameters


examples : array<Examples>

Examples of the schema.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\\Attributes\\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\\Attributes\\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\\Attributes\\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\\Attributes\\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\\OpenApi\\Annotations\\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\\Attributes\\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

',403),o=[r];function i(d,l,p,h,c,m){return a(),t("div",null,o)}var b=e(s,[["render",i]]);export{u as __pageData,b as default}; diff --git a/assets/reference_attributes.md.0f7b8389.lean.js b/assets/reference_attributes.md.0f7b8389.lean.js new file mode 100644 index 00000000..e37181a7 --- /dev/null +++ b/assets/reference_attributes.md.0f7b8389.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as n}from"./app.850f5e05.js";const u='{"title":"Attribute Reference","description":"","frontmatter":{},"headers":[{"level":2,"title":"Attributes","slug":"attributes"},{"level":3,"title":"AdditionalProperties","slug":"additionalproperties"},{"level":3,"title":"Attachable","slug":"attachable"},{"level":3,"title":"Components","slug":"components"},{"level":3,"title":"Contact","slug":"contact"},{"level":3,"title":"CookieParameter","slug":"cookieparameter"},{"level":3,"title":"Delete","slug":"delete"},{"level":3,"title":"Discriminator","slug":"discriminator"},{"level":3,"title":"Examples","slug":"examples"},{"level":3,"title":"ExternalDocumentation","slug":"externaldocumentation"},{"level":3,"title":"Flow","slug":"flow"},{"level":3,"title":"Get","slug":"get"},{"level":3,"title":"Head","slug":"head"},{"level":3,"title":"Header","slug":"header"},{"level":3,"title":"HeaderParameter","slug":"headerparameter"},{"level":3,"title":"Info","slug":"info"},{"level":3,"title":"Items","slug":"items"},{"level":3,"title":"JsonContent","slug":"jsoncontent"},{"level":3,"title":"License","slug":"license"},{"level":3,"title":"Link","slug":"link"},{"level":3,"title":"MediaType","slug":"mediatype"},{"level":3,"title":"OpenApi","slug":"openapi"},{"level":3,"title":"Options","slug":"options"},{"level":3,"title":"Parameter","slug":"parameter"},{"level":3,"title":"Patch","slug":"patch"},{"level":3,"title":"PathItem","slug":"pathitem"},{"level":3,"title":"PathParameter","slug":"pathparameter"},{"level":3,"title":"Post","slug":"post"},{"level":3,"title":"Property","slug":"property"},{"level":3,"title":"Put","slug":"put"},{"level":3,"title":"QueryParameter","slug":"queryparameter"},{"level":3,"title":"RequestBody","slug":"requestbody"},{"level":3,"title":"Response","slug":"response"},{"level":3,"title":"Schema","slug":"schema"},{"level":3,"title":"SecurityScheme","slug":"securityscheme"},{"level":3,"title":"Server","slug":"server"},{"level":3,"title":"ServerVariable","slug":"servervariable"},{"level":3,"title":"Tag","slug":"tag"},{"level":3,"title":"Trace","slug":"trace"},{"level":3,"title":"Webhook","slug":"webhook"},{"level":3,"title":"Xml","slug":"xml"},{"level":3,"title":"XmlContent","slug":"xmlcontent"}],"relativePath":"reference/attributes.md"}',s={},r=n("",403),o=[r];function i(d,l,p,h,c,m){return a(),t("div",null,o)}var b=e(s,[["render",i]]);export{u as __pageData,b as default}; diff --git a/assets/reference_generator.md.857d4ce7.js b/assets/reference_generator.md.857d4ce7.js new file mode 100644 index 00000000..7c3297b2 --- /dev/null +++ b/assets/reference_generator.md.857d4ce7.js @@ -0,0 +1,81 @@ +import{_ as n,c as s,o as a,a as t}from"./app.850f5e05.js";const h='{"title":"Using the Generator","description":"","frontmatter":{},"headers":[{"level":2,"title":"Introduction","slug":"introduction"},{"level":2,"title":"The \\\\OpenApi\\\\scan() function","slug":"the-openapi-scan-function"},{"level":2,"title":"The \\\\OpenApi\\\\Generator class","slug":"the-openapi-generator-class"}],"relativePath":"reference/generator.md"}',e={},p=t(`

Using the Generator

Introduction

The Generator class provides an object-oriented way to use swagger-php and all its aspects in a single place.

The \\OpenApi\\scan() function

For a long time the \\OpenApi\\scan() function was the main entry point into using swagger-php from PHP code.

/**
+  * Scan the filesystem for OpenAPI annotations and build openapi-documentation.
+  *
+  * @param array|Finder|string $directory The directory(s) or filename(s)
+  * @param array               $options
+  *                                       exclude: string|array $exclude The directory(s) or filename(s) to exclude (as absolute or relative paths)
+  *                                       pattern: string       $pattern File pattern(s) to scan (default: *.php)
+  *                                       analyser: defaults to StaticAnalyser
+  *                                       analysis: defaults to a new Analysis
+  *                                       processors: defaults to the registered processors in Analysis
+  *
+  * @return OpenApi
+  */
+  function scan($directory, $options = []) { /* ... */ }
+

Using it looked typically something like this:

require("vendor/autoload.php");
+
+$openapi = \\OpenApi\\scan(__DIR__, ['exclude' => ['tests'], 'pattern' => '*.php']);
+

The two configuration options for the underlying Doctrine doc-block parser aliases and namespaces are not part of this function and need to be set separately.

Being static this means setting them back is the callers responsibility and there is also the fact that some Doctrine configuration currently can not be reverted easily.

Therefore, having a single side effect free way of using swagger-php seemed like a good idea...

The \\OpenApi\\Generator class

The Generator class can be used in object-oriented (and fluent) style which allows for easy customization if needed.

In that case to actually process the given input files the non-static method generate() is to be used.

Full example of using the Generator class to generate OpenApi specs.

require("vendor/autoload.php");
+
+$validate = true;
+$logger = new \\Psr\\Log\\NullLogger();
+$processors = [/* my processors */];
+$finder = \\Symfony\\Component\\Finder\\Finder::create()->files()->name('*.php')->in(__DIR__);
+
+$openapi = (new \\OpenApi\\Generator($logger))
+            ->setProcessorPipeline(new \\OpenApi\\Pipeline($processors))
+            ->setAliases(['MY' => 'My\\Annotations'])
+            ->setNamespaces(['My\\\\Annotations\\\\'])
+            ->setAnalyser(new \\OpenApi\\Analysers\\TokenAnalyser())
+            ->setVersion(\\OpenApi\\Annotations\\OpenApi::VERSION_3_0_0)
+            ->generate(['/path1/to/project', $finder], new \\OpenApi\\Analysis(), $validate);
+

Aliases and namespaces are additional options that allow to customize the parsing of docblocks.

Defaults:

  • aliases: ['oa' => 'OpenApi\\\\Annotations']

    Aliases help the underlying doctrine annotations library to parse annotations. Effectively they avoid having to write use OpenApi\\Annotations as OA; in your code and make @OA\\property(..) annotations still work.

  • namespaces: ['OpenApi\\\\Annotations\\\\']

    Namespaces control which annotation namespaces can be autoloaded automatically. Under the hood this is handled by registering a custom loader with the doctrine annotation library.

Advantages:

  • The Generator code will handle configuring things as before in a single place
  • Static settings will be reverted to the default once finished
  • The get/set methods allow for using type hints
  • Static configuration is deprecated and can be removed at some point without code changes
  • Build in support for PSR logger
  • Support for Symfony Finder, \\SplInfo and file/directory names (\`string) as source.

The minimum code required, using the generate() method, looks quite similar to the old scan() code:

    /**
+     * Generate OpenAPI spec by scanning the given source files.
+     *
+     * @param iterable      $sources  PHP source files to scan.
+     *                                Supported sources:
+     *                                * string - file / directory name
+     *                                * \\SplFileInfo
+     *                                * \\Symfony\\Component\\Finder\\Finder
+     * @param null|Analysis $analysis custom analysis instance
+     * @param bool          $validate flag to enable/disable validation of the returned spec
+     */
+    public function generate(iterable $sources, ?Analysis $analysis = null, bool $validate = true): \\OpenApi\\OpenApi { /* ... */ }
+
require("vendor/autoload.php");
+
+$openapi = (new \\OpenApi\\Generator())->generate(['/path1/to/project']);
+

For those that want to type even less and keep using a plain array to configure swagger-php there is also a static version:

<?php
+require("vendor/autoload.php");
+
+$openapi = \\OpenApi\\Generator::scan(['/path/to/project']);
+
+header('Content-Type: application/x-yaml');
+echo $openapi->toYaml();
+

Note: While using the same name as the old scan() function, the Generator::scan method is not 100% backwards compatible.

    /**
+     * Static  wrapper around \`Generator::generate()\`.
+     *
+     * @param iterable $sources PHP source files to scan.
+     *                          Supported sources:
+     *                          * string
+     *                          * \\SplFileInfo
+     *                          * \\Symfony\\Component\\Finder\\Finder
+     * @param array    $options
+     *                          aliases:    null|array                    Defaults to \`['oa' => 'OpenApi\\\\Annotations']\`.
+     *                          namespaces: null|array                    Defaults to \`['OpenApi\\\\Annotations\\\\']\`.
+     *                          analyser:   null|AnalyserInterface        Defaults to a new \`ReflectionAnalyser\` supporting both docblocks and attributes.
+     *                          analysis:   null|Analysis                 Defaults to a new \`Analysis\`.
+     *                          processors: null|array                    Defaults to \`Analysis::processors()\`.
+     *                          logger:     null|\\Psr\\Log\\LoggerInterface If not set logging will use \\OpenApi\\Logger as before.
+     *                          validate:   bool                          Defaults to \`true\`.
+     *                          version:    string                        Defaults to \`\\OpenApi\\Annotations\\OpenApi::VERSION_3_0_0\`. Alternatives are: \`\\OpenApi\\Annotations\\OpenApi::VERSION_3_1_0\`.
+     */
+    public static function scan(iterable $sources, array $options = []): OpenApi { /* ... */ }
+

Most notably the exclude and pattern keys are no longer supported. Instead, a Symfony Finder instance can be passed in as source directly (same as with Generator::generate()).

If needed, the \\OpenApi\\Util class provides a builder method that allows to keep the status-quo

$exclude = ['tests'];
+$pattern = '*.php';
+
+$openapi = \\OpenApi\\Generator::scan(\\OpenApi\\Util::finder(__DIR__, $exclude, $pattern));
+
+// same as
+
+$openapi = \\OpenApi\\scan(__DIR__, ['exclude' => $exclude, 'pattern' => $pattern]);
+
`,31),o=[p];function c(l,i,u,r,k,d){return a(),s("div",null,o)}var f=n(e,[["render",c]]);export{h as __pageData,f as default}; diff --git a/assets/reference_generator.md.857d4ce7.lean.js b/assets/reference_generator.md.857d4ce7.lean.js new file mode 100644 index 00000000..ae71e1ea --- /dev/null +++ b/assets/reference_generator.md.857d4ce7.lean.js @@ -0,0 +1 @@ +import{_ as n,c as s,o as a,a as t}from"./app.850f5e05.js";const h='{"title":"Using the Generator","description":"","frontmatter":{},"headers":[{"level":2,"title":"Introduction","slug":"introduction"},{"level":2,"title":"The \\\\OpenApi\\\\scan() function","slug":"the-openapi-scan-function"},{"level":2,"title":"The \\\\OpenApi\\\\Generator class","slug":"the-openapi-generator-class"}],"relativePath":"reference/generator.md"}',e={},p=t("",31),o=[p];function c(l,i,u,r,k,d){return a(),s("div",null,o)}var f=n(e,[["render",c]]);export{h as __pageData,f as default}; diff --git a/assets/reference_index.md.05295186.js b/assets/reference_index.md.05295186.js new file mode 100644 index 00000000..d7e68eba --- /dev/null +++ b/assets/reference_index.md.05295186.js @@ -0,0 +1 @@ +import{_ as e,c as t,o,a as r}from"./app.850f5e05.js";const f='{"title":"Reference","description":"","frontmatter":{},"headers":[],"relativePath":"reference/index.md"}',a={},n=r('

Reference

In total there are a number of different aspects to using swagger-php. Depending on how custom your requirements are this might be limited to just annotating your code and using the command line tool.

However, swagger-php offers more.

  • Attributes

    The new way of adding meta-data to your codebase. Requires PHP 8.1

  • Docblock annotations

    The 'traditional' way of documenting your API.

  • The Generator

    The \\OpenAPI\\Generator class is the main entry point to programmatically generate OpenAPI documents from your code.

  • Processors

    swagger-php comes with a list of pre-defined processors that convert the raw data to a complete OpenAPI document. Custom processors can be added or existing removed to tweak swagger-php` to your requirements.

',4),s=[n];function c(i,d,p,h,l,m){return o(),t("div",null,s)}var _=e(a,[["render",c]]);export{f as __pageData,_ as default}; diff --git a/assets/reference_index.md.05295186.lean.js b/assets/reference_index.md.05295186.lean.js new file mode 100644 index 00000000..5fba3640 --- /dev/null +++ b/assets/reference_index.md.05295186.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o,a as r}from"./app.850f5e05.js";const f='{"title":"Reference","description":"","frontmatter":{},"headers":[],"relativePath":"reference/index.md"}',a={},n=r("",4),s=[n];function c(i,d,p,h,l,m){return o(),t("div",null,s)}var _=e(a,[["render",c]]);export{f as __pageData,_ as default}; diff --git a/assets/reference_processors.md.40e47002.js b/assets/reference_processors.md.40e47002.js new file mode 100644 index 00000000..1df3d8db --- /dev/null +++ b/assets/reference_processors.md.40e47002.js @@ -0,0 +1,13 @@ +import{_ as e,c as a,o as t,a as n}from"./app.850f5e05.js";const m='{"title":"Processor Reference","description":"","frontmatter":{},"headers":[{"level":2,"title":"Processor Configuration","slug":"processor-configuration"},{"level":3,"title":"Command line","slug":"command-line"},{"level":3,"title":"Programmatically with PHP","slug":"programmatically-with-php"},{"level":2,"title":"Default Processors","slug":"default-processors"},{"level":3,"title":"DocBlockDescriptions","slug":"docblockdescriptions"},{"level":3,"title":"MergeIntoOpenApi","slug":"mergeintoopenapi"},{"level":3,"title":"MergeIntoComponents","slug":"mergeintocomponents"},{"level":3,"title":"ExpandClasses","slug":"expandclasses"},{"level":3,"title":"ExpandInterfaces","slug":"expandinterfaces"},{"level":3,"title":"ExpandTraits","slug":"expandtraits"},{"level":3,"title":"ExpandEnums","slug":"expandenums"},{"level":3,"title":"AugmentSchemas","slug":"augmentschemas"},{"level":3,"title":"AugmentRequestBody","slug":"augmentrequestbody"},{"level":3,"title":"AugmentProperties","slug":"augmentproperties"},{"level":3,"title":"BuildPaths","slug":"buildpaths"},{"level":3,"title":"AugmentParameters","slug":"augmentparameters"},{"level":3,"title":"AugmentRefs","slug":"augmentrefs"},{"level":3,"title":"MergeJsonContent","slug":"mergejsoncontent"},{"level":3,"title":"MergeXmlContent","slug":"mergexmlcontent"},{"level":3,"title":"OperationId","slug":"operationid"},{"level":3,"title":"AugmentTags","slug":"augmenttags"},{"level":3,"title":"CleanUnmerged","slug":"cleanunmerged"},{"level":3,"title":"PathFilter","slug":"pathfilter"},{"level":3,"title":"CleanUnusedComponents","slug":"cleanunusedcomponents"}],"relativePath":"reference/processors.md"}',s={},r=n(`

Processor Reference

This page is generated automatically from the swagger-php sources.

For improvements head over to GitHub and create a PR \u{1F609}

Processors are listed in the default order of execution.

Processor Configuration

Command line

The -c option allows to specify a name/value pair with the name consisting of the processor name (starting lowercase) and option name separated by a dot (.).

> ./bin/openapi -c operatinId.hash=true // ...
+> ./bin/openapi -c pathFilter.tags[]=/pets/ -c pathFilter.tags[]=/store/ // ...
+

Programmatically with PHP

Configuration can be set using the Generator::setConfig() method. Keys can either be the same as on the command line or be broken down into nested arrays.

(new Generator())
+    ->setConfig([
+        'operationId.hash' => true,
+        'pathFilter' => [
+            'tags' => [
+                '/pets/',
+                '/store/',
+            ],
+        ],
+    ]);
+

Default Processors

DocBlockDescriptions

Checks if the annotation has a summary and/or description property and uses the text in the comment block (above the annotations) as summary and/or description.

Use null, for example: @Annotation(description=null), if you don't want the annotation to have a description.

MergeIntoOpenApi

Merge all @OA\\OpenApi annotations into one.

MergeIntoComponents

Merge reusable annotation into @OA\\Schemas.

ExpandClasses

Iterate over the chain of ancestors of a schema and:

  • if the ancestor has a schema => inherit from the ancestor if it has a schema (allOf) and stop.
  • else => merge ancestor properties into the schema.

ExpandInterfaces

Look at all (direct) interfaces for a schema and:

  • merge interfaces annotations/methods into the schema if the interface does not have a schema itself
  • inherit from the interface if it has a schema (allOf).

ExpandTraits

Look at all (direct) traits for a schema and:

  • merge trait annotations/methods/properties into the schema if the trait does not have a schema itself
  • inherit from the trait if it has a schema (allOf).

ExpandEnums

Expands PHP enums.

Determines schema, enum and type.

AugmentSchemas

Use the Schema context to extract useful information and inject that into the annotation.

Merges properties.

AugmentRequestBody

Use the RequestBody context to extract useful information and inject that into the annotation.

AugmentProperties

Use the property context to extract useful information and inject that into the annotation.

BuildPaths

Build the openapi->paths using the detected @OA\\PathItem and @OA\\Operation (@OA\\Get, @OA\\Post, etc).

AugmentParameters

Augments shared and operations parameters from docblock comments.

Config settings

augmentParameters.augmentOperationParameters : bool
default : true

If set to true try to find operation parameter descriptions in the operation docblock.

AugmentRefs

MergeJsonContent

Split JsonContent into Schema and MediaType.

MergeXmlContent

Split XmlContent into Schema and MediaType.

OperationId

Generate the OperationId based on the context of the OpenApi annotation.

Config settings

operationId.hash : bool
default : true

If set to true generate ids (md5) instead of clear text operation ids.

AugmentTags

Ensures that all tags used on operations also exist in the global tags list.

CleanUnmerged

PathFilter

Allows to filter endpoints based on tags and/or path.

If no tags or paths filters are set, no filtering is performed. All filter (regular) expressions must be enclosed within delimiter characters as they are used as-is.

Config settings

pathFilter.tags : array
default : []

A list of regular expressions to match tags to include.

pathFilter.paths : array
default : []

A list of regular expressions to match paths to include.

CleanUnusedComponents

Tracks the use of all Components and removed unused schemas.

Config settings

cleanUnusedComponents.enabled : bool
default : false

Enables/disables the CleanUnusedComponents processor.

`,66),o=[r];function p(i,c,l,h,d,g){return t(),a("div",null,o)}var f=e(s,[["render",p]]);export{m as __pageData,f as default}; diff --git a/assets/reference_processors.md.40e47002.lean.js b/assets/reference_processors.md.40e47002.lean.js new file mode 100644 index 00000000..105c44d1 --- /dev/null +++ b/assets/reference_processors.md.40e47002.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a as n}from"./app.850f5e05.js";const m='{"title":"Processor Reference","description":"","frontmatter":{},"headers":[{"level":2,"title":"Processor Configuration","slug":"processor-configuration"},{"level":3,"title":"Command line","slug":"command-line"},{"level":3,"title":"Programmatically with PHP","slug":"programmatically-with-php"},{"level":2,"title":"Default Processors","slug":"default-processors"},{"level":3,"title":"DocBlockDescriptions","slug":"docblockdescriptions"},{"level":3,"title":"MergeIntoOpenApi","slug":"mergeintoopenapi"},{"level":3,"title":"MergeIntoComponents","slug":"mergeintocomponents"},{"level":3,"title":"ExpandClasses","slug":"expandclasses"},{"level":3,"title":"ExpandInterfaces","slug":"expandinterfaces"},{"level":3,"title":"ExpandTraits","slug":"expandtraits"},{"level":3,"title":"ExpandEnums","slug":"expandenums"},{"level":3,"title":"AugmentSchemas","slug":"augmentschemas"},{"level":3,"title":"AugmentRequestBody","slug":"augmentrequestbody"},{"level":3,"title":"AugmentProperties","slug":"augmentproperties"},{"level":3,"title":"BuildPaths","slug":"buildpaths"},{"level":3,"title":"AugmentParameters","slug":"augmentparameters"},{"level":3,"title":"AugmentRefs","slug":"augmentrefs"},{"level":3,"title":"MergeJsonContent","slug":"mergejsoncontent"},{"level":3,"title":"MergeXmlContent","slug":"mergexmlcontent"},{"level":3,"title":"OperationId","slug":"operationid"},{"level":3,"title":"AugmentTags","slug":"augmenttags"},{"level":3,"title":"CleanUnmerged","slug":"cleanunmerged"},{"level":3,"title":"PathFilter","slug":"pathfilter"},{"level":3,"title":"CleanUnusedComponents","slug":"cleanunusedcomponents"}],"relativePath":"reference/processors.md"}',s={},r=n("",66),o=[r];function p(i,c,l,h,d,g){return t(),a("div",null,o)}var f=e(s,[["render",p]]);export{m as __pageData,f as default}; diff --git a/assets/related-projects.md.cb587093.js b/assets/related-projects.md.cb587093.js new file mode 100644 index 00000000..db0611cf --- /dev/null +++ b/assets/related-projects.md.cb587093.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as r,a}from"./app.850f5e05.js";const u='{"title":"Related projects","description":"","frontmatter":{"sidebar":false},"headers":[],"relativePath":"related-projects.md"}',n={},o=a('

Related projects

ProjectDescription
Swagger UIThe webinterface for reading the generated documentation
Swagger ExplainedBrowse the spec by using an swagger.json.
silex2swaggerGenerate swagger documentation from Silex Annotations
yii2-swaggerswagger-php integration with yii2
Lumen swaggerswagger-php integration with lumen/laravel
NelmioApiDocBundleSymfony bundle on top of swagger-php
auto-swagger-uiAutomatically add swagger ui and json to your application
openapi-routerConfigure framework routes from OpenApi annotations
openapi-verifierVerify response against OpenAPI specification in PHPUnit
openapi-filterFilter internal paths, operations, parameters, etc
OpenAPI-Symfony-RoutingLoad routes in Symfony based on OpenAPI annotations
Swag It PHPConvert JSON to PHP Swagger annotations
Laravel SwaggerOpenApi or Swagger integration to Laravel
openapi-extrasExtra annotations for swagger-php
openapi-serializeSerialize an object using swagger-php

Is a related project missing? Create a pull request!

',3),i=[o];function d(p,s,g,l,h,f){return r(),t("div",null,i)}var _=e(n,[["render",d]]);export{u as __pageData,_ as default}; diff --git a/assets/related-projects.md.cb587093.lean.js b/assets/related-projects.md.cb587093.lean.js new file mode 100644 index 00000000..4c6d431d --- /dev/null +++ b/assets/related-projects.md.cb587093.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as r,a}from"./app.850f5e05.js";const u='{"title":"Related projects","description":"","frontmatter":{"sidebar":false},"headers":[],"relativePath":"related-projects.md"}',n={},o=a("",3),i=[o];function d(p,s,g,l,h,f){return r(),t("div",null,i)}var _=e(n,[["render",d]]);export{u as __pageData,_ as default}; diff --git a/assets/snippets_preamble_annotations.md.bb82314f.js b/assets/snippets_preamble_annotations.md.bb82314f.js new file mode 100644 index 00000000..63c48e72 --- /dev/null +++ b/assets/snippets_preamble_annotations.md.bb82314f.js @@ -0,0 +1 @@ +import{_ as a,c as r,o,d as e,e as t}from"./app.850f5e05.js";const u='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"snippets/preamble_annotations.md"}',s={},n=e("p",null,[t("In addition to this page, there are also a number of "),e("a",{href:"https://github.com/zircote/swagger-php/tree/master/Examples#readme",target:"_blank",rel:"noopener noreferrer"},"examples"),t(" which might help you out.")],-1),p=[n];function c(i,l,_,d,h,m){return o(),r("div",null,p)}var g=a(s,[["render",c]]);export{u as __pageData,g as default}; diff --git a/assets/snippets_preamble_annotations.md.bb82314f.lean.js b/assets/snippets_preamble_annotations.md.bb82314f.lean.js new file mode 100644 index 00000000..63c48e72 --- /dev/null +++ b/assets/snippets_preamble_annotations.md.bb82314f.lean.js @@ -0,0 +1 @@ +import{_ as a,c as r,o,d as e,e as t}from"./app.850f5e05.js";const u='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"snippets/preamble_annotations.md"}',s={},n=e("p",null,[t("In addition to this page, there are also a number of "),e("a",{href:"https://github.com/zircote/swagger-php/tree/master/Examples#readme",target:"_blank",rel:"noopener noreferrer"},"examples"),t(" which might help you out.")],-1),p=[n];function c(i,l,_,d,h,m){return o(),r("div",null,p)}var g=a(s,[["render",c]]);export{u as __pageData,g as default}; diff --git a/assets/snippets_preamble_attributes.md.b131e034.js b/assets/snippets_preamble_attributes.md.b131e034.js new file mode 100644 index 00000000..dc86e742 --- /dev/null +++ b/assets/snippets_preamble_attributes.md.b131e034.js @@ -0,0 +1 @@ +import{_ as a,c as r,o,d as e,e as t}from"./app.850f5e05.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"snippets/preamble_annotations.md"}',s={},n=e("p",null,[t("In addition to this page, there are also a number of "),e("a",{href:"https://github.com/zircote/swagger-php/tree/master/Examples#readme",target:"_blank",rel:"noopener noreferrer"},"examples"),t(" which might help you out.")],-1),p=[n];function c(i,l,_,d,h,m){return o(),r("div",null,p)}var g=a(s,[["render",c]]);export{f as __pageData,g as default}; diff --git a/assets/snippets_preamble_attributes.md.b131e034.lean.js b/assets/snippets_preamble_attributes.md.b131e034.lean.js new file mode 100644 index 00000000..dc86e742 --- /dev/null +++ b/assets/snippets_preamble_attributes.md.b131e034.lean.js @@ -0,0 +1 @@ +import{_ as a,c as r,o,d as e,e as t}from"./app.850f5e05.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"snippets/preamble_annotations.md"}',s={},n=e("p",null,[t("In addition to this page, there are also a number of "),e("a",{href:"https://github.com/zircote/swagger-php/tree/master/Examples#readme",target:"_blank",rel:"noopener noreferrer"},"examples"),t(" which might help you out.")],-1),p=[n];function c(i,l,_,d,h,m){return o(),r("div",null,p)}var g=a(s,[["render",c]]);export{f as __pageData,g as default}; diff --git a/assets/snippets_preamble_processors.md.309ada33.js b/assets/snippets_preamble_processors.md.309ada33.js new file mode 100644 index 00000000..bee98fd0 --- /dev/null +++ b/assets/snippets_preamble_processors.md.309ada33.js @@ -0,0 +1 @@ +import{_ as t,c as s,o,d as e}from"./app.850f5e05.js";const u='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"snippets/preamble_processors.md"}',r={},a=e("p",null,[e("em",null,"Processors are listed in the default order of execution.")],-1),c=[a];function n(p,_,l,d,i,f){return o(),s("div",null,c)}var h=t(r,[["render",n]]);export{u as __pageData,h as default}; diff --git a/assets/snippets_preamble_processors.md.309ada33.lean.js b/assets/snippets_preamble_processors.md.309ada33.lean.js new file mode 100644 index 00000000..bee98fd0 --- /dev/null +++ b/assets/snippets_preamble_processors.md.309ada33.lean.js @@ -0,0 +1 @@ +import{_ as t,c as s,o,d as e}from"./app.850f5e05.js";const u='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"snippets/preamble_processors.md"}',r={},a=e("p",null,[e("em",null,"Processors are listed in the default order of execution.")],-1),c=[a];function n(p,_,l,d,i,f){return o(),s("div",null,c)}var h=t(r,[["render",n]]);export{u as __pageData,h as default}; diff --git a/assets/style.29d805fc.css b/assets/style.29d805fc.css new file mode 100644 index 00000000..4f0f50a5 --- /dev/null +++ b/assets/style.29d805fc.css @@ -0,0 +1 @@ +:root{--c-white: #ffffff;--c-white-dark: #f8f8f8;--c-black: #000000;--c-divider-light: rgba(60, 60, 67, .12);--c-divider-dark: rgba(84, 84, 88, .48);--c-text-light-1: #2c3e50;--c-text-light-2: #476582;--c-text-light-3: #90a4b7;--c-brand: #3eaf7c;--c-brand-light: #4abf8a;--font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--font-family-mono: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;--z-index-navbar: 10;--z-index-sidebar: 6;--shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);--shadow-2: 0 3px 12px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .07);--shadow-3: 0 12px 32px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08);--shadow-4: 0 14px 44px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .12);--shadow-5: 0 18px 56px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .16);--header-height: 3.6rem}:root{--c-divider: var(--c-divider-light);--c-text: var(--c-text-light-1);--c-text-light: var(--c-text-light-2);--c-text-lighter: var(--c-text-light-3);--c-bg: var(--c-white);--c-bg-accent: var(--c-white-dark);--code-line-height: 24px;--code-font-family: var(--font-family-mono);--code-font-size: 14px;--code-inline-bg-color: rgba(27, 31, 35, .05);--code-bg-color: #282c34}*,:before,:after{box-sizing:border-box}html{line-height:1.4;font-size:16px;-webkit-text-size-adjust:100%}body{margin:0;width:100%;min-width:320px;min-height:100vh;line-height:1.4;font-family:var(--font-family-base);font-size:16px;font-weight:400;color:var(--c-text);background-color:var(--c-bg);direction:ltr;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin:0;line-height:1.25}h1,h2,h3,h4,h5,h6,strong,b{font-weight:600}h1:hover .header-anchor,h1:focus .header-anchor,h2:hover .header-anchor,h2:focus .header-anchor,h3:hover .header-anchor,h3:focus .header-anchor,h4:hover .header-anchor,h4:focus .header-anchor,h5:hover .header-anchor,h5:focus .header-anchor,h6:hover .header-anchor,h6:focus .header-anchor{opacity:1}h1{margin-top:1.5rem;font-size:1.9rem}@media screen and (min-width: 420px){h1{font-size:2.2rem}}h2{margin-top:2.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--c-divider);padding-bottom:.3rem;line-height:1.25;font-size:1.65rem}h2+h3{margin-top:1.5rem}h3{margin-top:2rem;font-size:1.35rem}h4{font-size:1.15rem}p,ol,ul{margin:1rem 0;line-height:1.7}a,area,button,[role=button],input,label,select,summary,textarea{touch-action:manipulation}a{text-decoration:none;color:var(--c-brand)}a:hover{text-decoration:underline}a.header-anchor{float:left;margin-top:.125em;margin-left:-.87em;padding-right:.23em;font-size:.85em;opacity:0}a.header-anchor:hover,a.header-anchor:focus{text-decoration:none}figure{margin:0}img{max-width:100%}ul,ol{padding-left:1.25em}li>ul,li>ol{margin:0}table{display:block;border-collapse:collapse;margin:1rem 0;overflow-x:auto}tr{border-top:1px solid #dfe2e5}tr:nth-child(2n){background-color:#f6f8fa}th,td{border:1px solid #dfe2e5;padding:.6em 1em}blockquote{margin:1rem 0;border-left:.2rem solid #dfe2e5;padding:.25rem 0 .25rem 1rem;font-size:1rem;color:#999}blockquote>p{margin:0}form{margin:0}.theme.sidebar-open .sidebar-mask{display:block}.theme.no-navbar>h1,.theme.no-navbar>h2,.theme.no-navbar>h3,.theme.no-navbar>h4,.theme.no-navbar>h5,.theme.no-navbar>h6{margin-top:1.5rem;padding-top:0}.theme.no-navbar aside{top:0}@media screen and (min-width: 720px){.theme.no-sidebar aside{display:none}.theme.no-sidebar main{margin-left:0}}.sidebar-mask{position:fixed;z-index:2;display:none;width:100vw;height:100vh}code{margin:0;border-radius:3px;padding:.25rem .5rem;font-family:var(--code-font-family);font-size:.85em;color:var(--c-text-light);background-color:var(--code-inline-bg-color)}code .token.deleted{color:#ec5975}code .token.inserted{color:var(--c-brand)}div[class*=language-]{position:relative;margin:1rem -1.5rem;background-color:var(--code-bg-color);overflow-x:auto}li>div[class*=language-]{border-radius:6px 0 0 6px;margin:1rem -1.5rem 1rem -1.25rem;line-height:initial}@media (min-width: 420px){div[class*=language-]{margin:1rem 0;border-radius:6px}li>div[class*=language-]{margin:1rem 0 1rem 0rem;border-radius:6px}}[class*=language-] pre,[class*=language-] code{text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;background:transparent}[class*=language-] pre{position:relative;z-index:1;margin:0;padding:1.25rem 1.5rem;overflow-x:auto}[class*=language-] code{padding:0;line-height:var(--code-line-height);font-size:var(--code-font-size);color:#eee}.highlight-lines{position:absolute;top:0;bottom:0;left:0;padding:1.25rem 0;width:100%;line-height:var(--code-line-height);font-family:var(--code-font-family);font-size:var(--code-font-size);user-select:none;overflow:hidden}.highlight-lines .highlighted{background-color:#000000a8}div[class*=language-].line-numbers-mode{padding-left:3.5rem}.line-numbers-wrapper{position:absolute;top:0;bottom:0;left:0;z-index:3;border-right:1px solid rgba(0,0,0,.5);padding:1.25rem 0;width:3.5rem;text-align:center;line-height:var(--code-line-height);font-family:var(--code-font-family);font-size:var(--code-font-size);color:#888}div[class*=language-]:before{position:absolute;top:.6em;right:1em;z-index:2;font-size:.8rem;color:#888}div[class~=language-html]:before,div[class~=language-markup]:before{content:"html"}div[class~=language-md]:before,div[class~=language-markdown]:before{content:"md"}div[class~=language-css]:before{content:"css"}div[class~=language-sass]:before{content:"sass"}div[class~=language-scss]:before{content:"scss"}div[class~=language-less]:before{content:"less"}div[class~=language-stylus]:before{content:"styl"}div[class~=language-js]:before,div[class~=language-javascript]:before{content:"js"}div[class~=language-ts]:before,div[class~=language-typescript]:before{content:"ts"}div[class~=language-json]:before{content:"json"}div[class~=language-rb]:before,div[class~=language-ruby]:before{content:"rb"}div[class~=language-py]:before,div[class~=language-python]:before{content:"py"}div[class~=language-sh]:before,div[class~=language-bash]:before{content:"sh"}div[class~=language-php]:before{content:"php"}div[class~=language-go]:before{content:"go"}div[class~=language-rust]:before{content:"rust"}div[class~=language-java]:before{content:"java"}div[class~=language-c]:before{content:"c"}div[class~=language-yaml]:before{content:"yaml"}div[class~=language-dockerfile]:before{content:"dockerfile"}div[class~=language-vue]:before{content:"vue"}.token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata{color:#999}.token.punctuation{color:#ccc}.token.tag,.token.attr-name,.token.namespace,.token.deleted{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.number,.token.function{color:#f08d49}.token.property,.token.class-name,.token.constant,.token.symbol{color:#f8c555}.token.selector,.token.important,.token.atrule,.token.keyword,.token.builtin{color:#cc99cd}.token.string,.token.char,.token.attr-value,.token.regex,.token.variable{color:#7ec699}.token.operator,.token.entity,.token.url{color:#67cdcc}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}.custom-block.tip,.custom-block.info,.custom-block.warning,.custom-block.danger{margin:1rem 0;border-left:.5rem solid;padding:.1rem 1.5rem;overflow-x:auto}.custom-block.tip{background-color:#f3f5f7;border-color:var(--c-brand)}.custom-block.info{background-color:#f3f5f7;border-color:var(--c-text-light-2)}.custom-block.warning{border-color:#e7c000;color:#6b5900;background-color:#ffe5644d}.custom-block.warning .custom-block-title{color:#b29400}.custom-block.warning a{color:var(--c-text)}.custom-block.danger{border-color:#c00;color:#4d0000;background-color:#ffe6e6}.custom-block.danger .custom-block-title{color:#900}.custom-block.danger a{color:var(--c-text)}.custom-block.details{position:relative;display:block;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:#eee}.custom-block.details h4{margin-top:0}.custom-block.details figure:last-child,.custom-block.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-block.details summary{outline:none;cursor:pointer}.custom-block-title{margin-bottom:-.4rem;font-weight:600}.sidebar-links{margin:0;padding:0;list-style:none}.sidebar-link-item{display:block;margin:0;border-left:.25rem solid transparent;color:var(--c-text)}a.sidebar-link-item:hover{text-decoration:none;color:var(--c-brand)}a.sidebar-link-item.active{color:var(--c-brand)}.sidebar>.sidebar-links{padding:.75rem 0 5rem}@media (min-width: 720px){.sidebar>.sidebar-links{padding:1.5rem 0}}.sidebar>.sidebar-links>.sidebar-link+.sidebar-link{padding-top:.5rem}@media (min-width: 720px){.sidebar>.sidebar-links>.sidebar-link+.sidebar-link{padding-top:1.25rem}}.sidebar>.sidebar-links>.sidebar-link>.sidebar-link-item{padding:.35rem 1.5rem .35rem 1.25rem;font-size:1.1rem;font-weight:700}.sidebar>.sidebar-links>.sidebar-link>a.sidebar-link-item.active{border-left-color:var(--c-brand);font-weight:600}.sidebar>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-link-item{display:block;padding:.35rem 1.5rem .35rem 2rem;line-height:1.4;font-size:1rem;font-weight:400}.sidebar>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>a.sidebar-link-item.active{border-left-color:var(--c-brand);font-weight:600}.sidebar>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-link-item{display:block;padding:.3rem 1.5rem .3rem 3rem;line-height:1.4;font-size:.9rem;font-weight:400}.sidebar>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-link-item{display:block;padding:.3rem 1.5rem .3rem 4rem;line-height:1.4;font-size:.9rem;font-weight:400}.debug[data-v-765646fb]{box-sizing:border-box;position:fixed;right:8px;bottom:8px;z-index:9999;border-radius:4px;width:74px;height:32px;color:#eee;overflow:hidden;cursor:pointer;background-color:#000000d9;transition:all .15s ease}.debug[data-v-765646fb]:hover{background-color:#000000bf}.debug.open[data-v-765646fb]{right:0;bottom:0;width:100%;height:100%;margin-top:0;border-radius:0;padding:0;overflow:scroll}@media (min-width: 512px){.debug.open[data-v-765646fb]{width:512px}}.debug.open[data-v-765646fb]:hover{background-color:#000000d9}.title[data-v-765646fb]{margin:0;padding:6px 16px;line-height:20px;font-size:13px}.block[data-v-765646fb]{margin:2px 0 0;border-top:1px solid rgba(255,255,255,.16);padding:8px 16px;font-family:Hack,monospace;font-size:13px}.block+.block[data-v-765646fb]{margin-top:8px}.icon.outbound{position:relative;top:-1px;display:inline-block;vertical-align:middle;color:var(--c-text-lighter)}.item[data-v-49fe041d]{display:block;padding:0 1.5rem;line-height:36px;font-size:1rem;font-weight:600;color:var(--c-text);white-space:nowrap}.item[data-v-49fe041d]:hover,.item.active[data-v-49fe041d]{text-decoration:none;color:var(--c-brand)}.item.external[data-v-49fe041d]:hover{border-bottom-color:transparent;color:var(--c-text)}@media (min-width: 720px){.item[data-v-49fe041d]{border-bottom:2px solid transparent;padding:0;line-height:24px;font-size:.9rem;font-weight:500}.item[data-v-49fe041d]:hover,.item.active[data-v-49fe041d]{border-bottom-color:var(--c-brand);color:var(--c-text)}}.home-hero[data-v-5d8b683d]{margin:2.5rem 0 2.75rem;padding:0 1.5rem;text-align:center}@media (min-width: 420px){.home-hero[data-v-5d8b683d]{margin:3.5rem 0}}@media (min-width: 720px){.home-hero[data-v-5d8b683d]{margin:4rem 0 4.25rem}}.figure[data-v-5d8b683d]{padding:0 1.5rem}.image[data-v-5d8b683d]{display:block;margin:0 auto;width:auto;max-width:100%;max-height:280px}.title[data-v-5d8b683d]{margin-top:1.5rem;font-size:2rem}@media (min-width: 420px){.title[data-v-5d8b683d]{font-size:3rem}}@media (min-width: 720px){.title[data-v-5d8b683d]{margin-top:2rem}}.tagline[data-v-5d8b683d]{margin:0;margin-top:.25rem;line-height:1.3;font-size:1.2rem;color:var(--c-text-light)}@media (min-width: 420px){.tagline[data-v-5d8b683d]{line-height:1.2;font-size:1.6rem}}.action[data-v-5d8b683d]{margin-top:1.5rem;display:inline-block}.action.alt[data-v-5d8b683d]{margin-left:1.5rem}@media (min-width: 420px){.action[data-v-5d8b683d]{margin-top:2rem;display:inline-block}}.action[data-v-5d8b683d] .item{display:inline-block;border-radius:6px;padding:0 20px;line-height:44px;font-size:1rem;font-weight:500;color:var(--c-bg);background-color:var(--c-brand);border:2px solid var(--c-brand);transition:background-color .1s ease}.action.alt[data-v-5d8b683d] .item{background-color:var(--c-bg);color:var(--c-brand)}.action[data-v-5d8b683d] .item:hover{text-decoration:none;color:var(--c-bg);background-color:var(--c-brand-light)}@media (min-width: 420px){.action[data-v-5d8b683d] .item{padding:0 24px;line-height:52px;font-size:1.2rem;font-weight:500}}.home-features[data-v-245bde66]{margin:0 auto;padding:2.5rem 0 2.75rem;max-width:960px}.home-hero+.home-features[data-v-245bde66]{padding-top:0}@media (min-width: 420px){.home-features[data-v-245bde66]{padding:3.25rem 0 3.5rem}.home-hero+.home-features[data-v-245bde66]{padding-top:0}}@media (min-width: 720px){.home-features[data-v-245bde66]{padding-right:1.5rem;padding-left:1.5rem}}.wrapper[data-v-245bde66]{padding:0 1.5rem}.home-hero+.home-features .wrapper[data-v-245bde66]{border-top:1px solid var(--c-divider);padding-top:2.5rem}@media (min-width: 420px){.home-hero+.home-features .wrapper[data-v-245bde66]{padding-top:3.25rem}}@media (min-width: 720px){.wrapper[data-v-245bde66]{padding-right:0;padding-left:0}}.container[data-v-245bde66]{margin:0 auto;max-width:392px}@media (min-width: 720px){.container[data-v-245bde66]{max-width:960px}}.features[data-v-245bde66]{display:flex;flex-wrap:wrap;margin:-20px -24px}.feature[data-v-245bde66]{flex-shrink:0;padding:20px 24px;width:100%}@media (min-width: 720px){.feature[data-v-245bde66]{width:calc(100% / 3)}}.title[data-v-245bde66]{margin:0;border-bottom:0;line-height:1.4;font-size:1.25rem;font-weight:500}@media (min-width: 420px){.title[data-v-245bde66]{font-size:1.4rem}}.details[data-v-245bde66]{margin:0;line-height:1.6;font-size:1rem;color:var(--c-text-light)}.title+.details[data-v-245bde66]{padding-top:.25rem}.footer[data-v-bff49316]{margin:0 auto;max-width:960px}@media (min-width: 720px){.footer[data-v-bff49316]{padding:0 1.5rem}}.container[data-v-bff49316]{padding:2rem 1.5rem 2.25rem}.home-hero+.footer .container[data-v-bff49316],.home-features+.footer .container[data-v-bff49316],.home-content+.footer .container[data-v-bff49316]{border-top:1px solid var(--c-divider)}@media (min-width: 420px){.container[data-v-bff49316]{padding:3rem 1.5rem 3.25rem}}.text[data-v-bff49316]{margin:0;text-align:center;line-height:1.4;font-size:.9rem;color:var(--c-text-light)}.home[data-v-8382b818]{padding-top:var(--header-height)}.home-content[data-v-8382b818]{max-width:960px;margin:0 auto;padding:0 1.5rem}.nav-bar-title[data-v-016a8bd8]{font-size:1.3rem;font-weight:600;color:var(--c-text);display:flex;justify-content:center;align-items:center}.nav-bar-title[data-v-016a8bd8]:hover{text-decoration:none}.logo[data-v-016a8bd8]{margin-right:.75rem;height:1.3rem;vertical-align:bottom}.item[data-v-07381bdb]{display:block;padding:0 1.5rem 0 2.5rem;line-height:32px;font-size:.9rem;font-weight:500;color:var(--c-text);white-space:nowrap}@media (min-width: 720px){.item[data-v-07381bdb]{padding:0 24px 0 12px;line-height:32px;font-size:.85rem;font-weight:500;color:var(--c-text);white-space:nowrap}.item.active .arrow[data-v-07381bdb]{opacity:1}}.item[data-v-07381bdb]:hover,.item.active[data-v-07381bdb]{text-decoration:none;color:var(--c-brand)}.item.external[data-v-07381bdb]:hover{border-bottom-color:transparent;color:var(--c-text)}@media (min-width: 720px){.arrow[data-v-07381bdb]{display:inline-block;margin-right:8px;border-top:6px solid #ccc;border-right:4px solid transparent;border-bottom:0;border-left:4px solid transparent;vertical-align:middle;opacity:0;transform:translateY(-2px) rotate(-90deg)}}.nav-dropdown-link[data-v-18d75f62]{position:relative;height:36px;overflow:hidden;cursor:pointer}@media (min-width: 720px){.nav-dropdown-link[data-v-18d75f62]{height:auto;overflow:visible}.nav-dropdown-link:hover .dialog[data-v-18d75f62]{display:block}}.nav-dropdown-link.open[data-v-18d75f62]{height:auto}.button[data-v-18d75f62]{display:block;border:0;padding:0 1.5rem;width:100%;text-align:left;line-height:36px;font-family:var(--font-family-base);font-size:1rem;font-weight:600;color:var(--c-text);white-space:nowrap;background-color:transparent;cursor:pointer}.button[data-v-18d75f62]:focus{outline:0}@media (min-width: 720px){.button[data-v-18d75f62]{border-bottom:2px solid transparent;padding:0;line-height:24px;font-size:.9rem;font-weight:500}}.button-arrow[data-v-18d75f62]{display:inline-block;margin-top:-1px;margin-left:8px;border-top:6px solid #ccc;border-right:4px solid transparent;border-bottom:0;border-left:4px solid transparent;vertical-align:middle}.button-arrow.right[data-v-18d75f62]{transform:rotate(-90deg)}@media (min-width: 720px){.button-arrow.right[data-v-18d75f62]{transform:rotate(0)}}.dialog[data-v-18d75f62]{margin:0;padding:0;list-style:none}@media (min-width: 720px){.dialog[data-v-18d75f62]{display:none;position:absolute;top:26px;right:-8px;border-radius:6px;padding:12px 0;min-width:128px;background-color:var(--c-bg);box-shadow:var(--shadow-3)}}.nav-links[data-v-35b91e7e]{padding:.75rem 0;border-bottom:1px solid var(--c-divider)}@media (min-width: 720px){.nav-links[data-v-35b91e7e]{display:flex;padding:6px 0 0;align-items:center;border-bottom:0}.item+.item[data-v-35b91e7e]{padding-left:24px}}.sidebar-button{position:absolute;top:.6rem;left:1rem;display:none;padding:.6rem;cursor:pointer}.sidebar-button .icon{display:block;width:1.25rem;height:1.25rem}@media screen and (max-width: 719px){.sidebar-button{display:block}}.nav-bar[data-v-40587210]{position:fixed;top:0;right:0;left:0;z-index:var(--z-index-navbar);display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--c-divider);padding:.7rem 1.5rem .7rem 4rem;height:var(--header-height);background-color:var(--c-bg)}@media (min-width: 720px){.nav-bar[data-v-40587210]{padding:.7rem 1.5rem}}.flex-grow[data-v-40587210]{flex-grow:1}.nav[data-v-40587210]{display:none}@media (min-width: 720px){.nav[data-v-40587210]{display:block}}.sidebar[data-v-17c48e2f]{position:fixed;top:var(--header-height);bottom:0;left:0;z-index:var(--z-index-sidebar);border-right:1px solid var(--c-divider);width:16.4rem;background-color:var(--c-bg);overflow-y:auto;transform:translate(-100%);transition:transform .25s ease}@media (min-width: 720px){.sidebar[data-v-17c48e2f]{transform:translate(0)}}@media (min-width: 960px){.sidebar[data-v-17c48e2f]{width:20rem}}.sidebar.open[data-v-17c48e2f]{transform:translate(0)}.nav[data-v-17c48e2f]{display:block}@media (min-width: 720px){.nav[data-v-17c48e2f]{display:none}}.link[data-v-55695e90]{display:inline-block;font-size:1rem;font-weight:500;color:var(--c-text-light)}.link[data-v-55695e90]:hover{text-decoration:none;color:var(--c-brand)}.icon[data-v-55695e90]{margin-left:4px}.last-updated[data-v-7e06cdca]{display:inline-block;margin:0;line-height:1.4;font-size:.9rem;color:var(--c-text-light)}@media (min-width: 960px){.last-updated[data-v-7e06cdca]{font-size:1rem}}.prefix[data-v-7e06cdca]{display:inline-block;font-weight:500}.datetime[data-v-7e06cdca]{display:inline-block;margin-left:6px;font-weight:400}.page-footer[data-v-b65b4b36]{padding-top:1rem;padding-bottom:1rem;overflow:auto}@media (min-width: 960px){.page-footer[data-v-b65b4b36]{display:flex;justify-content:space-between;align-items:center}}.updated[data-v-b65b4b36]{padding-top:4px}@media (min-width: 960px){.updated[data-v-b65b4b36]{padding-top:0}}.next-and-prev-link[data-v-e65a9748]{padding-top:1rem}.container[data-v-e65a9748]{display:flex;justify-content:space-between;border-top:1px solid var(--c-divider);padding-top:1rem}.prev[data-v-e65a9748],.next[data-v-e65a9748]{display:flex;flex-shrink:0;width:50%}.prev[data-v-e65a9748]{justify-content:flex-start;padding-right:12px}.next[data-v-e65a9748]{justify-content:flex-end;padding-left:12px}.link[data-v-e65a9748]{display:inline-flex;align-items:center;max-width:100%;font-size:1rem;font-weight:500}.text[data-v-e65a9748]{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.icon[data-v-e65a9748]{display:block;flex-shrink:0;width:16px;height:16px;fill:var(--c-text);transform:translateY(1px)}.icon-prev[data-v-e65a9748]{margin-right:8px}.icon-next[data-v-e65a9748]{margin-left:8px}.page[data-v-8fcebc32]{padding-top:var(--header-height)}@media (min-width: 720px){.page[data-v-8fcebc32]{margin-left:16.4rem}}@media (min-width: 960px){.page[data-v-8fcebc32]{margin-left:20rem}}.container[data-v-8fcebc32]{margin:0 auto;padding:0 1.5rem 4rem;max-width:48rem}.content[data-v-8fcebc32]{padding-bottom:1.5rem}@media (max-width: 420px){.content[data-v-8fcebc32]{clear:both}}#ads-container{margin:0 auto}@media (min-width: 420px){#ads-container{position:relative;right:0;float:right;margin:-8px -8px 24px 24px;width:146px}}@media (max-width: 420px){#ads-container{height:105px;margin:1.75rem 0}}@media (min-width: 1400px){#ads-container{position:fixed;right:8px;bottom:8px}}.tabs-component-tabs{border:solid 1px #ddd;border-radius:6px;margin-bottom:5px}@media (min-width: 700px){.tabs-component-tabs{border:0;align-items:stretch;display:flex;justify-content:flex-start;margin-bottom:-1px}}.tabs-component-tab{color:#999;font-size:14px;font-weight:600;margin-right:0;list-style:none}.tabs-component-tab:hover{color:#666}.tabs-component-tab.is-active{color:#000}.tabs-component-tab.is-disabled *{color:#cdcdcd;cursor:not-allowed!important}@media (min-width: 700px){.tabs-component-tab{background-color:#fff;border:solid 1px #ddd;border-radius:3px 3px 0 0;margin-right:.5em;transform:translateY(2px);transition:transform .3s ease}.tabs-component-tab.is-active{border-bottom:solid 1px #fff;z-index:2;transform:translateY(0)}}.tabs-component-tab-a{align-items:center;color:inherit;display:flex;padding:.5em 1.25em;text-decoration:none}.tabs-component-panels{padding:1em 0}@media (min-width: 700px){.tabs-component-panels{background-color:#fff;border:solid 1px #ddd;border-radius:6px;box-shadow:0 0 10px #0000000d;padding:1em;position:relative}}:root{--c-brand: #74a535;--c-brand-light: #94c73d;--c-bg: #fefefe}.tabs-component{margin:2em 0}.tabs-component-panels{padding:0;border:none}.tabs-component-tab-a{padding:.5em}.tabs-component-tab{transform:none}@media (min-width: 700px){.tabs-component-tab.is-active{border-bottom:solid 1px #ddd}} diff --git a/guide/annotations.html b/guide/annotations.html new file mode 100644 index 00000000..7650369a --- /dev/null +++ b/guide/annotations.html @@ -0,0 +1,96 @@ + + + + + + Annotations | Swagger-PHP + + + + + + + + + +

Annotations

Namespace

Using a namespace alias simplifies typing and improves readability.

All annotations are in the OpenApi\Annotations namespace.

Since Annotations are technically PHP comments, adding use OpenApi\Annotations as OA; is strictly speaking not necessary. However, doctrine will be quite specific about whether an alias is valid or not.

swagger-php will automatically register the @OA alias so all annotations can be used using the @OA shortcut without any additional work.

Doctrine

Annotations are PHP comments (docblocks) containing doctrine style annotations.

INFO

All documentation related to doctrine applies to annotations only.

Example:

<?php
+
+use OpenApi\Annotations as OA;
+
+/**
+ * @OA\Info(title="My First API", version="0.1")
+ */
+class OpenApi {}
+
+class MyController {
+
+    /**
+     * @OA\Get(
+     *     path="/api/resource.json",
+     *     @OA\Response(response="200", description="An example resource")
+     * )
+     */
+    public function resource() {
+        // ...
+    }
+}
+

Escaping

Escaping double quotes

Double quotes can be escaped by doubling them rather than using \

For example:

    @OA\Schema(
+       title="Request",
+       schema="Request",
+       example={
+          "configuration":"{""formConfig"":123}"
+       }
+     )
+

Arrays and Objects

Doctrine annotations support arrays, but use { and } instead of [ and ].

Doctrine also supports objects, which also use { and } and require the property names to be surrounded with ".

DON'T WRITE

/**
+ * @OA\Info(
+ *   title="My first API",
+ *   version="1.0.0",
+ *   contact={
+ *     "email": "support@example.com"
+ *   }
+ * )
+ */
+

This "works" but most objects have an annotation with the same name as the property, such as @OA\Contact for contact:

WRITE

/**
+ * @OA\Info(
+ *   title="My first API",
+ *   version="1.0.0",
+ *   @OA\Contact(
+ *     email="support@example.com"
+ *   )
+ * )
+ */
+

This also adds validation, so when you misspell a property or forget a required property, it will trigger a PHP warning.

For example, if you write emial="support@example.com", swagger-php would generate a notice with Unexpected field "emial" for @OA\Contact(), expecting "name", "email", ...

Placing multiple annotations of the same type will result in an array of objects. For objects, the key is defined by the field with the same name as the annotation: response in a @OA\Response, property in a @OA\Property, etc.

/**
+ * @OA\Get(
+ *   path="/products",
+ *   summary="list products",
+ *   @OA\Response(
+ *     response=200,
+ *     description="A list with products"
+ *   ),
+ *   @OA\Response(
+ *     response="default",
+ *     description="an ""unexpected"" error"
+ *   )
+ * )
+ */
+

Results in

openapi: 3.0.0
+paths:
+  /products:
+    get:
+      summary: "list products"
+      responses:
+        "200":
+          description: "A list with products"
+        default:
+          description: 'an "unexpected" error'
+

Constants

You can use constants inside doctrine annotations.

define("API_HOST", ($env === "production") ? "example.com" : "localhost");
+
/**
+ * @OA\Server(url=API_HOST)
+ */
+

TIP

Using the CLI you might need to include the php file with the constants using the --bootstrap options.

> openapi --bootstrap constants.php
+
+ + + + + \ No newline at end of file diff --git a/guide/attributes.html b/guide/attributes.html new file mode 100644 index 00000000..ff9eba7c --- /dev/null +++ b/guide/attributes.html @@ -0,0 +1,33 @@ + + + + + + Attributes | Swagger-PHP + + + + + + + + + +

Attributes

Namespace

Using a namespace alias simplifies typing and improves readability.

All attributes are in the OpenApi\Attributes namespace.

Nesting

Similar to annotations attributes can be top level or nested. However, attributes may be put at the same level if there is no ambiguity. swagger-php will then merge attributes according to the defined rules about parent/child relationships.

Example

Nested:

    #[OA\Get(
+        path: '/api/users',
+        responses: [
+            new OA\Response(response: 200, description: 'AOK'),
+            new OA\Response(response: 401, description: 'Not allowed'),
+        ]
+    )]
+    public function users() { /* ... */ }
+

Not nested:

    #[OA\Get(path: '/api/users')]
+    #[OA\Response(response: 200, description: 'AOK')]
+    #[OA\Response(response: 401, description: 'Not allowed')]
+    public function users() { /* ... */ }
+

Depending on how much nesting there is this can make things a bit simpler and easier to read.

Top level only

Automatic merging of attributes works only at the top level - in the example that would be the method users().

+ + + + + \ No newline at end of file diff --git a/guide/common-techniques.html b/guide/common-techniques.html new file mode 100644 index 00000000..4119ecd4 --- /dev/null +++ b/guide/common-techniques.html @@ -0,0 +1,236 @@ + + + + + + Common techniques | Swagger-PHP + + + + + + + + + +

Common techniques

Annotation placement

You shouldn't place all annotations inside one big block, but scatter them throughout your codebase as close to the relevant source code as appropriate.

swagger-php will scan your project and merge all meta-data into one @OA\OpenApi annotation.

WARNING

As of swagger-php v4 all annotations or attributes must be associated with a structural element (class, method, parameter or enum)

Context awareness

swagger-php looks at the context of the annotation and will augment it with things like property name, data type (doctype and native type hints) as well as a couple other things.

This means in a lot of cases it is not necessary to explicitly document all details.

Example

<?php
+
+/**
+ * @OA\Schema()
+ */
+class Product {
+
+    /**
+     * The product name,
+     * @var string
+     * @OA\Property()
+     */
+    public $name;
+}
+

Results in

openapi: 3.0.0
+components:
+  schemas:
+    Product:
+      properties:
+        name:
+          description: "The product name"
+          type: string
+      type: object
+

As if you'd written

    /**
+     * The product name
+     * @var string
+     *
+     * @OA\Property(
+     *   property="name",
+     *   type="string",
+     *   description="The product name"
+     * )
+     */
+    public $name;
+

Response media type

The @OA\MediaType is used to describe the content:

/**
+ * @OA\Response(
+ *     response=200,
+ *     description="successful operation",
+ *     @OA\MediaType(
+ *         mediaType="application/json",
+ *         @OA\Schema(ref="#/components/schemas/User"),
+ *     )
+ * ),
+ */
+

But because most API requests and responses are JSON, the @OA\JsonContent allows you to simplify this by writing:

/**
+ * @OA\Response(
+ *     response=200,
+ *     description="successful operation",
+ *     @OA\JsonContent(ref="#/components/schemas/User"),
+ * )
+ */
+

During processing the @OA\JsonContent unfolds to @OA\MediaType( mediaType="application/json", @OA\Schema(...) and will generate the same output.

Using references - $ref

It's quite common that endpoints have some overlap in either their request or response data. To keep things DRY (Don't Repeat Yourself) the specification allows reusing components using $ref's

/**
+ * @OA\Schema(
+ *   schema="product_id",
+ *   type="integer",
+ *   format="int64",
+ *   description="The unique identifier of a product in our catalog"
+ * )
+ */
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    product_id:
+      description: "The unique identifier of a product in our catalog"
+      type: integer
+      format: int64
+

This doesn't do anything by itself, but now you can reference this fragment by its path in the document tree #/components/schemas/product_id

    /**
+     * @OA\Property(ref="#/components/schemas/product_id")
+     */
+    public $id;
+

Examples

There are more uses cases on how to use refs in the using-refs example.

Array parameters in query

Depending on style-values @OA\Parameter(in="query", name="param", ...) might create urls like this: path?param=123&param=abc which do not work when reading the param values in PHP.

The solution is to change the name param into param[] which will create path?param[]=123&param[]=abc and results in a PHP array.

Vendor extensions

The specification allows for custom properties as long as they start with "x-". Therefore, all swagger-php annotations have an x property which accepts an array (map) and will unfold into "x-" properties.

/**
+ * @OA\Info(
+ *   title="Example",
+ *   version="1.0.0",
+ *   x={
+ *     "some-name": "a-value",
+ *     "another": 2,
+ *     "complex-type": {
+ *       "supported":{
+ *         {"version": "1.0", "level": "baseapi"},
+ *         {"version": "2.1", "level": "fullapi"},
+ *       }
+ *     }
+ *   }
+ * )
+ */
+

Results in:

openapi: 3.0.0
+info:
+  title: Example
+  version: 1
+  x-some-name: a-value
+  x-another: 2
+  x-complex-type:
+    supported:
+      - version: "1.0"
+        level: baseapi
+      - version: "2.1"
+        level: fullapi
+

Enums

PHP 8.1 enums are supported in two main use cases.

Enum cases as value

Enum cases can be used as value in an enum list just like a string, integer or any other primitive type.

Basic enum:

use OpenApi\Attributes as OAT;
+
+enum Suit
+{
+    case Hearts;
+    case Diamonds;
+    case Clubs;
+    case Spades;
+}
+
+class Model
+{
+    #[OAT\Property(enum: [Suit::Hearts, Suit::Diamonds])]
+    protected array $someSuits;
+}
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    Model:
+      properties:
+        someSuits:
+          type: array
+          enum:
+            - Hearts
+            - Diamonds
+      type: object
+
+

Backed enums

If the enum is a backed enum, the case backing value is used instead of the name.

Enum schemas

The simples way of using enums is to annotate them as Schema. This allows you to reference them like any other schema in your spec.

use OpenApi\Attributes as OAT;
+
+#[OAT\Schema()]
+enum Colour
+{
+    case GREEN;
+    case BLUE;
+    case RED;
+}
+
+#[OAT\Schema()]
+class Product
+{
+    #[OAT\Property()]
+    public Colour $colour;
+}
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    Colour:
+      type: string
+      enum:
+        - GREEN
+        - BLUE
+        - RED
+    Product:
+      properties:
+        colour:
+          $ref: '#/components/schemas/Colour'
+      type: object
+

Backed enums

For backed enums there exist two rules that determine whether the name or backing value is used:

  1. If no schema type is given, the enum name is used.
  2. If a schema type is given, and it matches the backing type, the enum backing value is used.

Using the name of a backed enum:

use OpenApi\Attributes as OAT;
+
+#[OAT\Schema()]
+enum Colour: int
+{
+    case GREEN = 1;
+    case BLUE = 2;
+    case RED = 3;
+}
+
+#[OAT\Schema()]
+class Product
+{
+    #[OAT\Property()]
+    public Colour $colour;
+}
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    Colour:
+      type: string
+      enum:
+        - GREEN
+        - BLUE
+        - RED
+    Product:
+      properties:
+        colour:
+          $ref: '#/components/schemas/Colour'
+      type: object
+

Using the backing value:

use OpenApi\Attributes as OAT;
+
+#[OAT\Schema(type: 'integer')]
+enum Colour: int
+{
+    case GREEN = 1;
+    case BLUE = 2;
+    case RED = 3;
+}
+
+#[OAT\Schema()]
+class Product
+{
+    #[OAT\Property()]
+    public Colour $colour;
+}
+

Results in:

openapi: 3.0.0
+components:
+  schemas:
+    Colour:
+      type: integer
+      enum:
+        - 1
+        - 2
+        - 3
+    Product:
+      properties:
+        colour:
+          $ref: '#/components/schemas/Colour'
+      type: object
+
+ + + + + \ No newline at end of file diff --git a/guide/cookbook.html b/guide/cookbook.html new file mode 100644 index 00000000..c2e9389e --- /dev/null +++ b/guide/cookbook.html @@ -0,0 +1,516 @@ + + + + + + Cookbook | Swagger-PHP + + + + + + + + + +

Cookbook

x-tagGroups

OpenApi has the concept of grouping endpoints using tags. On top of that, some tools (redocly, for example) support further grouping via the vendor extension x-tagGroups.

/**
+ * @OA\OpenApi(
+ *   x={
+ *       "tagGroups"=
+ *           {{"name"="User Management", "tags"={"Users", "API keys", "Admin"}}
+ *       }
+ *   }
+ * )
+ */
+

Adding examples to @OA\Response

/*
+ * @OA\Response(
+ *     response=200,
+ *     description="OK",
+ *     @OA\JsonContent(
+ *         oneOf={
+ *             @OA\Schema(ref="#/components/schemas/Result"),
+ *             @OA\Schema(type="boolean")
+ *         },
+ *         @OA\Examples(example="result", value={"success": true}, summary="An result object."),
+ *         @OA\Examples(example="bool", value=false, summary="A boolean value."),
+ *     )
+ * )
+ */
+

External documentation

OpenApi allows a single reference to external documentation. This is a part of the top level @OA\OpenApi.

/**
+ * @OA\OpenApi(
+ *   @OA\ExternalDocumentation(
+ *     description="More documentation here...",
+ *     url="https://example.com/externaldoc1/"
+ *   )
+ * )
+ */
+

TIP

If no @OA\OpenApi is configured, swagger-php will create one automatically.

That means the above example would also work with just the OA\ExternalDocumentation annotation.

/**
+ * @OA\ExternalDocumentation(
+ *   description="More documentation here...",
+ *   url="https://example.com/externaldoc1/"
+ * )
+ */
+

Properties with union types

Sometimes properties or even lists (arrays) may contain data of different types. This can be expressed using oneOf.

/**
+ * @OA\Schema(
+ *      schema="StringList",
+ *      @OA\Property(property="value", type="array", @OA\Items(anyOf={@OA\Schema(type="string")}))
+ * )
+ * @OA\Schema(
+ *      schema="String",
+ *      @OA\Property(property="value", type="string")
+ * )
+ * @OA\Schema(
+ *      schema="Object",
+ *      @OA\Property(property="value", type="object")
+ * )
+ * @OA\Schema(
+ *     schema="mixedList",
+ *     @OA\Property(property="fields", type="array", @OA\Items(oneOf={
+ *         @OA\Schema(ref="#/components/schemas/StringList"),
+ *         @OA\Schema(ref="#/components/schemas/String"),
+ *         @OA\Schema(ref="#/components/schemas/Object")
+ *     }))
+ * )
+ */
+

This will resolve into this YAML

openapi: 3.0.0
+components:
+  schemas:
+    StringList:
+      properties:
+        value:
+          type: array
+          items:
+            anyOf:
+              -
+                type: string
+      type: object
+    String:
+      properties:
+        value:
+          type: string
+      type: object
+    Object:
+      properties:
+        value:
+          type: object
+      type: object
+    mixedList:
+      properties:
+        fields:
+          type: array
+          items:
+            oneOf:
+              -
+                $ref: '#/components/schemas/StringList'
+              -
+                $ref: '#/components/schemas/String'
+              -
+                $ref: '#/components/schemas/Object'
+      type: object
+

Referencing a security scheme

An API might have zero or more security schemes. These are defined at the top level and vary from simple to complex:

/**
+ * @OA\SecurityScheme(
+ *     type="apiKey",
+ *     name="api_key",
+ *     in="header",
+ *     securityScheme="api_key"
+ * )
+ *
+ * @OA\SecurityScheme(
+ *   type="oauth2",
+ *   securityScheme="petstore_auth",
+ *   @OA\Flow(
+ *      authorizationUrl="http://petstore.swagger.io/oauth/dialog",
+ *      flow="implicit",
+ *      scopes={
+ *         "read:pets": "read your pets",
+ *         "write:pets": "modify pets in your account"
+ *      }
+ *   )
+ * )
+ */
+

To declare an endpoint as secure and define what security schemes are available to authenticate a client it needs to be added to the operation, for example:

/**
+ * @OA\Get(
+ *      path="/api/secure/",
+ *      summary="Requires authentication"
+ *    ),
+ *    security={ {"api_key": {}} }
+ * )
+ */
+

Endpoints can support multiple security schemes and have custom options too:

/**
+ * @OA\Get(
+ *      path="/api/secure/",
+ *      summary="Requires authentication"
+ *    ),
+ *    security={
+ *      { "api_key": {} },
+ *      { "petstore_auth": {"write:pets", "read:pets"} }
+ *    }
+ * )
+ */
+

File upload with headers

/**
+ * @OA\Post(
+ *   path="/v1/media/upload",
+ *   summary="Upload document",
+ *   description="",
+ *   tags={"Media"},
+ *   @OA\RequestBody(
+ *     required=true,
+ *     @OA\MediaType(
+ *       mediaType="application/octet-stream",
+ *       @OA\Schema(
+ *         required={"content"},
+ *         @OA\Property(
+ *           description="Binary content of file",
+ *           property="content",
+ *           type="string",
+ *           format="binary"
+ *         )
+ *       )
+ *     )
+ *   ),
+ *   @OA\Response(
+ *     response=200, description="Success",
+ *     @OA\Schema(type="string")
+ *   ),
+ *   @OA\Response(
+ *     response=400, description="Bad Request"
+ *   )
+ * )
+ */
+

Set the XML root name

The OA\Xml annotation may be used to set the XML root element for a given @OA\XmlContent response body

/**
+ * @OA\Schema(
+ *     schema="Error",
+ *     @OA\Property(property="message"),
+ *     @OA\Xml(name="details")
+ * )
+ */
+
+/**
+ * @OA\Post(
+ *     path="/foobar",
+ *     @OA\Response(
+ *         response=400,
+ *         description="Request error",
+ *         @OA\XmlContent(ref="#/components/schemas/Error",
+ *           @OA\Xml(name="error")
+ *        )
+ *     )
+ * )
+ */
+

upload multipart/form-data

Form posts are @OA\Post requests with a multipart/form-data @OA\RequestBody. The relevant bit looks something like this

/**
+ * @OA\Post(
+ *   path="/v1/user/update",
+ *   summary="Form post",
+ *   @OA\RequestBody(
+ *     @OA\MediaType(
+ *       mediaType="multipart/form-data",
+ *       @OA\Schema(
+ *         @OA\Property(property="name"),
+ *         @OA\Property(
+ *           description="file to upload",
+ *           property="avatar",
+ *           type="string",
+ *           format="binary",
+ *         ),
+ *       )
+ *     )
+ *   ),
+ *   @OA\Response(response=200, description="Success")
+ * )
+ */
+

Default security scheme for all endpoints

Unless specified each endpoint needs to declare what security schemes it supports. However, there is a way to also configure security schemes globally for the whole API.

This is done on the @OA\OpenApi annotation:

Nested objects

Complex, nested data structures are defined by nesting @OA\Property annotations inside others (with type="object").

/**
+ *  @OA\Schema(
+ *    schema="Profile",
+ *    type="object",
+*
+ *    @OA\Property(
+ *      property="Status",
+ *      type="string",
+ *      example="0"
+ *    ),
+ *
+ *    @OA\Property(
+ *      property="Group",
+ *      type="object",
+ *
+ *      @OA\Property(
+ *        property="ID",
+ *        description="ID de grupo",
+ *        type="number",
+ *        example=-1
+ *      ),
+ *
+ *      @OA\Property(
+ *        property="Name",
+ *        description="Nombre de grupo",
+ *        type="string",
+ *        example="Superadmin"
+ *      )
+ *    )
+ *  )
+ */
+
+

Documenting union type response data using oneOf

A response with either a single or a list of QualificationHolder's.

/**
+ * @OA\Response(
+ *     response=200,
+ *     @OA\JsonContent(
+ *         oneOf={
+ *             @OA\Schema(ref="#/components/schemas/QualificationHolder"),
+ *             @OA\Schema(
+ *                 type="array",
+ *                 @OA\Items(ref="#/components/schemas/QualificationHolder")
+ *             )
+ *         }
+ *     )
+ * )
+ */
+

Reusing responses

Global responses are found under /components/responses and can be referenced/shared just like schema definitions (models)

/**
+ * @OA\Response(
+ *   response="product",
+ *   description="All information about a product",
+ *   @OA\JsonContent(ref="#/components/schemas/Product")
+ * )
+ */
+class ProductResponse {}
+
+ // ...
+
+class ProductController
+{
+    /**
+     * @OA\Get(
+     *   tags={"Products"},
+     *   path="/products/{product_id}",
+     *   @OA\Response(
+     *       response="default",
+     *       ref="#/components/responses/product"
+     *   )
+     * )
+     */
+    public function getProduct($id)
+    {
+    }
+}
+

`response` parameter is always required

Even if referencing a shared response definition, the response parameter is still required.

mediaType="/"

Using */* as mediaType is not possible using annotations.

Example:

/**
+ * @OA\MediaType(
+ *     mediaType="*/*",
+ *     @OA\Schema(type="string",format="binary")
+ * )
+ */
+

The doctrine annotations library used for parsing annotations does not handle this and will interpret the */ bit as the end of the comment.

Using just * or application/octet-stream might be usable workarounds.

Warning about Multiple response with same response="200"

There are two scenarios where this can happen

  1. A single endpoint contains two responses with the same response value.
  2. There are multiple global response declared, again more than one with the same response value.

Callbacks

The API does include basic support for callbacks. However, this needs to be set up mostly manually.

Example

/**
+ *     ...
+ *
+ *     callbacks={
+ *         "onChange"={
+ *              "{$request.query.callbackUrl}"={
+ *                  "post": {
+ *                      "requestBody": @OA\RequestBody(
+ *                          description="subscription payload",
+ *                          @OA\MediaType(mediaType="application/json", @OA\Schema(
+ *                              @OA\Property(property="timestamp", type="string", format="date-time", description="time of change")
+ *                          ))
+ *                      )
+ *                  },
+ *                  "responses": {
+ *                      "202": {
+ *                          "description": "Your server implementation should return this HTTP status code if the data was received successfully"
+ *                      }
+ *                  }
+ *              }
+ *         }
+ *     }
+ *
+ *     ...
+ *
+ */
+

(Mostly) virtual models

Typically, a model is annotated by adding a @OA\Schema annotation to the class and then individual @OA\Property annotations to the individually declared class properties.

It is possible, however, to nest O@\Property annotations inside a schema even without properties. In fact, all that is needed is a code anchor - e.g. an empty class.

use OpenApi\Attributes as OA;
+
+#[OA\Schema(
+    properties: [
+        'name' => new OA\Property(property: 'name', type: 'string'),
+        'email' => new OA\Property(property: 'email', type: 'string'),
+    ]
+)]
+class User {}
+

Using class name as type instead of references

Typically, when referencing schemas this is done using $ref's

#[OAT\Schema(schema: 'user')]
+class User
+{
+}
+
+#[OAT\Schema()]
+class Book
+{
+    /**
+     * @var User
+     */
+    #[OAT\Property(ref: '#/components/schemas/user')]
+    public $author;
+}
+

This works, but is not very convenient.

First, when using custom schema names (schema: 'user'), this needs to be taken into account everywhere. Secondly, having to write ref: '#/components/schemas/user' is tedious and error-prone.

Using attributes all this changes as we can take advantage of PHP itself by referring to a schema by its (fully qualified) class name.

With the same User schema as before, the Book::author property could be written in a few different ways

    #[OAT\Property()]
+    public User author;
+

or

    /**
+     * @var User
+     */
+    #[OAT\Property()]
+    public author;
+

or

    #[OAT\Property(type: User::class)]
+    public author;
+

Enums

As of PHP 8.1 there is native support for enum's.

swagger-php supports enums in much the same way as class names can be used to reference schemas.

Example

#[Schema()]
+enum State
+{
+    case OPEN;
+    case MERGED;
+    case DECLINED;
+}
+
+#[Schema()]
+class PullRequest
+   #[OAT\Property()]
+   public State $state
+}
+

However, in this case the schema generated for State will be an enum:

components:
+  schemas:
+    PullRequest:
+      properties:
+        state:
+          $ref: '#/components/schemas/State'
+      type: object
+    State:
+      type: string
+      enum:
+        - OPEN
+        - MERGED
+        - DECLINED
+

Multi value query parameter: &q[]=1&q[]=1

PHP allows to have query parameters multiple times in the url and will combine the values to an array if the parameter name uses trailing []. In fact, it is possible to create nested arrays too by using more than one pair of [].

In terms of OpenAPI, the parameters can be considered a single parameter with a list of values.

/**
+ * @OA\Get(
+ *     path="/api/endpoint",
+ *     description="The endpoint",
+ *     operationId="endpoint",
+ *     tags={"endpoints"},
+ *     @OA\Parameter(
+ *         name="things[]",
+ *         in="query",
+ *         description="A list of things.",
+ *         required=false,
+ *         @OA\Schema(
+ *             type="array",
+ *             @OA\Items(type="integer")
+ *         )
+ *     ),
+ *     @OA\Response(response="200", description="All good")
+ * )
+ */
+

The corresponding bit of the spec will look like this:

      parameters:
+        -
+          name: 'things[]'
+          in: query
+          description: 'A list of things.'
+          required: false
+          schema:
+            type: array
+            items:
+              type: integer
+

swagger-ui will show a form that allows to add/remove items (integer values in this case) to/from a list and post those values as something like ?things[]=1&things[]=2&things[]=0

Custom response classes

Even with using refs there is a bit of overhead in sharing responses. One way around that is to write your own response classes. The beauty is that in your custom __construct() method you can prefill as much as you need.

Best of all, this works for both annotations and attributes.

Example:

use OpenApi\Attributes as OA;
+
+/**
+ * @Annotation
+ */
+#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
+class BadRequest extends OA\Response
+{
+    public function __construct()
+    {
+        parent::__construct(response: 400, description: 'Bad request');
+    }
+}
+
+class Controller
+{
+
+    #[OA\Get(path: '/foo', responses: [new BadRequest()])]
+    public function get()
+    {
+    }
+
+    #[OA\Post(path: '/foo')]
+    #[BadRequest]
+    public function post()
+    {
+    }
+
+    /**
+     * @OA\Delete(
+     *     path="/foo",
+     *     @BadRequest()
+     * )
+     */
+    public function delete()
+    {
+    }
+}
+

Annotations only?

If you are only interested in annotations you canleave out the attribute setup line (#[\Attribute...) for BadRequest.

Furthermore, your custom annotations should extend from the OpenApi\Annotations namespace.

Annotating class constants

use OpenApi\Attributes as OA;
+
+#[OA\Schema()]
+class Airport
+{
+    #[OA\Property(property='kind')]
+    public const KIND = 'Airport';
+}
+

The const property is supported in OpenApi 3.1.0.

components:
+  schemas:
+    Airport:
+        properties:
+          kind:
+            type: string
+            const: Airport
+

For 3.0.0 this is serialized into a single value enum.

components:
+  schemas:
+    Airport:
+        properties:
+          kind:
+            type: string
+            enum:
+              - Airport
+
+ + + + + \ No newline at end of file diff --git a/guide/faq.html b/guide/faq.html new file mode 100644 index 00000000..38a843c3 --- /dev/null +++ b/guide/faq.html @@ -0,0 +1,108 @@ + + + + + + FAQ | Swagger-PHP + + + + + + + + + +

FAQ

Warning: Required @OA\Info() not found

With adding support for PHP attributes in version 4, some architectural changes had to be made.

One of those changes is that placing annotations in your source files is now subject to the same limitations as attributes. These limits are dictated by the PHP reflection API, specifically where it provides access to attributes and doc comments.

This means stand-alone annotations are no longer supported and ignored as swagger-php cannot "see" them any more.

Supported locations:

  • class
  • interface
  • trait
  • method
  • property
  • class/interface const

Most commonly this manifests with a warning about the required @OA\Info not being found. While most annotations have specific related code, the info annotation (and a few more) is kind of global.

The simplest solution to avoid this issue is to add a 'dummy' class to the docblock and add all 'global' annotations (e.g. Tag, Server, SecurityScheme, etc.) in a single docblock to that class.

/**
+ * @OA\Tag(
+ *     name="user",
+ *     description="User related operations"
+ * )
+ * @OA\Info(
+ *     version="1.0",
+ *     title="Example API",
+ *     description="Example info",
+ *     @OA\Contact(name="Swagger API Team")
+ * )
+ * @OA\Server(
+ *     url="https://example.localhost",
+ *     description="API server"
+ * )
+ */
+class OpenApiSpec
+{
+}
+

As of version 4.8 the doctrine/annotations library is optional and might cause the same message.

If this is the case, doctrine annotations must be installed separately:

composer require doctrine/annotations
+

Annotations missing

Another side effect of using reflection is that swagger-php "can't see" multiple consecutive docblocks any more as the PHP reflection API only provides access to the docblock closest to a given structural element.

class Controller
+{
+    /**
+     * @OA\Delete(
+     *      path="/api/v0.0.2/notifications/{id}",
+     *      operationId="deleteNotificationById",
+     *      summary="Delete notification by ID",
+     *      @OA\Parameter(name="id", in="path", @OA\Schema(type="integer")),
+     *      @OA\Response(response=200, description="OK"),
+     *      @OA\Response(response=400, description="Bad Request")
+     * )
+     */
+    /**
+     * Delete notification by ID.
+     *
+     * @param Request $request
+     * @param AppNotification $notification
+     *
+     * @return Response
+     * @throws Exception
+     */
+    public function destroy(Request $request, AppNotification $notification) {
+        //
+    }
+}
+

In this case the simplest solution is to merge both docblocks. As an additional benefit the duplication of the summary can be avoided.

In this improved version swagger-php will automatically use the docblock summary just as explicitly done above.

class Controller
+{
+    /**
+     * Delete notification by ID.
+     *
+     * @OA\Delete(
+     *      path="/api/v0.0.2/notifications/{id}",
+     *      operationId="deleteNotificationById",
+     *      @OA\Parameter(name="id", in="path", @OA\Schema(type="integer")),
+     *      @OA\Response(response=200, description="OK"),
+     *      @OA\Response(response=400, description="Bad Request")
+     * )
+     *
+     * @param Request $request
+     * @param AppNotification $notification
+     *
+     * @return Response
+     * @throws Exception
+     */
+    public function destroy(Request $request, AppNotification $notification) {
+        //
+    }
+}
+

Resulting spec:

openapi: 3.0.0
+paths:
+  '/api/v0.0.2/notifications/{id}':
+    delete:
+      summary: 'XDelete notification by ID.'
+      operationId: deleteNotificationById
+      parameters:
+        -
+          name: id
+          in: path
+          schema:
+            type: integer
+      responses:
+        '200':
+          description: OK
+        '400':
+          description: 'Bad Request'
+
+

Skipping unknown \SomeClass

This message means that swagger-php has tried to use reflection to inspect \SomeClass and that PHP could not find/load that class. Effectively, this means that class_exists("\SomeClass") returns false.

Using the -b --bootstrap option

There are a number of reasons why this could happen. If you are using the openapi command line tool from a global installation typically the application classloader (composer) is not active. With you application root being myapp you could try:

openapi -b myapp/vendor/autoload.php myapp/src
+

The -b allows to execute some extra PHP code to load whatever is needed to register your apps classloader with PHP.

Namespace mismatch

Another reason for this error could be that your class actually has the wrong namespace (or no namespace at all!).

Depending on your framework this might still work in the context of your app, but the composer autoloader alone might not be able to load your class (assuming you are using composer).

No output from openapi command line tool

Depending on your PHP configuration, running the openapi command line tool might result in no output at all.

The reason for this is that openapi currently uses the error_log function for all output.

So if this is configured to write to a file, then it will seem like the command is broken.

+ + + + + \ No newline at end of file diff --git a/guide/generating-openapi-documents.html b/guide/generating-openapi-documents.html new file mode 100644 index 00000000..51f292d8 --- /dev/null +++ b/guide/generating-openapi-documents.html @@ -0,0 +1,50 @@ + + + + + + Generating OpenAPI documents | Swagger-PHP + + + + + + + + + +

Generating OpenAPI documents

./bin/openapi

swagger-php includes a command line tool ./bin/openapi. This can be used to generate OpenAPI documents.

> ./vendor/bin/openapi app -o openapi.yaml
+

Output Format

By default the output format is YAML. If a filename is given (via --output or -o) the tool will use the file extension to determine the format.

The --format option can be used to force a specific format.

For a list of all available options use the -h option

> ./bin/openapi -h
+
+Usage: openapi [--option value] [/path/to/project ...]
+
+Options:
+  --config (-c)     Generator config
+                    ex: -c operationId.hash=false
+  --legacy (-l)     Use legacy TokenAnalyser; default is the new ReflectionAnalyser
+  --output (-o)     Path to store the generated documentation.
+                    ex: --output openapi.yaml
+  --exclude (-e)    Exclude path(s).
+                    ex: --exclude vendor,library/Zend
+  --pattern (-n)    Pattern of files to scan.
+                    ex: --pattern "*.php" or --pattern "/\.(phps|php)$/"
+  --bootstrap (-b)  Bootstrap a php file for defining constants, etc.
+                    ex: --bootstrap config/constants.php
+  --processor (-p)  Register an additional processor.
+  --format (-f)     Force yaml or json.
+  --debug (-d)      Show additional error information.
+  --version         The OpenAPI version; defaults to 3.0.0.
+  --help (-h)       Display this help message.
+

Using PHP

Depending on your use case PHP code can also be used to generate OpenAPI documents in a more dynamic way.

In its simplest form this may look something like

<?php
+require("vendor/autoload.php");
+
+$openapi = \OpenApi\Generator::scan(['/path/to/project']);
+
+header('Content-Type: application/x-yaml');
+echo $openapi->toYaml();
+

Programming API

Details about the swagger-php API can be found in the reference.

+ + + + + \ No newline at end of file diff --git a/guide/index.html b/guide/index.html new file mode 100644 index 00000000..50f97e78 --- /dev/null +++ b/guide/index.html @@ -0,0 +1,21 @@ + + + + + + What is Swagger-PHP? | Swagger-PHP + + + + + + + + + +

What is Swagger-PHP?

swagger-php is a library that extracts API metadata from your PHP source code files.

The idea is to add swagger-php annotations or attributes next to the relevant PHP code in your application. These will contain the details about your API and swagger-php will convert those into machine-readable OpenAPI documentation.

By adding your API documentation next to the corresponding source code (same file!) makes it easy to keep it up-to-date as all details can be modified in one place.

Annotating vs. Annotations

When talking about annotating your code we mean the act of adding meta-data to your codebase. This can be done by either adding Annotations or Attributes.

Requirements

Using swagger-php requires a minimum of PHP 7.2 for using annotations and at least PHP 8.1 to use attributes.

+ + + + + \ No newline at end of file diff --git a/guide/installation.html b/guide/installation.html new file mode 100644 index 00000000..c66ef2d6 --- /dev/null +++ b/guide/installation.html @@ -0,0 +1,23 @@ + + + + + + Installation | Swagger-PHP + + + + + + + + + +

Installation

Per project

We recommend adding swagger-php to your project using Composer

> composer require zircote/swagger-php
+

Globally

Alternatively, use the composer global argument to install swagger-php globally.

> composer global require zircote/swagger-php
+

PATH variables

Remember to add the ~/.composer/vendor/bin directory to the PATH in your environment.

+ + + + + \ No newline at end of file diff --git a/guide/migrating-to-v3.html b/guide/migrating-to-v3.html new file mode 100644 index 00000000..e39583fa --- /dev/null +++ b/guide/migrating-to-v3.html @@ -0,0 +1,21 @@ + + + + + + Migrating to v3 | Swagger-PHP + + + + + + + + + +

Migrating to v3

Swagger-PHP 3.x generates an openapi.json file that follows the OpenAPI Version 3.0.x Specification.

If you need to output the older 2.x specification use OpenApi-php 2.x

The default output changed from json to yaml

This aligns better with the direction of the swagger documentation and examples. Annotations can't be used as string anymore, you'll need to call toYaml() or toJson() if you prefer the json format.

Updated CLI

  • Added colors
  • No output for successful execution (Removed summary)
  • non-zero exit when an error occurred.
  • Defaults to yaml
  • Defaults to stdout. To save to openapi.yaml use -o or >

Changed annotations

SWG is renamed to OA

The namespace is renamed from SWG (Swagger) to OA (OpenApi)

@SWG\Swagger() is renamed to @OA\OpenApi()

@SWG\Path() is renamed to @OA\PathItem()

The specification uses the term "Path Item Object", updated the annotation to reflect that.

@SWG\Definition() is removed

Use @OA\Schema() instead of @OA\Definition() and update the references from "#/definitions/something" to "#/components/schemas/something".

@SWG\Path is removed

Use @OA\PathItem instead of @SWG\Path and update references.

Consumes, produces field is removed from OpenAPI specification

Use @OA\MediaType to set data format.

Rename parameter references

Rename #/parameters/{parameter_name} to #/components/parameters/{parameter_name}

Rename response references

Rename #/responses/{response} to #/components/responses/{response}

Renamed cli

Renamed swagger to openapi

More details about differences:

A Visual Guide to What's New in Swagger 3.0

+ + + + + \ No newline at end of file diff --git a/guide/migrating-to-v4.html b/guide/migrating-to-v4.html new file mode 100644 index 00000000..d50a0e89 --- /dev/null +++ b/guide/migrating-to-v4.html @@ -0,0 +1,68 @@ + + + + + + Migrating to v4 | Swagger-PHP + + + + + + + + + +

Migrating to v4

Overview

  • As of PHP 8.1 annotations may be used as PHP attributes instead. That means all references to annotations in this document also apply to attributes.
  • If you haven't switched to attributes yet, the Doctrine annotations library must be installed manually: composer require doctrine/annotations
  • Annotations now must be associated with a structural element (class, trait, interface), a method, property or const.
  • A new annotation PathParameter was added for improved framework support.
  • A new annotation Attachable was added to simplify custom processing. Attachable can be used to attach arbitrary data to any given annotation.
  • Deprecated elements have been removed
    • \Openapi\Analysis::processors()
    • \Openapi\Analyser::$whitelist
    • \Openapi\Analyser::$defaultImports
    • \Openapi\Logger
  • Legacy support is available via the previous TokenAnalyser
  • Improvements to the Generator class

Annotations as PHP attributes

While PHP attributes have been around since PHP 8.0 they were lacking the ability to be nested. This changes with PHP 8.1 which allows to use new in initializers.

Swagger-php attributes also make use of named arguments, so attribute parameters can be (mostly) typed. There are some limitations to type hints which can only be resolved once support for PHP 7.x is dropped.

Using annotations


+use OpenApi\Annotations as OA;
+
+/**
+ * @OA\Info(
+ *   version="1.0.0",
+ *   title="My API",
+ *   @OA\License(name="MIT"),
+ *   @OA\Attachable()
+ * )
+ */
+class OpenApiSpec
+{
+}
+

Using attributes


+use OpenApi\Attributes as OA;
+
+#[OA\Info(
+    version: '1.0.0',
+    title: 'My API',
+    attachables: [new OA\Attachable()]
+)]
+#[OA\License(name: 'MIT')]
+class OpenApiSpec
+{
+}
+

Optional nesting

One of the few differences between annotations and attributes visible in the above example is that the OA\License attribute is not nested within OA\Info. Nesting of attributes is possible and required in certain cases however, in cases where there is no ambiguity attributes may be all written on the top level and swagger-php will do the rest.

Annotations must be associated with a structural element

The (now legacy) way of parsing PHP files meant that docblocks could live in a file without a single line of actual PHP code.

PHP Attributes cannot exist in isolation; they need code to be associated with and then are available via reflection on the associated structural element. In order to allow to keep supporting annotations and the code simple it made sense to treat annotations and attributes the same in this respect.

The PathParameter annotation

As annotation this is just a short form for

   @OA\Parameter(in='body')
+

Things get more interesting when it comes to using it as attribute, though. In the context of a controller you can now do something like

class MyController
+{
+    #[OA\Get(path: '/products/{product_id}')]
+    public function getProduct(
+        #[OA\PathParameter] string $product_id)
+    {
+    }
+}
+

Here it avoids having to duplicate details about the $product_id parameter and the simple use of the attribute will pick up typehints automatically.

The Attachable annotation

Technically these were added in version 3.3.0, however they become really useful only with version 4.

The attachable annotation is similar to the OpenApi vendor extension x=. The main difference are that

  1. Attachables allow complex structures and strong typing
  2. Attachables are not added to the generated spec.

Their main purpose is to make customizing swagger-php easier by allowing to add arbitrary data to any annotation.

One possible use case could be custom annotations. Classes extending Attachable are allowed to limit the allowed parent annotations. This means it would be easy to create a new attribute to flag certain endpoints as private and exclude them under certain conditions from the spec (via a custom processor).

Removed deprecated elements

\Openapi\Analysis::processors()

Processors have been moved into the Generator class incl. some new convenience methods.

\Openapi\Analyser::$whitelist

This has been replaced with the Generator namespaces property.

\Openapi\Analyser::$defaultImports

This has been replaced with the Generator aliases property.

\Openapi\Logger

This class has been removed completely. Instead, you may configure a PSR-3 logger.

Improvements to the Generator class

The removal of deprecated static config options means that the Generator class now is the main entry point into swagger-php when used programmatically.

To make the migration as simple as possible a new Generator::withContext(callable) has been added. This allows to use parts of the library (an Analyser instance, for example) within the context of a Generator instance.

Example:

$analyser = createMyAnalyser();
+
+$analysis = (new Generator())
+    ->addAlias('fo', 'My\\Attribute\\Namespace')
+    ->addNamespace('Other\\Annotations\\')
+    ->withContext(function (Generator $generator, Analysis $analysis, Context $context) use ($analyser) {
+        $analyser->setGenerator($generator);
+        $analysis = $analyser->fromFile('my_code.php', $context);
+        $analysis->process($generator->getProcessors());
+
+        return $analysis;
+    });
+
+ + + + + \ No newline at end of file diff --git a/guide/required-elements.html b/guide/required-elements.html new file mode 100644 index 00000000..dbf57d9a --- /dev/null +++ b/guide/required-elements.html @@ -0,0 +1,82 @@ + + + + + + Required elements | Swagger-PHP + + + + + + + + + +

Required elements

The OpenAPI specification defines a minimum set of information for a valid document.

For the most part that consists of some general information about the API like name, version and at least one endpoint.

The endpoint, in turn, needs to have a path and at least one response.

Minimum required annotations

With the above in mind a minimal API with a single endpoint could look like this:

with the resulting OpenAPI document like this

openapi: 3.0.0
+info:
+  title: 'My First API'
+  version: '0.1'
+paths:
+  /api/data.json:
+    get:
+      operationId: 236f26ae21b015a60adbce41f8f316e3
+      responses:
+        '200':
+          description: 'The data'
+

Code locations

Attributes and annotations can be added anywhere on declarations in code as defined by the PHP docs. These are limited to the extent of what the PHP Reflection APIs supports.

Optional elements

Looking at the generated document you will notice that there are some elements that swagger-php adds automatically when they are missing.

For the most part those are @OA\OpenApi, @OA\Components and @OA\PathItem.

+ + + + + \ No newline at end of file diff --git a/guide/under-the-hood.html b/guide/under-the-hood.html new file mode 100644 index 00000000..c0ecf58f --- /dev/null +++ b/guide/under-the-hood.html @@ -0,0 +1,23 @@ + + + + + + Under the hood | Swagger-PHP + + + + + + + + + +

Under the hood

Processing flow

  • The Generator iterates over the given sources (Symfony Finder, file/directory list, etc)
  • The configured analyser (AnalyserInterface) reads the files and builds an Analysis object. Default (as of v4) is the ReflectionAnalyser. Alternatively, there is the TokenAnalyser which was the default in v3.
  • The Analysis object and its annotations are then processed by the configured processors.
  • If enabled, the analysis/annotations are validated.
  • The root OpenApi annotation then contains all annotations and is serialized into YAML/JSON.

Context

Each annotation is associated with a unique Context instance. This contains details, collected by the parser/analyser, about the PHP context where the annotation was found.

Typically, there will be a processor that uses the data to augment/enrich the annotation.

Examples of the data collected:

  • class/interface/trait/enum names
  • property names
  • doctype or native type hints
  • file name and line number

Analysis

Contains all detected annotations and other relevant meta-data.

It uses a SplObjectStorage instance to store the parsed annotations.

Documentation

This documentation is generated with VitePress

Installation

cd docs
+npm install vitepress 
+

Workflow

  • Edit .md files in the docs folder
  • Update annotation / attribute PHP docblocks.
    These will be extracted during publishing into the reference section.
  • Run 'composer docs:build' to check for any errors
  • Run 'composer docs:dev' to test the generated documentation locally (localhost:3000)
  • Create PR and update master
  • Manually trigger the gh-pages workflow to update the online docs.

The last step requires commit rights on zircote/swagger-php.

+ + + + + \ No newline at end of file diff --git a/hashmap.json b/hashmap.json new file mode 100644 index 00000000..62bb7edd --- /dev/null +++ b/hashmap.json @@ -0,0 +1 @@ +{"guide_annotations.md":"8cc52798","guide_attributes.md":"3e0b725a","guide_common-techniques.md":"e2af46b9","guide_cookbook.md":"2d416869","guide_faq.md":"b1f45c64","guide_generating-openapi-documents.md":"9bb1fdd6","guide_index.md":"29bf901a","guide_installation.md":"34074778","guide_migrating-to-v3.md":"549bb338","guide_migrating-to-v4.md":"714a0f1b","guide_required-elements.md":"ef909293","guide_under-the-hood.md":"58a1fa15","index.md":"56757007","reference_annotations.md":"93df9735","reference_attributes.md":"0f7b8389","reference_generator.md":"857d4ce7","reference_index.md":"05295186","reference_processors.md":"40e47002","related-projects.md":"cb587093","snippets_preamble_annotations.md":"bb82314f","snippets_preamble_attributes.md":"b131e034","snippets_preamble_processors.md":"309ada33"} diff --git a/index.html b/index.html new file mode 100644 index 00000000..2accef78 --- /dev/null +++ b/index.html @@ -0,0 +1,73 @@ + + + + + + Swagger-PHP + + + + + + + + + +

Swagger-PHP

Generate OpenAPI documentation for your RESTful API.

OpenAPI conformant

Generate OpenAPI documents in version 3.0 or 3.1.

Document your API inside PHP source code

Using swagger-php lets you write the API documentation inside the PHP source files which helps keeping the documentation up-to-date.

Annotation and Attribute support

Annotations can be either docblocks or PHP 8.1 attributes.

1. Install with composer:

> composer require zircote/swagger-php
+

2. Update your code

Add swagger-php attributes or annotations to your source code.

3. Generate OpenAPI documentation

> ./bin/openapi src -o openapi.yaml
+

4. Explore and interact with your API

Use an OpenAPI tool like Swagger UI to explore and interact with your API.

+ + + + + \ No newline at end of file diff --git a/reference/annotations.html b/reference/annotations.html new file mode 100644 index 00000000..2d469f99 --- /dev/null +++ b/reference/annotations.html @@ -0,0 +1,21 @@ + + + + + + Annotation Reference | Swagger-PHP + + + + + + + + + +

Annotation Reference

This page is generated automatically from the swagger-php sources.

For improvements head over to GitHub and create a PR 😉

In addition to this page, there are also a number of examples which might help you out.

Annotations

AdditionalProperties

Allowed in


Schema, Property, Items, JsonContent, XmlContent, AdditionalProperties

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Attachable

A container for custom data to be attached to an annotation.

These will be ignored by swagger-php but can be used for custom processing.

Allowed in


AdditionalProperties, Components, Contact, Delete, Discriminator, Examples, ExternalDocumentation, Flow, Get, Head, Header, Info, Items, JsonContent, License, Link, MediaType, OpenApi, Operation, Options, Parameter, Patch, PathItem, PathParameter, Post, Property, Put, RequestBody, Response, Schema, SecurityScheme, Server, ServerVariable, Tag, Trace, Webhook, Xml, XmlContent

Components

Holds a set of reusable objects for different aspects of the OA.

All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.

Allowed in


OpenApi

Nested elements


Response, Parameter, PathParameter, RequestBody, Examples, Header, SecurityScheme, Link, Schema, Attachable

Properties


callbacks : array

Reusable Callbacks.

Reference


Contact

Contact information for the exposed API.

Allowed in


Info

Nested elements


Attachable

Properties


name : string

The identifying name of the contact person/organization.

url : string

The URL pointing to the contact information.

email : string

The email address of the contact person/organization.

Reference


CookieParameter

A @OA\Request cookie parameter.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


in

This takes 'cookie' as the default location.

Delete

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Discriminator

The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.

This object is based on the JSON Schema Specification and uses a predefined subset of it. On top of this subset, there are extensions provided by this specification to allow for more complete documentation.

Allowed in


Schema, Property, AdditionalProperties, Items, JsonContent, XmlContent

Nested elements


Attachable

Properties


propertyName : string

The name of the property in the payload that will hold the discriminator value.

mapping : string[]

An object to hold mappings between payload values and schema names or references.

Reference


Examples

Allowed in


Components, Schema, Parameter, PathParameter, MediaType, JsonContent, XmlContent

Nested elements


Attachable

Properties


ref : string|class-string|object

The relative or absolute path to an example.

See: Using refs

example : string

The key into `#/components/examples`.

summary : string

Short description for the example.

description : string

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

value : int|string|array

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

externalValue : string

An URL that points to the literal example.

This provides the capability to reference examples that cannot easily be included
in JSON or YAML documents.

The value field and externalValue field are mutually exclusive.

ExternalDocumentation

Allows referencing an external resource for extended documentation.

Allowed in


OpenApi, Tag, Schema, AdditionalProperties, Property, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Items, JsonContent, XmlContent

Nested elements


Attachable

Properties


description : string

A short description of the target documentation. GFM syntax can be used for rich text representation.

url : string

The URL for the target documentation.

Reference


Flow

Configuration details for a supported OAuth Flow.

Allowed in


SecurityScheme

Nested elements


Attachable

Properties


authorizationUrl : string

The authorization url to be used for this flow.

This must be in the form of an url.

tokenUrl : string

The token URL to be used for this flow.

This must be in the form of an url.

refreshUrl : string

The URL to be used for obtaining refresh tokens.

This must be in the form of an url.

flow : string

Flow name.

One of ['implicit', 'password', 'authorizationCode', 'clientCredentials'].

scopes : array

The available scopes for the OAuth2 security scheme.

A map between the scope name and a short description for it.

Reference


Get

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Allowed in


Components, Response

Nested elements


Schema, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to the endpoint.

See: Using refs

header : string

No details available.

description : string

A brief description of the parameter.

This could contain examples of use.
CommonMark syntax MAY be used for rich text representation.

required : bool

No details available.

deprecated : bool

Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.

allowEmptyValue : bool

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored.

Reference


HeaderParameter

A @OA\Request header parameter.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


in

This takes 'header' as the default location.

Info

The object provides metadata about the API.

The metadata may be used by the clients if needed and may be presented in editing or documentation generation tools for convenience.

Allowed in


OpenApi

Nested elements


Contact, License, Attachable

Properties


title : string

The title of the application.

description : string

A short description of the application.

CommonMark syntax may be used for rich text representation.

termsOfService : string

An URL to the Terms of Service for the API.

Must be in the format of an url.

version : string

The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).

Reference


Items

The description of an item in a Schema with type array.

Allowed in


Property, AdditionalProperties, Schema, JsonContent, XmlContent, Items

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

JsonContent

Shorthand for a json response.

Use as @OA\Schema inside a Response and MediaType->'application/json' will be generated.

Nested elements


Discriminator, Items, Property, ExternalDocumentation, AdditionalProperties, Examples, Attachable

License

License information for the exposed API.

Allowed in


Info

Nested elements


Attachable

Properties


name : string

The license name used for the API.

identifier : string

An SPDX license expression for the API. The `identifier` field is mutually exclusive of the `url` field.

url : string

An URL to the license used for the API. This MUST be in the form of a URL.

The `url` field is mutually exclusive of the `identifier` field.

Reference


The Link object represents a possible design-time link for a response.

The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.

Unlike dynamic links (i.e. links provided in the response payload), the OA linking mechanism does not require link information in the runtime response.

For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation.

Allowed in


Components, Response

Nested elements


Server, Attachable

Properties


ref : string|class-string|object

No details available.

See: Using refs

link : string

The key into MediaType->links array.

operationRef : string

A relative or absolute reference to an OA operation.

This field is mutually exclusive of the operationId field, and must point to an Operation object.

Relative values may be used to locate an existing Operation object in the OpenAPI definition.

operationId : string

The name of an existing, resolvable OA operation, as defined with a unique operationId.

This field is mutually exclusive of the operationRef field.

parameters : array<string,mixed>

A map representing parameters to pass to an operation as specified with operationId or identified via
operationRef.

The key is the parameter name to be used, whereas the value can be a constant or an expression to
be evaluated and passed to the linked operation.
The parameter name can be qualified using the parameter location [{in}.]{name} for operations
that use the same parameter name in different locations (e.g. path.id).

requestBody

A literal value or {expression} to use as a request body when calling the target operation.

description : string

A description of the link.

CommonMark syntax may be used for rich text representation.

Reference


MediaType

Each Media Type object provides schema and examples for the media type identified by its key.

Allowed in


Response, RequestBody

Nested elements


Schema, Examples, Attachable

Properties


mediaType : string

The key into Operation->content array.

example

Example of the media type.

The example object should be in the correct format as specified by the media type.
The example object is mutually exclusive of the examples object.

Furthermore, if referencing a schema which contains an example,
the example value shall override the example provided by the schema.

encoding : array<string,mixed>

A map between a property name and its encoding information.

The key, being the property name, must exist in the schema as a property.

The encoding object shall only apply to requestBody objects when the media type is multipart or
application/x-www-form-urlencoded.

Reference


OpenApi

This is the root document object for the API specification.

Nested elements


Info, Server, PathItem, Components, Tag, ExternalDocumentation, Webhook, Attachable

Properties


openapi : string

The semantic version number of the OpenAPI Specification version that the OpenAPI document uses.

The openapi field should be used by tooling specifications and clients to interpret the OpenAPI document.

A version specified via `Generator::setVersion()` will overwrite this value.

This is not related to the API info::version string.

security : array

A declaration of which security mechanisms can be used across the API.

The list of values includes alternative security requirement objects that can be used.
Only one of the security requirement objects need to be satisfied to authorize a request.
Individual operations can override this definition.
To make security optional, an empty security requirement `({})` can be included in the array.

Reference


Options

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Parameter

Describes a single operation parameter.

A unique parameter is defined by a combination of a name and location.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to the endpoint.

See: Using refs

parameter : string

The key into Components::parameters or PathItem::parameters array.

name : string

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

in : string

The location of the parameter.

Possible values are "query", "header", "path" or "cookie".

description : string

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

required : bool

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

style : string

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

example

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

content : array<MediaType>|JsonContent|XmlContent|Attachable

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

matrix

Path-style parameters defined by RFC6570.

See: RFC6570

label

Label style parameters defined by RFC6570.

See: RFC6570

form

Form style parameters defined by RFC6570.

This option replaces collectionFormat with a csv (when explode is false) or multi (when explode is true) value from OpenAPI 2.0.

See: RFC6570

simple : array

Simple style parameters defined by RFC6570.

This option replaces collectionFormat with a csv value from OpenAPI 2.0.

See: RFC6570

spaceDelimited : array

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

deepObject

Provides a simple way of rendering nested objects using form parameters.

Reference


Patch

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

PathItem

Describes the operations available on a single path.

A Path Item may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer, but they will not know which operations and parameters are available.

Allowed in


OpenApi

Nested elements


Get, Post, Put, Delete, Patch, Trace, Head, Options, Parameter, PathParameter, Server, Attachable

Properties


ref : string|class-string|object

No details available.

See: Using refs

summary : string

An optional, string summary, intended to apply to all operations in this path.

description : string

An optional, string description, intended to apply to all operations in this path.

path : string

Key for the Path Object (OpenApi->paths array).

Reference


PathParameter

A @OA\Request path parameter.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


in

This takes 'path' as the default location.

required

No details available.

Post

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Property

Allowed in


AdditionalProperties, Schema, JsonContent, XmlContent, Property, Items

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Properties


property : string

The key into Schema->properties array.

Put

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

QueryParameter

A @OA\Request query parameter.

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Properties


in

This takes 'query' as the default location.

RequestBody

Describes a single request body.

Allowed in


Components, Delete, Get, Head, Operation, Options, Patch, Post, Trace, Put

Nested elements


MediaType, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to a request body.

See: Using refs

request : string

The key into Components->requestBodies array.

description : string

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

required : bool

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

Reference


Response

Describes a single response from an API Operation, including design-time, static links to operations based on the response.

Allowed in


Components, Operation, Get, Post, Put, Patch, Delete, Head, Options, Trace

Nested elements


MediaType, Header, Link, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to a response.

See: Using refs

response : string|int

The key into Operations->responses array.

A HTTP status code or default.

description : string

A short description of the response.

CommonMark syntax may be used for rich text representation.

Reference


Schema

The definition of input and output data types.

These types can be objects, but also primitives and arrays.

This object is based on the JSON Schema Specification and uses a predefined subset of it. On top of this subset, there are extensions provided by this specification to allow for more complete documentation.

Allowed in


Components, Parameter, PathParameter, MediaType, Header

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Examples, Xml, AdditionalProperties, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to the endpoint.

See: Using refs

schema : string

The key into Components->schemas array.

title : string

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

type : string|non-empty-array<string>

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string

The extending format for the previously mentioned type. See Data Type Formats for further details.

collectionFormat : string

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : bool|int|float

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : bool|int|float

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

pattern : string

A string instance is considered valid if the regular expression matches the instance successfully.

maxItems : int

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

enum : array<string|int|float|bool|\UnitEnum>|class-string

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

multipleOf : int|float

A numeric instance is valid against "multipleOf" if the result of the division of the instance by this
property's value is an integer.

readOnly : bool

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

example

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\OpenApi\Attributes\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\OpenApi\Attributes\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\OpenApi\Attributes\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

not

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.29.

additionalItems

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.10.

contains

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.14.

patternProperties

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.19.

dependencies

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.21.

propertyNames

http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.22.

const

http://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.1.3.

Reference


SecurityScheme

Allowed in


Components

Nested elements


Flow, Attachable

Properties


ref : string|class-string|object

The relative or absolute path to a security scheme.

See: Using refs

securityScheme : string

The key into OpenApi->security array.

type : string|non-empty-array<string>

The type of the security scheme.

description : string

A short description for security scheme.

name : string

The name of the header or query parameter to be used.

in : string

Required The location of the API key.

bearerFormat : string

A hint to the client to identify how the bearer token is formatted.

Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.

scheme : string

The name of the HTTP Authorization scheme.

See: RFC7235

openIdConnectUrl : string

OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.

Reference


Server

An object representing a server.

Allowed in


OpenApi, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Link

Nested elements


ServerVariable, Attachable

Properties


url : string

An URL to the target host.

This URL supports Server Variables and may be relative,
to indicate that the host location is relative to the location where the OpenAPI document is being served.
Variable substitutions will be made when a variable is named in {brackets}.

description : string

An optional string describing the host designated by the URL.

CommonMark syntax may be used for rich text representation.

Reference


ServerVariable

An object representing a server variable for server URL template substitution.

Allowed in


Server

Nested elements


Attachable

Properties


serverVariable : string

The key into Server->variables array.

enum : array<string|int|float|bool|\UnitEnum>|class-string

An enumeration of values to be used if the substitution options are from a limited set.

default : string

The default value to use for substitution, and to send, if an alternate value is not supplied.

Unlike the Schema Object's default, this value must be provided by the consumer.

variables : array

A map between a variable name and its value.

The value is used for substitution in the server's URL template.

description : string

An optional description for the server variable.

CommonMark syntax MAY be used for rich text representation.

Reference


Tag

Allowed in


OpenApi

Nested elements


ExternalDocumentation, Attachable

Properties


name : string

The name of the tag.

description : string

A short description for the tag. GFM syntax can be used for rich text representation.

Reference


Trace

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Properties


method

No details available.

Webhook

Acts like a PathItem with the main difference being that it requires webhook instead of path.

Allowed in


OpenApi

Nested elements


Get, Post, Put, Delete, Patch, Trace, Head, Options, Parameter, PathParameter, Server, Attachable

Properties


webhook : string

Key for the webhooks map.

Xml

Allowed in


AdditionalProperties, Schema, Property, Schema, Items, XmlContent

Nested elements


Attachable

Properties


name : string

Replaces the name of the element/attribute used for the described schema property.

When defined within the Items Object (items), it will affect the name of the individual XML elements within the list.
When defined alongside type being array (outside the items), it will affect the wrapping element
and only if wrapped is true.

If wrapped is false, it will be ignored.

namespace : string

The URL of the namespace definition. Value SHOULD be in the form of a URL.

prefix : string

The prefix to be used for the name.

attribute : bool

Declares whether the property definition translates to an attribute instead of an element.

Default value is false.

wrapped : bool

MAY be used only for an array definition.

Signifies whether the array is wrapped (for example <books><book/><book/></books>)
or unwrapped (<book/><book/>).

Default value is false. The definition takes effect only when defined alongside type being array (outside the items).

Reference


XmlContent

Shorthand for a xml response.

Use as @OA\Schema inside a Response and MediaType->'application/xml' will be generated.

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Examples, Attachable

+ + + + + \ No newline at end of file diff --git a/reference/attributes.html b/reference/attributes.html new file mode 100644 index 00000000..5ef34472 --- /dev/null +++ b/reference/attributes.html @@ -0,0 +1,21 @@ + + + + + + Attribute Reference | Swagger-PHP + + + + + + + + + +

Attribute Reference

This page is generated automatically from the swagger-php sources.

For improvements head over to GitHub and create a PR 😉

In addition to this page, there are also a number of examples which might help you out.

Attributes

AdditionalProperties

Allowed in


Schema, Property, Items, JsonContent, XmlContent, AdditionalProperties

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\Attributes\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\Attributes\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Attachable

Allowed in


AdditionalProperties, Components, Contact, Delete, Discriminator, Examples, ExternalDocumentation, Flow, Get, Head, Header, Info, Items, JsonContent, License, Link, MediaType, OpenApi, Operation, Options, Parameter, Patch, PathItem, PathParameter, Post, Property, Put, RequestBody, Response, Schema, SecurityScheme, Server, ServerVariable, Tag, Trace, Webhook, Xml, XmlContent

Parameters


properties : array

No details available.

Components

Allowed in


OpenApi

Nested elements


Response, Parameter, PathParameter, RequestBody, Examples, Header, SecurityScheme, Link, Schema, Attachable

Parameters


schemas : array<Schema|\OpenApi\Annotations\Schema>|null

Reusable Schemas.

responses : Response[]|null

Reusable Responses.

parameters : Parameter[]|null

Reusable Parameters.

requestBodies : RequestBody[]|null

Reusable Request Bodies.

examples : array<Examples>|null

Reusable Examples.

headers : Header[]|null

Reusable Headers.

securitySchemes : SecurityScheme[]|null

Reusable Security Schemes.

links : Link[]|null

Reusable Links.

callbacks : array|null

Reusable Callbacks.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Contact

Allowed in


Info

Nested elements


Attachable

Parameters


name : string|null

The identifying name of the contact person/organization.

url : string|null

The URL pointing to the contact information.

email : string|null

The email address of the contact person/organization.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

CookieParameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

This takes 'cookie' as the default location.

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Delete

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\Attributes\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Discriminator

Allowed in


Schema, Property, AdditionalProperties, Items, JsonContent, XmlContent

Nested elements


Attachable

Parameters


propertyName : string|null

The name of the property in the payload that will hold the discriminator value.

mapping : string[]|null

An object to hold mappings between payload values and schema names or references.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Examples

Allowed in


Components, Schema, Parameter, PathParameter, MediaType, JsonContent, XmlContent

Nested elements


Attachable

Parameters


example : string|null

The key into `#/components/examples`.

summary : string|null

Short description for the example.

description : string|null

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

value : array|string|int|null

Embedded literal example.

The value field and externalValue field are mutually exclusive.

To represent examples of media types that cannot naturally be represented
in JSON or YAML, use a string value to contain the example, escaping where necessary.

externalValue : string|null

An URL that points to the literal example.

This provides the capability to reference examples that cannot easily be included
in JSON or YAML documents.

The value field and externalValue field are mutually exclusive.

ref : string|class-string|object|null

The relative or absolute path to an example.

See: Using refs

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

ExternalDocumentation

Allowed in


OpenApi, Tag, Schema, AdditionalProperties, Property, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Items, JsonContent, XmlContent

Nested elements


Attachable

Parameters


description : string|null

A short description of the target documentation. GFM syntax can be used for rich text representation.

url : string|null

The URL for the target documentation.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Flow

Allowed in


SecurityScheme

Nested elements


Attachable

Parameters


authorizationUrl : string|null

The authorization url to be used for this flow.

This must be in the form of an url.

tokenUrl : string|null

The token URL to be used for this flow.

This must be in the form of an url.

refreshUrl : string|null

The URL to be used for obtaining refresh tokens.

This must be in the form of an url.

flow : string|null

Flow name.

One of ['implicit', 'password', 'authorizationCode', 'clientCredentials'].

scopes : array|null

The available scopes for the OAuth2 security scheme.

A map between the scope name and a short description for it.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Get

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\Attributes\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\Attributes\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Allowed in


Components, Response

Nested elements


Schema, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

header : string|null

No details available.

description : string|null

A brief description of the parameter.

This could contain examples of use.
CommonMark syntax MAY be used for rich text representation.

required : bool|null

No details available.

schema : OpenApi\Attributes\Schema|null

Schema object.

deprecated : bool|null

Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

HeaderParameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

This takes 'header' as the default location.

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Info

Allowed in


OpenApi

Nested elements


Contact, License, Attachable

Parameters


version : string|null

The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).

description : string|null

A short description of the application.

CommonMark syntax may be used for rich text representation.

title : string|null

The title of the application.

termsOfService : string|null

An URL to the Terms of Service for the API.

Must be in the format of an url.

contact : OpenApi\Attributes\Contact|null

The contact information for the exposed API.

license : OpenApi\Attributes\License|null

The license information for the exposed API.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Items

Allowed in


Property, AdditionalProperties, Schema, JsonContent, XmlContent, Items

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\Attributes\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\Attributes\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

JsonContent

Nested elements


Discriminator, Items, Property, ExternalDocumentation, AdditionalProperties, Examples, Attachable

Parameters


examples : array<Examples>

Examples of the schema.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\Attributes\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\Attributes\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

License

Allowed in


Info

Nested elements


Attachable

Parameters


name : string|null

The license name used for the API.

identifier : string|null

An SPDX license expression for the API. The `identifier` field is mutually exclusive of the `url` field.

url : string|null

An URL to the license used for the API. This MUST be in the form of a URL.

The `url` field is mutually exclusive of the `identifier` field.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Allowed in


Components, Response

Nested elements


Server, Attachable

Parameters


link : string|null

The key into MediaType->links array.

operationRef : string|null

A relative or absolute reference to an OA operation.

This field is mutually exclusive of the operationId field, and must point to an Operation object.

Relative values may be used to locate an existing Operation object in the OpenAPI definition.

ref : string|class-string|object|null

No details available.

See: Using refs

operationId : string|null

The name of an existing, resolvable OA operation, as defined with a unique operationId.

This field is mutually exclusive of the operationRef field.

parameters : array<string,mixed>

A map representing parameters to pass to an operation as specified with operationId or identified via
operationRef.

The key is the parameter name to be used, whereas the value can be a constant or an expression to
be evaluated and passed to the linked operation.
The parameter name can be qualified using the parameter location [{in}.]{name} for operations
that use the same parameter name in different locations (e.g. path.id).

requestBody : mixed|null

A literal value or {expression} to use as a request body when calling the target operation.

description : string|null

A description of the link.

CommonMark syntax may be used for rich text representation.

server : OpenApi\Attributes\Server|null

A server object to be used by the target operation.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

MediaType

Allowed in


Response, RequestBody

Nested elements


Schema, Examples, Attachable

Parameters


mediaType : string|null

The key into Operation->content array.

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the request body.

example : mixed|null

Example of the media type.

The example object should be in the correct format as specified by the media type.
The example object is mutually exclusive of the examples object.

Furthermore, if referencing a schema which contains an example,
the example value shall override the example provided by the schema.

examples : array<Examples>

Examples of the media type.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

encoding : array<string,mixed>

A map between a property name and its encoding information.

The key, being the property name, must exist in the schema as a property.

The encoding object shall only apply to requestBody objects when the media type is multipart or
application/x-www-form-urlencoded.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

OpenApi

Nested elements


Info, Server, PathItem, Components, Tag, ExternalDocumentation, Webhook, Attachable

Parameters


openapi : string

The semantic version number of the OpenAPI Specification version that the OpenAPI document uses.

The openapi field should be used by tooling specifications and clients to interpret the OpenAPI document.

A version specified via `Generator::setVersion()` will overwrite this value.

This is not related to the API info::version string.

info : OpenApi\Attributes\Info|null

Provides metadata about the API. The metadata may be used by tooling as required.

servers : Server[]|null

An array of @Server objects, which provide connectivity information to a target server.

If not provided, or is an empty array, the default value would be a Server Object with an url value of /.

security : array|null

A declaration of which security mechanisms can be used across the API.

The list of values includes alternative security requirement objects that can be used.
Only one of the security requirement objects need to be satisfied to authorize a request.
Individual operations can override this definition.
To make security optional, an empty security requirement `({})` can be included in the array.

tags : Tag[]|null

A list of tags used by the specification with additional metadata.

The order of the tags can be used to reflect on their order by the parsing tools.
Not all tags that are used by the Operation Object must be declared.
The tags that are not declared may be organized randomly or based on the tools' logic.
Each tag name in the list must be unique.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation.

paths : PathItem[]|null

The available paths and operations for the API.

components : OpenApi\Attributes\Components|null

An element to hold various components for the specification.

webhooks : Webhook[]|null

The available webhooks for the API.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Options

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\Attributes\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Parameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

The location of the parameter.

Possible values are "query", "header", "path" or "cookie".

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Patch

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\Attributes\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

PathItem

Allowed in


OpenApi

Nested elements


Get, Post, Put, Delete, Patch, Trace, Head, Options, Parameter, PathParameter, Server, Attachable

Parameters


path : string|null

Key for the Path Object (OpenApi->paths array).

ref : string|class-string|object|null

No details available.

See: Using refs

summary : string|null

An optional, string summary, intended to apply to all operations in this path.

description : string|null

An optional, string description, intended to apply to all operations in this path.

get : OpenApi\Attributes\Get|null

A definition of a GET operation on this path.

put : OpenApi\Attributes\Put|null

A definition of a PUT operation on this path.

post : OpenApi\Attributes\Post|null

A definition of a POST operation on this path.

delete : OpenApi\Attributes\Delete|null

A definition of a DELETE operation on this path.

options : OpenApi\Attributes\Options|null

A definition of a OPTIONS operation on this path.

head : OpenApi\Attributes\Head|null

A definition of a HEAD operation on this path.

patch : OpenApi\Attributes\Patch|null

A definition of a PATCH operation on this path.

trace : OpenApi\Attributes\Trace|null

A definition of a TRACE operation on this path.

servers : Server[]|null

An alternative server array to service all operations in this path.

parameters : Parameter[]|null

A list of parameters that are applicable for all the operations described under this path.

These parameters can be overridden at the operation level, but cannot be removed there.
The list must not include duplicated parameters.
A unique parameter is defined by a combination of a name and location.
The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

PathParameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

This takes 'path' as the default location.

required : bool|null

No details available.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Post

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\Attributes\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Property

Allowed in


AdditionalProperties, Schema, JsonContent, XmlContent, Property, Items

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Attachable

Parameters


property : string|null

The key into Schema->properties array.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\Attributes\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\Attributes\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Put

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\Attributes\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

QueryParameter

Allowed in


Components, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace

Nested elements


Schema, Examples, Attachable

Parameters


parameter : string|null

The key into Components::parameters or PathItem::parameters array.

name : string|null

The (case-sensitive) name of the parameter.

If in is "path", the name field must correspond to the associated path segment from the path field in the Paths Object.

If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the parameter definition shall be ignored.
For all other cases, the name corresponds to the parameter name used by the in property.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

in : string|null

This takes 'query' as the default location.

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

deprecated : bool|null

Specifies that a parameter is deprecated and should be transitioned out of usage.

allowEmptyValue : bool|null

Sets the ability to pass empty-valued parameters.

This is valid only for query parameters and allows sending a parameter with an empty value.

Default value is false.

If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue shall be ignored.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : OpenApi\Attributes\Schema|null

The schema defining the type used for the parameter.

example : mixed|null

Example of the media type.

The example should match the specified schema and encoding properties if present.
The example object is mutually exclusive of the examples object.
Furthermore, if referencing a schema which contains an example, the example value shall override the example provided by the schema.
To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.

examples : array<Examples>

Examples of the parameter.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

content : array<MediaType>|JsonContent|XmlContent|Attachable|null

A map containing the representations for the parameter.

The key is the media type and the value describes it.
The map must only contain one entry.

style : string|null

Describes how the parameter value will be serialized depending on the type of the parameter value.

Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.

explode : bool|null

When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.

For other types of parameters this property has no effect.

When style is form, the default value is true.
For all other styles, the default value is false.

allowReserved : bool|null

Determines whether the parameter value should allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.

This property only applies to parameters with an in value of query.

The default value is false.

spaceDelimited : array|null

Space separated array values.

This option replaces collectionFormat equal to ssv from OpenAPI 2.0.

pipeDelimited : array|null

Pipe separated array values.

This option replaces collectionFormat equal to pipes from OpenAPI 2.0.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

RequestBody

Allowed in


Components, Delete, Get, Head, Operation, Options, Patch, Post, Trace, Put

Nested elements


MediaType, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to a request body.

See: Using refs

request : string|null

The key into Components->requestBodies array.

description : string|null

A brief description of the parameter.

This could contain examples of use.

CommonMark syntax may be used for rich text representation.

required : bool|null

Determines whether this parameter is mandatory.

If the parameter location is "path", this property is required and its value must be true.
Otherwise, the property may be included and its default value is false.

content : array<MediaType|JsonContent|XmlContent>|MediaType|XmlContent|Attachable|null

The content of the request body.

The key is a media type or media type range and the value describes it. For requests that match multiple keys,
only the most specific key is applicable. e.g. text/plain overrides text/*.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Response

Allowed in


Components, Operation, Get, Post, Put, Patch, Delete, Head, Options, Trace

Nested elements


MediaType, Header, Link, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to a response.

See: Using refs

response : string|int|null

The key into Operations->responses array.

A HTTP status code or default.

description : string|null

A short description of the response.

CommonMark syntax may be used for rich text representation.

headers : Header[]

Maps a header name to its definition.

RFC7230 states header names are case insensitive.

If a response header is defined with the name "Content-Type", it shall be ignored.

See: RFC7230

content : MediaType|JsonContent|XmlContent|Attachable|array<MediaType|Attachable>

A map containing descriptions of potential response payloads.

The key is a media type or media type range and the value describes it.

For responses that match multiple keys, only the most specific key is applicable;
e.g. text/plain overrides text/*.

links : Link[]

A map of operations links that can be followed from the response.

The key of the map is a short name for the link, following the naming constraints of the names for Component
Objects.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Schema

Allowed in


Components, Parameter, PathParameter, MediaType, Header

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Examples, Xml, AdditionalProperties, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\Attributes\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

examples : array<Examples>

Examples of the schema.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\Attributes\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

const : mixed|null

http://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.1.3.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

SecurityScheme

Allowed in


Components

Nested elements


Flow, Attachable

Parameters


ref : string|class-string|object|null

The relative or absolute path to a security scheme.

See: Using refs

securityScheme : string|null

The key into OpenApi->security array.

type : string|non-empty-array<string>|null

The type of the security scheme.

description : string|null

A short description for security scheme.

name : string|null

The name of the header or query parameter to be used.

in : string|null

Required The location of the API key.

bearerFormat : string|null

A hint to the client to identify how the bearer token is formatted.

Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.

scheme : string|null

The name of the HTTP Authorization scheme.

See: RFC7235

openIdConnectUrl : string|null

OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.

flows : Flow[]

The flow used by the OAuth2 security scheme.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Server

Allowed in


OpenApi, PathItem, Operation, Get, Post, Put, Delete, Patch, Head, Options, Trace, Link

Nested elements


ServerVariable, Attachable

Parameters


url : string|null

An URL to the target host.

This URL supports Server Variables and may be relative,
to indicate that the host location is relative to the location where the OpenAPI document is being served.
Variable substitutions will be made when a variable is named in {brackets}.

description : string|null

An optional string describing the host designated by the URL.

CommonMark syntax may be used for rich text representation.

variables : ServerVariable[]

A map between a variable name and its value.

The value is used for substitution in the server's URL template.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

ServerVariable

Allowed in


Server

Nested elements


Attachable

Parameters


serverVariable : string|null

The key into Server->variables array.

description : string|null

An optional description for the server variable.

CommonMark syntax MAY be used for rich text representation.

default : string|null

The default value to use for substitution, and to send, if an alternate value is not supplied.

Unlike the Schema Object's default, this value must be provided by the consumer.

enum : array<string|int|float|bool|\UnitEnum|null>|class-string|null

An enumeration of values to be used if the substitution options are from a limited set.

variables : array|null

A map between a variable name and its value.

The value is used for substitution in the server's URL template.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Tag

Allowed in


OpenApi

Nested elements


ExternalDocumentation, Attachable

Parameters


name : string|null

The name of the tag.

description : string|null

A short description for the tag. GFM syntax can be used for rich text representation.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this tag.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Trace

Allowed in


PathItem

Nested elements


Parameter, PathParameter, Response, ExternalDocumentation, Server, RequestBody, Attachable

Parameters


path : string|null

Key in the OpenApi "Paths Object" for this operation.

operationId : string|null

Unique string used to identify the operation.

The id must be unique among all operations described in the API.
Tools and libraries may use the operationId to uniquely identify an operation, therefore, it is recommended to
follow common programming naming conventions.

description : string|null

A verbose explanation of the operation behavior.

CommonMark syntax MAY be used for rich text representation.

summary : string|null

A short summary of what the operation does.

security : array|null

A declaration of which security mechanisms can be used for this operation.

The list of values includes alternative security requirement objects that can be used.

Only one of the security requirement objects need to be satisfied to authorize a request.

This definition overrides any declared top-level security.
To remove a top-level security declaration, an empty array can be used.

servers : Server[]

An alternative server array to service this operation.

If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by
this value.

requestBody : OpenApi\Attributes\RequestBody|null

The request body applicable for this operation.

The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly
defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody shall be ignored
by consumers.

tags : string[]

A list of tags for API documentation control.

Tags can be used for logical grouping of operations by resources or any other qualifier.

parameters : Parameter[]

A list of parameters that are applicable for this operation.

If a parameter is already defined at the Path Item, the new definition will override it but can never remove it.
The list must not include duplicated parameters.

A unique parameter is defined by a combination of a name and location.

The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's
components/parameters.

responses : Response[]

The list of possible responses as they are returned from executing this operation.

callbacks : array|null

A map of possible out-of band callbacks related to the parent operation.

The key is a unique identifier for the Callback Object.

Each value in the map is a Callback Object that describes a request that may be initiated by the API provider
and the expected responses. The key value used to identify the callback object is an expression, evaluated at
runtime, that identifies a URL to use for the callback operation.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this operation.

deprecated : bool|null

Declares this operation to be deprecated.

Consumers should refrain from usage of the declared operation.

Default value is false.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Webhook

Allowed in


OpenApi

Nested elements


Get, Post, Put, Delete, Patch, Trace, Head, Options, Parameter, PathParameter, Server, Attachable

Parameters


webhook : string|null

Key for the webhooks map.

path : string|null

Key for the Path Object (OpenApi->paths array).

ref : string|class-string|object|null

No details available.

See: Using refs

summary : string|null

An optional, string summary, intended to apply to all operations in this path.

description : string|null

An optional, string description, intended to apply to all operations in this path.

get : OpenApi\Attributes\Get|null

A definition of a GET operation on this path.

put : OpenApi\Attributes\Put|null

A definition of a PUT operation on this path.

post : OpenApi\Attributes\Post|null

A definition of a POST operation on this path.

delete : OpenApi\Attributes\Delete|null

A definition of a DELETE operation on this path.

options : OpenApi\Attributes\Options|null

A definition of a OPTIONS operation on this path.

head : OpenApi\Attributes\Head|null

A definition of a HEAD operation on this path.

patch : OpenApi\Attributes\Patch|null

A definition of a PATCH operation on this path.

trace : OpenApi\Attributes\Trace|null

A definition of a TRACE operation on this path.

servers : Server[]|null

An alternative server array to service all operations in this path.

parameters : Parameter[]|null

A list of parameters that are applicable for all the operations described under this path.

These parameters can be overridden at the operation level, but cannot be removed there.
The list must not include duplicated parameters.
A unique parameter is defined by a combination of a name and location.
The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

Xml

Allowed in


AdditionalProperties, Schema, Property, Schema, Items, XmlContent

Nested elements


Attachable

Parameters


name : string|null

Replaces the name of the element/attribute used for the described schema property.

When defined within the Items Object (items), it will affect the name of the individual XML elements within the list.
When defined alongside type being array (outside the items), it will affect the wrapping element
and only if wrapped is true.

If wrapped is false, it will be ignored.

namespace : string|null

The URL of the namespace definition. Value SHOULD be in the form of a URL.

prefix : string|null

The prefix to be used for the name.

attribute : bool|null

Declares whether the property definition translates to an attribute instead of an element.

Default value is false.

wrapped : bool|null

MAY be used only for an array definition.

Signifies whether the array is wrapped (for example <books><book/><book/></books>)
or unwrapped (<book/><book/>).

Default value is false. The definition takes effect only when defined alongside type being array (outside the items).

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

XmlContent

Nested elements


Discriminator, Items, Property, ExternalDocumentation, Xml, AdditionalProperties, Examples, Attachable

Parameters


examples : array<Examples>

Examples of the schema.

Each example should contain a value in the correct format as specified in the parameter encoding.
The examples object is mutually exclusive of the example object.
Furthermore, if referencing a schema which contains an example, the examples value shall override the example provided by the schema.

ref : string|class-string|object|null

The relative or absolute path to the endpoint.

See: Using refs

schema : string|null

The key into Components->schemas array.

title : string|null

Can be used to decorate a user interface with information about the data produced by this user interface.

Preferably short; use description for more details.

description : string|null

A description will provide explanation about the purpose of the instance described by this schema.

maxProperties : int|null

The maximum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is less than, or equal to, the
value of this attribute.

minProperties : int|null

The minimum number of properties allowed in an object instance.
An object instance is valid against this property if its number of properties is greater than, or equal to, the
value of this attribute.

required : string[]

An object instance is valid against this property if its property set contains all elements in this property's
array value.

properties : Property[]

A collection of properties to define for an object.

Each property is represented as an instance of the Property class.

type : string|non-empty-array<string>|null

The type of the schema/property.

OpenApi v3.0: The value MUST be one of "string", "number", "integer", "boolean", "array" or "object".

Since OpenApi v3.1 an array of types may be used.

format : string|null

The extending format for the previously mentioned type. See Data Type Formats for further details.

items : OpenApi\Attributes\Items|null

Required if type is "array". Describes the type of items in the array.

collectionFormat : string|null

Determines the format of the array if type array is used.

Possible values are:
- csv: comma separated values foo,bar.
- ssv: space separated values foo bar.
- tsv: tab separated values foo\tbar.
- pipes: pipe separated values foo|bar.
- multi: corresponds to multiple parameter instances instead of multiple values for a single instance
foo=bar&foo=baz. This is valid only for parameters of type query or formData. Default
value is csv.

default : mixed|null

Sets a default value to the parameter. The type of the value depends on the defined type.

See: JSON schema validation

maximum : int|float

The maximum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMaximum : int|float|bool|null

A boolean indicating whether the maximum value is excluded from the set of valid values.

When set to true, the maximum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

minimum : int|float

The minimum value allowed for a numeric property. This value must be a number.

See: JSON schema validation

exclusiveMinimum : int|float|bool|null

A boolean indicating whether the minimum value is excluded from the set of valid values.

When set to true, the minimum value is excluded, and when false or not specified, it is included.

See: JSON schema validation

maxLength : int|null

The maximum length of a string property.

A string instance is valid against this property if its length is less than, or equal to, the value of this
attribute.

See: JSON schema validation

minLength : int|null

The minimum length of a string property.

A string instance is valid against this property if its length is greater than, or equal to, the value of this
attribute.

See: JSON schema validation

maxItems : int|null

The maximum number of items allowed in an array property.

An array instance is valid against this property if its number of items is less than, or equal to, the value of
this attribute.

See: JSON schema validation

minItems : int|null

The minimum number of items allowed in an array property.

An array instance is valid against this property if its number of items is greater than, or equal to, the value
of this attribute.

See: JSON schema validation

uniqueItems : bool|null

A boolean value indicating whether all items in an array property must be unique.

If this attribute is set to true, then all items in the array must be unique.

See: JSON schema validation

pattern : string|null

A string instance is considered valid if the regular expression matches the instance successfully.

enum : array<string|int|float|bool|\UnitEnum|null>|class-string|null

A collection of allowable values for a property.

A property instance is valid against this attribute if its value is one of the values specified in this
collection.

See: JSON schema validation

discriminator : OpenApi\Attributes\Discriminator|null

Adds support for polymorphism.

The discriminator is an object name that is used to differentiate between other schemas which may satisfy the
payload description. See Composition and Inheritance for more details.

readOnly : bool|null

Declares the property as "read only".

Relevant only for Schema "properties" definitions.

This means that it may be sent as part of a response but should not be sent as part of the request.
If the property is marked as readOnly being true and is in the required list, the required will take effect on
the response only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

writeOnly : bool|null

Declares the property as "write only".

Relevant only for Schema "properties" definitions.
Therefore, it may be sent as part of a request but should not be sent as part of the response.
If the property is marked as writeOnly being true and is in the required list, the required will take effect on
the request only. A property must not be marked as both readOnly and writeOnly being true. Default value is
false.

xml : OpenApi\Attributes\Xml|null

This may be used only on properties schemas.

It has no effect on root schemas.
Adds additional metadata to describe the XML representation of this property.

externalDocs : OpenApi\Attributes\ExternalDocumentation|null

Additional external documentation for this schema.

example : mixed|null

A free-form property to include an example of an instance for this schema.

To represent examples that cannot naturally be represented in JSON or YAML, a string value can be used to
contain the example with escaping where necessary.

nullable : bool|null

Allows sending a null value for the defined schema.
Default value is false.

This must not be used when using OpenApi version 3.1,
instead make the "type" property an array and add "null" as a possible type.

deprecated : bool|null

Specifies that a schema is deprecated and should be transitioned out of usage.
Default value is false.

allOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against all schemas
defined by this property's value.

anyOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against at least one
schema defined by this property's value.

oneOf : array<Schema|\OpenApi\Annotations\Schema>

An instance validates successfully against this property if it validates successfully against exactly one schema
defined by this property's value.

additionalProperties : OpenApi\Attributes\AdditionalProperties|bool|null

http://json-schema.org/latest/json-schema-validation.html#anchor64.

x : array<string,mixed>|null

While the OpenAPI Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.
For further details see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions
The keys inside the array will be prefixed with `x-`.

attachables : Attachable[]|null

Arbitrary attachables for this annotation.
These will be ignored but can be used for custom processing.

+ + + + + \ No newline at end of file diff --git a/reference/generator.html b/reference/generator.html new file mode 100644 index 00000000..6df2a89a --- /dev/null +++ b/reference/generator.html @@ -0,0 +1,101 @@ + + + + + + Using the Generator | Swagger-PHP + + + + + + + + + +

Using the Generator

Introduction

The Generator class provides an object-oriented way to use swagger-php and all its aspects in a single place.

The \OpenApi\scan() function

For a long time the \OpenApi\scan() function was the main entry point into using swagger-php from PHP code.

/**
+  * Scan the filesystem for OpenAPI annotations and build openapi-documentation.
+  *
+  * @param array|Finder|string $directory The directory(s) or filename(s)
+  * @param array               $options
+  *                                       exclude: string|array $exclude The directory(s) or filename(s) to exclude (as absolute or relative paths)
+  *                                       pattern: string       $pattern File pattern(s) to scan (default: *.php)
+  *                                       analyser: defaults to StaticAnalyser
+  *                                       analysis: defaults to a new Analysis
+  *                                       processors: defaults to the registered processors in Analysis
+  *
+  * @return OpenApi
+  */
+  function scan($directory, $options = []) { /* ... */ }
+

Using it looked typically something like this:

require("vendor/autoload.php");
+
+$openapi = \OpenApi\scan(__DIR__, ['exclude' => ['tests'], 'pattern' => '*.php']);
+

The two configuration options for the underlying Doctrine doc-block parser aliases and namespaces are not part of this function and need to be set separately.

Being static this means setting them back is the callers responsibility and there is also the fact that some Doctrine configuration currently can not be reverted easily.

Therefore, having a single side effect free way of using swagger-php seemed like a good idea...

The \OpenApi\Generator class

The Generator class can be used in object-oriented (and fluent) style which allows for easy customization if needed.

In that case to actually process the given input files the non-static method generate() is to be used.

Full example of using the Generator class to generate OpenApi specs.

require("vendor/autoload.php");
+
+$validate = true;
+$logger = new \Psr\Log\NullLogger();
+$processors = [/* my processors */];
+$finder = \Symfony\Component\Finder\Finder::create()->files()->name('*.php')->in(__DIR__);
+
+$openapi = (new \OpenApi\Generator($logger))
+            ->setProcessorPipeline(new \OpenApi\Pipeline($processors))
+            ->setAliases(['MY' => 'My\Annotations'])
+            ->setNamespaces(['My\\Annotations\\'])
+            ->setAnalyser(new \OpenApi\Analysers\TokenAnalyser())
+            ->setVersion(\OpenApi\Annotations\OpenApi::VERSION_3_0_0)
+            ->generate(['/path1/to/project', $finder], new \OpenApi\Analysis(), $validate);
+

Aliases and namespaces are additional options that allow to customize the parsing of docblocks.

Defaults:

  • aliases: ['oa' => 'OpenApi\\Annotations']

    Aliases help the underlying doctrine annotations library to parse annotations. Effectively they avoid having to write use OpenApi\Annotations as OA; in your code and make @OA\property(..) annotations still work.

  • namespaces: ['OpenApi\\Annotations\\']

    Namespaces control which annotation namespaces can be autoloaded automatically. Under the hood this is handled by registering a custom loader with the doctrine annotation library.

Advantages:

  • The Generator code will handle configuring things as before in a single place
  • Static settings will be reverted to the default once finished
  • The get/set methods allow for using type hints
  • Static configuration is deprecated and can be removed at some point without code changes
  • Build in support for PSR logger
  • Support for Symfony Finder, \SplInfo and file/directory names (`string) as source.

The minimum code required, using the generate() method, looks quite similar to the old scan() code:

    /**
+     * Generate OpenAPI spec by scanning the given source files.
+     *
+     * @param iterable      $sources  PHP source files to scan.
+     *                                Supported sources:
+     *                                * string - file / directory name
+     *                                * \SplFileInfo
+     *                                * \Symfony\Component\Finder\Finder
+     * @param null|Analysis $analysis custom analysis instance
+     * @param bool          $validate flag to enable/disable validation of the returned spec
+     */
+    public function generate(iterable $sources, ?Analysis $analysis = null, bool $validate = true): \OpenApi\OpenApi { /* ... */ }
+
require("vendor/autoload.php");
+
+$openapi = (new \OpenApi\Generator())->generate(['/path1/to/project']);
+

For those that want to type even less and keep using a plain array to configure swagger-php there is also a static version:

<?php
+require("vendor/autoload.php");
+
+$openapi = \OpenApi\Generator::scan(['/path/to/project']);
+
+header('Content-Type: application/x-yaml');
+echo $openapi->toYaml();
+

Note: While using the same name as the old scan() function, the Generator::scan method is not 100% backwards compatible.

    /**
+     * Static  wrapper around `Generator::generate()`.
+     *
+     * @param iterable $sources PHP source files to scan.
+     *                          Supported sources:
+     *                          * string
+     *                          * \SplFileInfo
+     *                          * \Symfony\Component\Finder\Finder
+     * @param array    $options
+     *                          aliases:    null|array                    Defaults to `['oa' => 'OpenApi\\Annotations']`.
+     *                          namespaces: null|array                    Defaults to `['OpenApi\\Annotations\\']`.
+     *                          analyser:   null|AnalyserInterface        Defaults to a new `ReflectionAnalyser` supporting both docblocks and attributes.
+     *                          analysis:   null|Analysis                 Defaults to a new `Analysis`.
+     *                          processors: null|array                    Defaults to `Analysis::processors()`.
+     *                          logger:     null|\Psr\Log\LoggerInterface If not set logging will use \OpenApi\Logger as before.
+     *                          validate:   bool                          Defaults to `true`.
+     *                          version:    string                        Defaults to `\OpenApi\Annotations\OpenApi::VERSION_3_0_0`. Alternatives are: `\OpenApi\Annotations\OpenApi::VERSION_3_1_0`.
+     */
+    public static function scan(iterable $sources, array $options = []): OpenApi { /* ... */ }
+

Most notably the exclude and pattern keys are no longer supported. Instead, a Symfony Finder instance can be passed in as source directly (same as with Generator::generate()).

If needed, the \OpenApi\Util class provides a builder method that allows to keep the status-quo

$exclude = ['tests'];
+$pattern = '*.php';
+
+$openapi = \OpenApi\Generator::scan(\OpenApi\Util::finder(__DIR__, $exclude, $pattern));
+
+// same as
+
+$openapi = \OpenApi\scan(__DIR__, ['exclude' => $exclude, 'pattern' => $pattern]);
+
+ + + + + \ No newline at end of file diff --git a/reference/index.html b/reference/index.html new file mode 100644 index 00000000..ef667ddf --- /dev/null +++ b/reference/index.html @@ -0,0 +1,21 @@ + + + + + + Reference | Swagger-PHP + + + + + + + + + +

Reference

In total there are a number of different aspects to using swagger-php. Depending on how custom your requirements are this might be limited to just annotating your code and using the command line tool.

However, swagger-php offers more.

  • Attributes

    The new way of adding meta-data to your codebase. Requires PHP 8.1

  • Docblock annotations

    The 'traditional' way of documenting your API.

  • The Generator

    The \OpenAPI\Generator class is the main entry point to programmatically generate OpenAPI documents from your code.

  • Processors

    swagger-php comes with a list of pre-defined processors that convert the raw data to a complete OpenAPI document. Custom processors can be added or existing removed to tweak swagger-php` to your requirements.

+ + + + + \ No newline at end of file diff --git a/reference/processors.html b/reference/processors.html new file mode 100644 index 00000000..d4e9fa5c --- /dev/null +++ b/reference/processors.html @@ -0,0 +1,33 @@ + + + + + + Processor Reference | Swagger-PHP + + + + + + + + + +

Processor Reference

This page is generated automatically from the swagger-php sources.

For improvements head over to GitHub and create a PR 😉

Processors are listed in the default order of execution.

Processor Configuration

Command line

The -c option allows to specify a name/value pair with the name consisting of the processor name (starting lowercase) and option name separated by a dot (.).

> ./bin/openapi -c operatinId.hash=true // ...
+> ./bin/openapi -c pathFilter.tags[]=/pets/ -c pathFilter.tags[]=/store/ // ...
+

Programmatically with PHP

Configuration can be set using the Generator::setConfig() method. Keys can either be the same as on the command line or be broken down into nested arrays.

(new Generator())
+    ->setConfig([
+        'operationId.hash' => true,
+        'pathFilter' => [
+            'tags' => [
+                '/pets/',
+                '/store/',
+            ],
+        ],
+    ]);
+

Default Processors

DocBlockDescriptions

Checks if the annotation has a summary and/or description property and uses the text in the comment block (above the annotations) as summary and/or description.

Use null, for example: @Annotation(description=null), if you don't want the annotation to have a description.

MergeIntoOpenApi

Merge all @OA\OpenApi annotations into one.

MergeIntoComponents

Merge reusable annotation into @OA\Schemas.

ExpandClasses

Iterate over the chain of ancestors of a schema and:

  • if the ancestor has a schema => inherit from the ancestor if it has a schema (allOf) and stop.
  • else => merge ancestor properties into the schema.

ExpandInterfaces

Look at all (direct) interfaces for a schema and:

  • merge interfaces annotations/methods into the schema if the interface does not have a schema itself
  • inherit from the interface if it has a schema (allOf).

ExpandTraits

Look at all (direct) traits for a schema and:

  • merge trait annotations/methods/properties into the schema if the trait does not have a schema itself
  • inherit from the trait if it has a schema (allOf).

ExpandEnums

Expands PHP enums.

Determines schema, enum and type.

AugmentSchemas

Use the Schema context to extract useful information and inject that into the annotation.

Merges properties.

AugmentRequestBody

Use the RequestBody context to extract useful information and inject that into the annotation.

AugmentProperties

Use the property context to extract useful information and inject that into the annotation.

BuildPaths

Build the openapi->paths using the detected @OA\PathItem and @OA\Operation (@OA\Get, @OA\Post, etc).

AugmentParameters

Augments shared and operations parameters from docblock comments.

Config settings

augmentParameters.augmentOperationParameters : bool
default : true

If set to true try to find operation parameter descriptions in the operation docblock.

AugmentRefs

MergeJsonContent

Split JsonContent into Schema and MediaType.

MergeXmlContent

Split XmlContent into Schema and MediaType.

OperationId

Generate the OperationId based on the context of the OpenApi annotation.

Config settings

operationId.hash : bool
default : true

If set to true generate ids (md5) instead of clear text operation ids.

AugmentTags

Ensures that all tags used on operations also exist in the global tags list.

CleanUnmerged

PathFilter

Allows to filter endpoints based on tags and/or path.

If no tags or paths filters are set, no filtering is performed. All filter (regular) expressions must be enclosed within delimiter characters as they are used as-is.

Config settings

pathFilter.tags : array
default : []

A list of regular expressions to match tags to include.

pathFilter.paths : array
default : []

A list of regular expressions to match paths to include.

CleanUnusedComponents

Tracks the use of all Components and removed unused schemas.

Config settings

cleanUnusedComponents.enabled : bool
default : false

Enables/disables the CleanUnusedComponents processor.

+ + + + + \ No newline at end of file diff --git a/related-projects.html b/related-projects.html new file mode 100644 index 00000000..e757c114 --- /dev/null +++ b/related-projects.html @@ -0,0 +1,21 @@ + + + + + + Related projects | Swagger-PHP + + + + + + + + + +

Related projects

ProjectDescription
Swagger UIThe webinterface for reading the generated documentation
Swagger ExplainedBrowse the spec by using an swagger.json.
silex2swaggerGenerate swagger documentation from Silex Annotations
yii2-swaggerswagger-php integration with yii2
Lumen swaggerswagger-php integration with lumen/laravel
NelmioApiDocBundleSymfony bundle on top of swagger-php
auto-swagger-uiAutomatically add swagger ui and json to your application
openapi-routerConfigure framework routes from OpenApi annotations
openapi-verifierVerify response against OpenAPI specification in PHPUnit
openapi-filterFilter internal paths, operations, parameters, etc
OpenAPI-Symfony-RoutingLoad routes in Symfony based on OpenAPI annotations
Swag It PHPConvert JSON to PHP Swagger annotations
Laravel SwaggerOpenApi or Swagger integration to Laravel
openapi-extrasExtra annotations for swagger-php
openapi-serializeSerialize an object using swagger-php

Is a related project missing? Create a pull request!

+ + + + + \ No newline at end of file diff --git a/snippets/preamble_annotations.html b/snippets/preamble_annotations.html new file mode 100644 index 00000000..afbbd685 --- /dev/null +++ b/snippets/preamble_annotations.html @@ -0,0 +1,21 @@ + + + + + + Swagger-PHP + + + + + + + + + +

In addition to this page, there are also a number of examples which might help you out.

+ + + + + \ No newline at end of file diff --git a/snippets/preamble_attributes.html b/snippets/preamble_attributes.html new file mode 100644 index 00000000..2978c2fc --- /dev/null +++ b/snippets/preamble_attributes.html @@ -0,0 +1,21 @@ + + + + + + Swagger-PHP + + + + + + + + + +

In addition to this page, there are also a number of examples which might help you out.

+ + + + + \ No newline at end of file diff --git a/snippets/preamble_processors.html b/snippets/preamble_processors.html new file mode 100644 index 00000000..891a676a --- /dev/null +++ b/snippets/preamble_processors.html @@ -0,0 +1,21 @@ + + + + + + Swagger-PHP + + + + + + + + + + + + + + + \ No newline at end of file