From 7165770f2bdf187a3a7a7de9024f86a14501d067 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 12:40:01 +0000 Subject: [PATCH 01/90] Bump loader-utils from 1.4.0 to 1.4.2 Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.2) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb2944f1..f0ddafc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -697,9 +697,9 @@ leven@^3.1.0: integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== loader-utils@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + version "1.4.2" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" + integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" @@ -801,9 +801,9 @@ min-document@^2.19.0: dom-walk "^0.1.0" minimist@^1.2.0: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== mobx-react@^5.4.3: version "5.4.4" From d681cccd2cb623c4dbb331774c1386eb9fb65e94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Dec 2022 20:03:21 +0000 Subject: [PATCH 02/90] Bump express from 4.17.2 to 4.18.2 Bumps [express](https://github.com/expressjs/express) from 4.17.2 to 4.18.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.17.2...4.18.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 267 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 160 insertions(+), 107 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb2944f1..4d236a06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -40,7 +40,7 @@ resolved "https://registry.yarnpkg.com/@exodus/schemasafe/-/schemasafe-1.0.0-rc.6.tgz#7985f681564cff4ffaebb5896eb4be20af3aae7a" integrity sha512-dDnQizD94EdBwEj/fh3zPRa/HWCS9O5au2PuHhZBbuM3xWHxuaKzPBOEWze7Nn0xW68MIpZ7Xdyn1CoCpjKCuQ== -accepts@~1.3.7: +accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== @@ -97,7 +97,7 @@ argparse@^1.0.7: array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== async@^1.4.0: version "1.5.2" @@ -122,26 +122,36 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== -body-parser@1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.1.tgz#1499abbaa9274af3ecc9f6f10396c995943e31d4" - integrity sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA== +body-parser@1.20.1: + version "1.20.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" + integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== dependencies: - bytes "3.1.1" + bytes "3.1.2" content-type "~1.0.4" debug "2.6.9" - depd "~1.1.2" - http-errors "1.8.1" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.9.6" - raw-body "2.4.2" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.1" type-is "~1.6.18" + unpipe "1.0.0" -bytes@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.1.tgz#3f018291cb4cbad9accb6e6970bca9c8889e879a" - integrity sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg== +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +call-bind@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" call-me-maybe@^1.0.1: version "1.0.1" @@ -263,12 +273,12 @@ content-type@~1.0.4: cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== +cookie@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== core-js@^3.2.1: version "3.21.0" @@ -303,15 +313,15 @@ decko@^1.2.0: resolved "https://registry.yarnpkg.com/decko/-/decko-1.2.0.tgz#fd43c735e967b8013306884a56fbe665996b6817" integrity sha1-/UPHNelnuAEzBohKVvvmZZlraBc= -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +destroy@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== dom-walk@^0.1.0: version "0.1.2" @@ -326,7 +336,7 @@ dompurify@^1.0.10: ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== ejs@^2.5.2: version "2.7.4" @@ -346,7 +356,7 @@ emojis-list@^3.0.0: encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== end-of-stream@^1.1.0: version "1.4.4" @@ -368,7 +378,7 @@ escalade@^3.1.1: escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== escape-string-regexp@^1.0.5: version "1.0.5" @@ -383,7 +393,7 @@ esprima@^4.0.0: etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== eventemitter3@^3.0.0: version "3.1.2" @@ -404,37 +414,38 @@ execa@^1.0.0: strip-eof "^1.0.0" express@^4.14.0: - version "4.17.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.2.tgz#c18369f265297319beed4e5558753cc8c1364cb3" - integrity sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg== + version "4.18.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" + integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== dependencies: - accepts "~1.3.7" + accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.19.1" + body-parser "1.20.1" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.4.1" + cookie "0.5.0" cookie-signature "1.0.6" debug "2.6.9" - depd "~1.1.2" + depd "2.0.0" encodeurl "~1.0.2" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "~1.1.2" + finalhandler "1.2.0" fresh "0.5.2" + http-errors "2.0.0" merge-descriptors "1.0.1" methods "~1.1.2" - on-finished "~2.3.0" + on-finished "2.4.1" parseurl "~1.3.3" path-to-regexp "0.1.7" proxy-addr "~2.0.7" - qs "6.9.6" + qs "6.11.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.17.2" - serve-static "1.14.2" + send "0.18.0" + serve-static "1.15.0" setprototypeof "1.2.0" - statuses "~1.5.0" + statuses "2.0.1" type-is "~1.6.18" utils-merge "1.0.1" vary "~1.1.2" @@ -459,17 +470,17 @@ fast-safe-stringify@^2.0.7: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== -finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== +finalhandler@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" + integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== dependencies: debug "2.6.9" encodeurl "~1.0.2" escape-html "~1.0.3" - on-finished "~2.3.0" + on-finished "2.4.1" parseurl "~1.3.3" - statuses "~1.5.0" + statuses "2.0.1" unpipe "~1.0.0" find-up@^3.0.0: @@ -497,7 +508,12 @@ forwarded@0.2.0: fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== get-caller-file@^1.0.1: version "1.0.3" @@ -509,6 +525,15 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.0.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" + integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -534,6 +559,18 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" @@ -541,15 +578,15 @@ hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0: dependencies: react-is "^16.7.0" -http-errors@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" - integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== dependencies: - depd "~1.1.2" + depd "2.0.0" inherits "2.0.4" setprototypeof "1.2.0" - statuses ">= 1.5.0 < 2" + statuses "2.0.1" toidentifier "1.0.1" http2-client@^1.2.5: @@ -745,7 +782,7 @@ marked@^0.6.1: media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== mem@^4.0.0: version "4.3.0" @@ -764,24 +801,24 @@ memoize-one@^5.0.0: merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@~2.1.24, mime-types@~2.1.34: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" mime@1.6.0: version "1.6.0" @@ -816,7 +853,7 @@ mobx-react@^5.4.3: ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== ms@2.1.3: version "2.1.3" @@ -936,10 +973,15 @@ object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= +object-inspect@^1.9.0: + version "1.12.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" + integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== + +on-finished@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== dependencies: ee-first "1.1.1" @@ -1032,7 +1074,7 @@ path-key@^2.0.0, path-key@^2.0.1: path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== perfect-scrollbar@^1.4.0: version "1.5.5" @@ -1081,23 +1123,25 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -qs@6.9.6: - version "6.9.6" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" - integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.2.tgz#baf3e9c21eebced59dd6533ac872b71f7b61cb32" - integrity sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ== +raw-body@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== dependencies: - bytes "3.1.1" - http-errors "1.8.1" + bytes "3.1.2" + http-errors "2.0.0" iconv-lite "0.4.24" unpipe "1.0.0" @@ -1209,34 +1253,34 @@ semver@^5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -send@0.17.2: - version "0.17.2" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.2.tgz#926622f76601c41808012c8bf1688fe3906f7820" - integrity sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww== +send@0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" + integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== dependencies: debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" + depd "2.0.0" + destroy "1.2.0" encodeurl "~1.0.2" escape-html "~1.0.3" etag "~1.8.1" fresh "0.5.2" - http-errors "1.8.1" + http-errors "2.0.0" mime "1.6.0" ms "2.1.3" - on-finished "~2.3.0" + on-finished "2.4.1" range-parser "~1.2.1" - statuses "~1.5.0" + statuses "2.0.1" -serve-static@1.14.2: - version "1.14.2" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.2.tgz#722d6294b1d62626d41b43a013ece4598d292bfa" - integrity sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ== +serve-static@1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" + integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.17.2" + send "0.18.0" set-blocking@^2.0.0: version "2.0.0" @@ -1309,6 +1353,15 @@ should@^13.2.1: should-type-adaptors "^1.0.1" should-util "^1.0.0" +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + signal-exit@^3.0.0: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -1348,10 +1401,10 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== stickyfill@^1.1.1: version "1.1.1" @@ -1460,17 +1513,17 @@ type-is@~1.6.18: unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== webidl-conversions@^3.0.0: version "3.0.1" From 35f1f376dc80473eb4663abd385656e8cb79d589 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Dec 2022 17:27:54 +0000 Subject: [PATCH 03/90] Bump json-pointer from 0.6.1 to 0.6.2 Bumps [json-pointer](https://github.com/manuelstofer/json-pointer) from 0.6.1 to 0.6.2. - [Release notes](https://github.com/manuelstofer/json-pointer/releases) - [Commits](https://github.com/manuelstofer/json-pointer/commits) --- updated-dependencies: - dependency-name: json-pointer dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb2944f1..85baa02f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -480,9 +480,9 @@ find-up@^3.0.0: locate-path "^3.0.0" foreach@^2.0.4: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= + version "2.0.6" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.6.tgz#87bcc8a1a0e74000ff2bf9802110708cfb02eb6e" + integrity sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg== format-util@^1.0.3: version "1.0.5" @@ -630,9 +630,9 @@ js-yaml@^3.12.1, js-yaml@^3.2.3: esprima "^4.0.0" json-pointer@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/json-pointer/-/json-pointer-0.6.1.tgz#3c6caa6ac139e2599f5a1659d39852154015054d" - integrity sha512-3OvjqKdCBvH41DLpV4iSt6v2XhZXV1bPB4OROuknvUXI7ZQNofieCPkmE26stEJ9zdQuvIxDHCuYhfgxFAAs+Q== + version "0.6.2" + resolved "https://registry.yarnpkg.com/json-pointer/-/json-pointer-0.6.2.tgz#f97bd7550be5e9ea901f8c9264c9d436a22a93cd" + integrity sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw== dependencies: foreach "^2.0.4" From 9969ac174d62b80c1e9fc25b3d99a96248a45250 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Jan 2023 06:35:56 +0000 Subject: [PATCH 04/90] Bump json5 from 1.0.1 to 1.0.2 Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb2944f1..ee381ed0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,9 +666,9 @@ json-to-ast@^2.0.3: grapheme-splitter "^1.0.4" json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" @@ -801,9 +801,9 @@ min-document@^2.19.0: dom-walk "^0.1.0" minimist@^1.2.0: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== mobx-react@^5.4.3: version "5.4.4" From 7bb9f59619e00a892fec4d78ebaa1a16f7a56bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Vil=C3=A0?= Date: Fri, 27 Jan 2023 11:39:22 +0100 Subject: [PATCH 05/90] phpstan 1.x support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roger VilĂ  --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 46cb26f2..8162284c 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "mermade/openapi3-examples": "1.0.0", "apis-guru/openapi-directory": "1.0.0", "nexmo/api-specification": "1.0.0", - "phpstan/phpstan": "^0.12.0" + "phpstan/phpstan": "^0.12.0 || ^1.9" }, "conflict": { "symfony/yaml": "3.4.0 - 3.4.4 || 4.0.0 - 4.4.17 || 5.0.0 - 5.1.9 || 5.2.0" From 786230beac40d7c73421ec59b23ce01144cd2dec Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Sat, 24 Jun 2023 19:34:17 +0200 Subject: [PATCH 06/90] Update README.md A new project which makes use of php-openapi --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3d25df05..55d9dbd3 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ do awesome work: - [cebe/yii2-app-api](https://github.com/cebe/yii2-app-api) Yii framework application template for developing API-first applications. - [league/openapi-psr7-validator](https://github.com/thephpleague/openapi-psr7-validator) validates PSR-7 messages (HTTP request/response) against OpenAPI descriptions. - [dsuurlant/response2schema](https://github.com/dsuurlant/response2schema) a quick and easy tool for generating OpenAPI schemas based on example data. +- [googoogajoob/openapislim4](https://github.com/googoogajoob/openapislim4) Configure the paths of a slim4 application from an openapi definition. - ... ([add yours](https://github.com/cebe/php-openapi/edit/master/README.md#L24)) ## Usage From 2aecd528dccd6dcfa897f5f1793c196c8e6dff4a Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Tue, 27 Jun 2023 18:45:09 +0200 Subject: [PATCH 07/90] Update README.md Fix repository name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55d9dbd3..e54b9452 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ do awesome work: - [cebe/yii2-app-api](https://github.com/cebe/yii2-app-api) Yii framework application template for developing API-first applications. - [league/openapi-psr7-validator](https://github.com/thephpleague/openapi-psr7-validator) validates PSR-7 messages (HTTP request/response) against OpenAPI descriptions. - [dsuurlant/response2schema](https://github.com/dsuurlant/response2schema) a quick and easy tool for generating OpenAPI schemas based on example data. -- [googoogajoob/openapislim4](https://github.com/googoogajoob/openapislim4) Configure the paths of a slim4 application from an openapi definition. +- [googoogajoob/openapi-slim4](https://github.com/googoogajoob/openapi-slim4) Configure the paths of a slim4 application from an openapi definition. - ... ([add yours](https://github.com/cebe/php-openapi/edit/master/README.md#L24)) ## Usage From c843243488dd31e32100444161e6b2e2321c5325 Mon Sep 17 00:00:00 2001 From: Arinzechukwu Date: Wed, 13 Sep 2023 15:50:58 +0100 Subject: [PATCH 08/90] Added test to confirm referenced parameters are compiling to arrays --- tests/spec/PathTest.php | 31 ++++++++++ tests/spec/data/path-params/global.yaml | 28 +++++++++ tests/spec/data/path-params/openapi.yaml | 18 ++++++ tests/spec/data/path-params/user.yaml | 76 ++++++++++++++++++++++++ 4 files changed, 153 insertions(+) create mode 100644 tests/spec/data/path-params/global.yaml create mode 100644 tests/spec/data/path-params/openapi.yaml create mode 100644 tests/spec/data/path-params/user.yaml diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 6c46e4b0..e5be1bfd 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -192,4 +192,35 @@ public function testPathItemReference() $this->assertEquals('A bar', $barPath->get->responses['200']->description); $this->assertEquals('non-existing resource', $barPath->get->responses['404']->description); } + + public function testPathParametersAreArrays() + { + $file = __DIR__ . '/data/path-params/openapi.yaml'; + /** @var $openapi \cebe\openapi\spec\OpenApi */ + $openapi = Reader::readFromYamlFile($file, \cebe\openapi\spec\OpenApi::class, true); + + $result = $openapi->validate(); + $this->assertEquals([], $openapi->getErrors(), print_r($openapi->getErrors(), true)); + $this->assertTrue($result); + + $this->assertInstanceOf(Paths::class, $openapi->paths); + $this->assertIsArray($openapi->paths->getPaths()); + $this->assertInstanceOf(PathItem::class, $usersPath = $openapi->paths['/v1/{organizationId}/user']); + $this->assertInstanceOf(PathItem::class, $userIdPath = $openapi->paths['/v1/{organizationId}/user/{id}']); + + $result = $usersPath->validate(); + $this->assertTrue($result); + $this->assertIsArray($usersPath->parameters); + $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[0]); + $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[1]); + $this->assertEquals($usersPath->parameters[0]->name, 'api-version'); + + $result = $userIdPath->validate(); + $this->assertTrue($result); + $this->assertIsArray($userIdPath->parameters); + $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); + $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); + $this->assertEquals($userIdPath->parameters[2]->name, 'id'); + + } } diff --git a/tests/spec/data/path-params/global.yaml b/tests/spec/data/path-params/global.yaml new file mode 100644 index 00000000..38348ee4 --- /dev/null +++ b/tests/spec/data/path-params/global.yaml @@ -0,0 +1,28 @@ +components: + parameters: + Version: + in: header + name: api-version + required: false + schema: + type: string + format: date + example: '2021-05-18' + description: The API version + OrganizationId: + in: path + name: organizationId + required: true + schema: + type: string + format: uuid + description: The Organization ID + responses: + BadRequest: + description: Bad Request + Forbidden: + description: Forbidden + NotFound: + description: Not Found + Success: + description: Success \ No newline at end of file diff --git a/tests/spec/data/path-params/openapi.yaml b/tests/spec/data/path-params/openapi.yaml new file mode 100644 index 00000000..722d8184 --- /dev/null +++ b/tests/spec/data/path-params/openapi.yaml @@ -0,0 +1,18 @@ +openapi: 3.0.0 +info: + version: "2021-05-18" + title: Test REST API + description: Specifications for the Test REST API. + contact: + name: bplainia + email: bplainia@lhespotlight.org + +servers: + - url: 'http://localhost:8000' + description: 'Test' + +paths: + /v1/{organizationId}/user: + $ref: 'user.yaml#/paths/Users' + /v1/{organizationId}/user/{id}: + $ref: 'user.yaml#/paths/UserId' \ No newline at end of file diff --git a/tests/spec/data/path-params/user.yaml b/tests/spec/data/path-params/user.yaml new file mode 100644 index 00000000..a842e783 --- /dev/null +++ b/tests/spec/data/path-params/user.yaml @@ -0,0 +1,76 @@ +paths: + Users: + parameters: + - $ref: 'global.yaml#/components/parameters/Version' + - $ref: 'global.yaml#/components/parameters/OrganizationId' + post: + summary: Creates a user + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/User' + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/User' + '400': + $ref: 'global.yaml#/components/responses/BadRequest' + '403': + $ref: 'global.yaml#/components/responses/Forbidden' + UserId: + parameters: + - $ref: 'global.yaml#/components/parameters/Version' + - $ref: 'global.yaml#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/UserId' + get: + summary: Gets a user + security: + - BearerAuth: [] + responses: + '200': + description: A bar + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/User' + '400': + $ref: 'global.yaml#/components/responses/BadRequest' + '403': + $ref: 'global.yaml#/components/responses/Forbidden' + '404': + $ref: 'global.yaml#/components/responses/NotFound' +components: + schemas: + User: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + parameters: + UserId: + in: path + name: id + required: true + schema: + type: string + format: uuid + description: User's ID \ No newline at end of file From 2e2bce1ddf7c4cd9f51437aa682a8d7c4e3d2a93 Mon Sep 17 00:00:00 2001 From: Peter Stalman Date: Fri, 22 Sep 2023 04:07:14 -0700 Subject: [PATCH 09/90] Update README.md (add Spectator) Not mine, but it has ~250 stars so worth adding. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3d25df05..8286d213 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ do awesome work: - [cebe/yii2-app-api](https://github.com/cebe/yii2-app-api) Yii framework application template for developing API-first applications. - [league/openapi-psr7-validator](https://github.com/thephpleague/openapi-psr7-validator) validates PSR-7 messages (HTTP request/response) against OpenAPI descriptions. - [dsuurlant/response2schema](https://github.com/dsuurlant/response2schema) a quick and easy tool for generating OpenAPI schemas based on example data. +- [hotmeteor/spectator](https://github.com/hotmeteor/spectator) a light-weight OpenAPI testing tool for existing Laravel test suite. - ... ([add yours](https://github.com/cebe/php-openapi/edit/master/README.md#L24)) ## Usage From f10a528e516a1371a3e5f43c6663196c24285037 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 13 Nov 2024 16:51:30 +0100 Subject: [PATCH 10/90] restore missing tag in apis-guru/openapi-directory --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 46cb26f2..567c1487 100644 --- a/composer.json +++ b/composer.json @@ -81,7 +81,7 @@ "source": { "url": "https://github.com/APIs-guru/openapi-directory", "type": "git", - "reference": "openapi3.0.0" + "reference": "9d2e0b6696a230a182d740a8e97ba27fb41b13bd" } } }, From ae184f30789879f7820640a9d0eff73f4480d984 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 13 Nov 2024 17:13:16 +0100 Subject: [PATCH 11/90] replace missing repo with a fork --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 567c1487..c66df1b4 100644 --- a/composer.json +++ b/composer.json @@ -91,9 +91,9 @@ "name": "nexmo/api-specification", "version": "1.0.0", "source": { - "url": "https://github.com/Nexmo/api-specification", + "url": "https://github.com/cebe/nexmo-api-specification", "type": "git", - "reference": "voice-2.0.0" + "reference": "590fadf21f528ed8e05f6ff47c2e49d81f50a181" } } } From 11e829729f76afb96c0a263fb72c004703642c64 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Mon, 5 Feb 2024 09:56:45 -0500 Subject: [PATCH 12/90] Allow Symfony 7 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c66df1b4..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "require": { "php": ">=7.1.0", "ext-json": "*", - "symfony/yaml": "^3.4 || ^4 || ^5 || ^6", + "symfony/yaml": "^3.4 || ^4 || ^5 || ^6 || ^7.0", "justinrainbow/json-schema": "^5.2" }, "require-dev": { From a26aa37192ea70db57bd4941ebbaba444d255bae Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 13 Nov 2024 17:18:56 +0100 Subject: [PATCH 13/90] run tests with symfony 7 --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 607c866e..85cc0eda 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -23,7 +23,7 @@ jobs: dependencies: - "lowest" - "highest" - symfony-yaml: ['^3.4', '^4', '^5', '^6'] + symfony-yaml: ['^3.4', '^4', '^5', '^6', '^7'] include: - os: "windows-latest" php: "8.0" From 3bbcdb99eeabccc8253a1c52e9da177ba8fb9859 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 13 Nov 2024 17:31:52 +0100 Subject: [PATCH 14/90] remove very old systems from test matrix --- .github/workflows/php.yml | 40 ++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 85cc0eda..de4bd6d7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,16 +14,19 @@ jobs: matrix: os: [ubuntu-latest] php: - - "7.1" - - "7.2" - - "7.3" + #- "7.1" + #- "7.2" + #- "7.3" - "7.4" - "8.0" - "8.1" + - "8.2" + - "8.3" dependencies: - "lowest" - "highest" - symfony-yaml: ['^3.4', '^4', '^5', '^6', '^7'] + #symfony-yaml: ['^3.4', '^4', '^5', '^6', '^7'] + symfony-yaml: ['^5', '^6', '^7'] include: - os: "windows-latest" php: "8.0" @@ -35,22 +38,29 @@ jobs: symfony-yaml: '^5' exclude: # symfony/yaml v5 does not run on PHP 7.1 - - php: '7.1' - symfony-yaml: '^5' + #- php: '7.1' + # symfony-yaml: '^5' # symfony/yaml v6 does not run on PHP 7.* - - php: '7.1' - symfony-yaml: '^6' - - php: '7.2' - symfony-yaml: '^6' - - php: '7.3' - symfony-yaml: '^6' + #- php: '7.1' + # symfony-yaml: '^6' + #- php: '7.2' + # symfony-yaml: '^6' + #- php: '7.3' + # symfony-yaml: '^6' - php: '7.4' symfony-yaml: '^6' - # symfony/yaml v3.4 is not compatible with PHP 8.0 but has no upper-bound, so it installs on it + # symfony/yaml v7 does not run on PHP <8.2 + - php: '7.4' + symfony-yaml: '^7' - php: '8.0' - symfony-yaml: '^3.4' + symfony-yaml: '^7' - php: '8.1' - symfony-yaml: '^3.4' + symfony-yaml: '^7' + # symfony/yaml v3.4 is not compatible with PHP 8.0 but has no upper-bound, so it installs on it + #- php: '8.0' + # symfony-yaml: '^3.4' + #- php: '8.1' + # symfony-yaml: '^3.4' runs-on: ${{ matrix.os }} From 2ebe61852ed729d1bb632b8591f516c6bb7416f5 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 14 Nov 2024 21:58:08 +0100 Subject: [PATCH 15/90] use newer phpunit version on php 8.2 and 8.3 --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index de4bd6d7..add9b3d7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -79,7 +79,7 @@ jobs: - name: Require newer phpunit/phpunit version run: "composer require phpunit/phpunit '^9.5' --dev --no-interaction --ansi --no-install" - if: matrix.php == '8.1' + if: matrix.php == '8.1' || matrix.php == '8.2' || matrix.php == '8.3' - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v2" From f47247a204cadde298ec7e0b821ab3349d724199 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 14 Nov 2024 22:54:20 +0100 Subject: [PATCH 16/90] fix make install target composer.lock and yarn.lock are not in git so make can not require them fixes #207 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ee99b2ac..acfca9e2 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ fix-style: php-cs-fixer.phar $(DOCKER_PHP) vendor/bin/indent --spaces .php_cs.dist $(DOCKER_PHP) ./php-cs-fixer.phar fix src/ --diff -install: composer.lock yarn.lock +install: $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install From 1779bccde8b124e911e9a91f29c679dce0809ba2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:06:49 +0000 Subject: [PATCH 17/90] Bump express from 4.18.2 to 4.21.1 Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.21.1. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.2...4.21.1) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 242 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 155 insertions(+), 87 deletions(-) diff --git a/yarn.lock b/yarn.lock index 259f5870..2a4c5d53 100644 --- a/yarn.lock +++ b/yarn.lock @@ -122,21 +122,21 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== +body-parser@1.20.3: + version "1.20.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" + integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== dependencies: bytes "3.1.2" - content-type "~1.0.4" + content-type "~1.0.5" debug "2.6.9" depd "2.0.0" destroy "1.2.0" http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.1" + qs "6.13.0" + raw-body "2.5.2" type-is "~1.6.18" unpipe "1.0.0" @@ -145,13 +145,16 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -call-bind@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== +call-bind@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" + es-define-property "^1.0.0" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + set-function-length "^1.2.1" call-me-maybe@^1.0.1: version "1.0.1" @@ -270,15 +273,20 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" + integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== core-js@^3.2.1: version "3.21.0" @@ -313,6 +321,15 @@ decko@^1.2.0: resolved "https://registry.yarnpkg.com/decko/-/decko-1.2.0.tgz#fd43c735e967b8013306884a56fbe665996b6817" integrity sha1-/UPHNelnuAEzBohKVvvmZZlraBc= +define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -358,6 +375,11 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== +encodeurl@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== + end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -365,6 +387,18 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== + dependencies: + get-intrinsic "^1.2.4" + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + es6-promise@^3.2.1: version "3.3.1" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" @@ -414,36 +448,36 @@ execa@^1.0.0: strip-eof "^1.0.0" express@^4.14.0: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + version "4.21.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.21.1.tgz#9dae5dda832f16b4eec941a4e44aa89ec481b281" + integrity sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.1" + body-parser "1.20.3" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.7.1" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "1.2.0" + finalhandler "1.3.1" fresh "0.5.2" http-errors "2.0.0" - merge-descriptors "1.0.1" + merge-descriptors "1.0.3" methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.7" + path-to-regexp "0.1.10" proxy-addr "~2.0.7" - qs "6.11.0" + qs "6.13.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" + send "0.19.0" + serve-static "1.16.2" setprototypeof "1.2.0" statuses "2.0.1" type-is "~1.6.18" @@ -470,13 +504,13 @@ fast-safe-stringify@^2.0.7: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== +finalhandler@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" + integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ== dependencies: debug "2.6.9" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" on-finished "2.4.1" parseurl "~1.3.3" @@ -510,10 +544,10 @@ fresh@0.5.2: resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== get-caller-file@^1.0.1: version "1.0.3" @@ -525,14 +559,16 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" - integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== +get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== dependencies: - function-bind "^1.1.1" - has "^1.0.3" + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" has-symbols "^1.0.3" + hasown "^2.0.0" get-stream@^4.0.0: version "4.1.0" @@ -549,6 +585,13 @@ global@^4.3.0: min-document "^2.19.0" process "^0.11.10" +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + grapheme-splitter@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" @@ -559,17 +602,29 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-proto@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== + has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +hasown@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0: version "3.3.2" @@ -798,10 +853,10 @@ memoize-one@^5.0.0: resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e" integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q== -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== +merge-descriptors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== methods@~1.1.2: version "1.1.2" @@ -973,10 +1028,10 @@ object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-inspect@^1.9.0: - version "1.12.2" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" - integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== +object-inspect@^1.13.1: + version "1.13.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" + integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== on-finished@2.4.1: version "2.4.1" @@ -1071,10 +1126,10 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== +path-to-regexp@0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" + integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== perfect-scrollbar@^1.4.0: version "1.5.5" @@ -1123,22 +1178,22 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== +qs@6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" + integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== dependencies: - side-channel "^1.0.4" + side-channel "^1.0.6" range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" http-errors "2.0.0" @@ -1253,10 +1308,10 @@ semver@^5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== +send@0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" + integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw== dependencies: debug "2.6.9" depd "2.0.0" @@ -1272,21 +1327,33 @@ send@0.18.0: range-parser "~1.2.1" statuses "2.0.1" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== +serve-static@1.16.2: + version "1.16.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" + integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== dependencies: - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.18.0" + send "0.19.0" set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= +set-function-length@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + setprototypeof@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" @@ -1353,14 +1420,15 @@ should@^13.2.1: should-type-adaptors "^1.0.1" should-util "^1.0.0" -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== +side-channel@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" signal-exit@^3.0.0: version "3.0.7" From ac8f05429f1e1bcbd9c4862d912f6c2afa99ab66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:14:10 +0000 Subject: [PATCH 18/90] Bump semver from 5.7.1 to 5.7.2 Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2a4c5d53..76dbce43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1304,9 +1304,9 @@ secure-keys@^1.0.0: integrity sha1-8MgtmKOxOah3aogIBQuCRDEIf8o= semver@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== send@0.19.0: version "0.19.0" From 7c474d9194ba128c94f47941683372cca5ea7bb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:23:35 +0000 Subject: [PATCH 19/90] Bump cross-spawn from 6.0.5 to 6.0.6 Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 6.0.5 to 6.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/v6.0.6/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v6.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 76dbce43..24b21b75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -294,9 +294,9 @@ core-js@^3.2.1: integrity sha512-YUdI3fFu4TF/2WykQ2xzSiTQdldLB4KVuL9WeAy5XONZYt5Cun/fpQvctoKbCgvPhmzADeesTk/j2Rdx77AcKQ== cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + version "6.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.6.tgz#30d0efa0712ddb7eb5a76e1e8721bffafa6b5d57" + integrity sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw== dependencies: nice-try "^1.0.4" path-key "^2.0.1" From f7de432cb84e8b3fee640afa2ba8a2e8df32b8db Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 19 Dec 2024 15:42:19 +0530 Subject: [PATCH 20/90] TODO: undo this commit at the end --- composer.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/composer.json b/composer.json index a3054a52..edabaf1e 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,6 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", - "apis-guru/openapi-directory": "1.0.0", - "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From 1c014811afa9655043a67e786842dd15d8f28d14 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 19 Dec 2024 18:37:33 +0530 Subject: [PATCH 21/90] Add test --- tests/IssueTest.php | 13 +++++++++++++ tests/data/issue/175/401.json | 20 ++++++++++++++++++++ tests/data/issue/175/spec.json | 20 ++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 tests/IssueTest.php create mode 100644 tests/data/issue/175/401.json create mode 100644 tests/data/issue/175/spec.json diff --git a/tests/IssueTest.php b/tests/IssueTest.php new file mode 100644 index 00000000..a350d5b7 --- /dev/null +++ b/tests/IssueTest.php @@ -0,0 +1,13 @@ +assertInstanceOf(\cebe\openapi\SpecObjectInterface::class, $openapi); + } +} diff --git a/tests/data/issue/175/401.json b/tests/data/issue/175/401.json new file mode 100644 index 00000000..eb4f5c9b --- /dev/null +++ b/tests/data/issue/175/401.json @@ -0,0 +1,20 @@ +{ + "description": "401 response", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + }, + "example": { + "message": "Unauthenticated." + } + } + } +} diff --git a/tests/data/issue/175/spec.json b/tests/data/issue/175/spec.json new file mode 100644 index 00000000..5cea0466 --- /dev/null +++ b/tests/data/issue/175/spec.json @@ -0,0 +1,20 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "My API", + "version": "1, 2" + }, + "paths": { + "/v1/users/profile": { + "get": { + "operationId": "V1GetUserProfile", + "summary": "Returns the user profile", + "responses": { + "401": { + "$ref": "./401.json" + } + } + } + } + } +} From cb65235357707060c7d28cba4ed4f3a8827706c7 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 23 Jan 2025 16:12:26 +0530 Subject: [PATCH 22/90] Create PR --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ea32da82..a077b532 100644 --- a/README.md +++ b/README.md @@ -298,3 +298,4 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). + From f990543b62ac0b78a7a5c6c4b91e3c92bbd41f4e Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 24 Jan 2025 19:27:11 +0530 Subject: [PATCH 23/90] Add docs --- README.md | 35 ++++++++++++++++++++++++++++++++++- composer.json | 2 -- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a077b532..d7cd0715 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,40 @@ foreach($openapi->paths as $path => $definition) { Object properties are exactly like in the [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#openapi-specification). You may also access additional properties added by [specification extensions](https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#specificationExtensions). +Read a component schema and its properties for below spec: + +```yaml +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 +paths: + /foo: + put: + description: create foo + responses: + '200': + description: request succeeded +components: + schemas: + Foo: + description: This is an description + type: object + properties: + message: + type: string + code: + type: number +``` + +```php +# read a component schema +$foo = $openapi->components->schemas['Foo']; + +# read a property of schema +$foo->properties['message'] +``` + ### Writing API Description Files ```php @@ -298,4 +332,3 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). - diff --git a/composer.json b/composer.json index a3054a52..edabaf1e 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,6 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", - "apis-guru/openapi-directory": "1.0.0", - "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From 6788b09af61ff81f19a005426ee151ad3e3bf8de Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 24 Jan 2025 19:28:08 +0530 Subject: [PATCH 24/90] Add back removed dependencies --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index edabaf1e..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,8 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", + "apis-guru/openapi-directory": "1.0.0", + "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From e33b4103be89baab7a69585758361e8e0e8f3297 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 5 Feb 2025 19:42:29 +0530 Subject: [PATCH 25/90] Create PR --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ea32da82..a077b532 100644 --- a/README.md +++ b/README.md @@ -298,3 +298,4 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). + From e5751c286c8a884ee55ec117ff6e6874f6ccbfa2 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 7 Feb 2025 14:51:43 +0530 Subject: [PATCH 26/90] Implementation in progress --- Makefile | 6 ++++++ README.md | 1 - src/spec/OpenApi.php | 3 +-- src/spec/Operation.php | 2 +- tests/WriterTest.php | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index acfca9e2..0d7ca4cf 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,12 @@ fix-style: php-cs-fixer.phar $(DOCKER_PHP) vendor/bin/indent --spaces .php_cs.dist $(DOCKER_PHP) ./php-cs-fixer.phar fix src/ --diff +cli: + docker-compose run --rm php bash + +#cli_root: +# docker-compose exec --user="root" php bash + install: $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install diff --git a/README.md b/README.md index a077b532..ea32da82 100644 --- a/README.md +++ b/README.md @@ -298,4 +298,3 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). - diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index 29d38b38..4f62be28 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -7,7 +7,6 @@ namespace cebe\openapi\spec; -use cebe\openapi\exceptions\TypeErrorException; use cebe\openapi\SpecBaseObject; /** @@ -38,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [SecurityRequirement::class], + 'security' => [Type::STRING, SecurityRequirement::class], 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index b0525327..f306a571 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [SecurityRequirement::class], + 'security' => [Type::STRING, SecurityRequirement::class], 'servers' => [Server::class], ]; } diff --git a/tests/WriterTest.php b/tests/WriterTest.php index fc415b51..30c1fd82 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -1,6 +1,11 @@ new Components([ + 'securitySchemes' => [ + 'BearerAuth' => new SecurityScheme([ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ]) + ], + ]), + 'paths' => [ + '/test' => new PathItem([ + 'get' => new Operation([ + 'security' => [ + 'BearerAuth' => new SecurityRequirement([]) + ], + ]) + ]) + ] + ]); + + $result = json_decode(json_encode($openapi->getSerializableData()), true); + $this->assertTrue($result); + } } From 2f65031383982d09994375d49f7e7d9eb2b09c49 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 7 Feb 2025 16:52:18 +0530 Subject: [PATCH 27/90] In progress... --- composer.json | 2 -- src/Writer.php | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a3054a52..edabaf1e 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,6 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", - "apis-guru/openapi-directory": "1.0.0", - "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { diff --git a/src/Writer.php b/src/Writer.php index faa08f46..f598ffca 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -36,6 +36,7 @@ public static function writeToJson(SpecObjectInterface $object, int $flags = JSO public static function writeToYaml(SpecObjectInterface $object): string { return Yaml::dump($object->getSerializableData(), 256, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); +// return Yaml::dump(json_decode(json_encode($object->getSerializableData()), true), 256, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); } /** From 993f1f0707d5036cfa0d70a21218086840b4d02a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 7 Feb 2025 16:53:47 +0530 Subject: [PATCH 28/90] Add back removed packages --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index edabaf1e..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,8 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", + "apis-guru/openapi-directory": "1.0.0", + "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From 0c532a756b6080ab51c8a27e6b738879090047f6 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Tue, 11 Feb 2025 14:53:30 +0530 Subject: [PATCH 29/90] Remove comments --- src/Writer.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Writer.php b/src/Writer.php index f598ffca..faa08f46 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -36,7 +36,6 @@ public static function writeToJson(SpecObjectInterface $object, int $flags = JSO public static function writeToYaml(SpecObjectInterface $object): string { return Yaml::dump($object->getSerializableData(), 256, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); -// return Yaml::dump(json_decode(json_encode($object->getSerializableData()), true), 256, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); } /** From 2876e4af6e5ae2d5943c320bc46f8cc450dccced Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Tue, 11 Feb 2025 15:06:06 +0530 Subject: [PATCH 30/90] Finish the test --- tests/WriterTest.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 30c1fd82..7e083404 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -195,7 +195,7 @@ public function testWriteEmptySecurityPartYaml() public function testSecurity() { - $openapi = new OpenApi([ + $openapi = $this->createOpenAPI([ 'components' => new Components([ 'securitySchemes' => [ 'BearerAuth' => new SecurityScheme([ @@ -216,7 +216,29 @@ public function testSecurity() ] ]); - $result = json_decode(json_encode($openapi->getSerializableData()), true); - $this->assertTrue($result); + $yaml = \cebe\openapi\Writer::writeToYaml($openapi); + + + $this->assertEquals(preg_replace('~\R~', "\n", << Date: Tue, 11 Feb 2025 16:08:57 +0530 Subject: [PATCH 31/90] Changes --- src/spec/OpenApi.php | 2 +- src/spec/Operation.php | 2 +- tests/WriterTest.php | 57 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 56 insertions(+), 5 deletions(-) diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index 4f62be28..d22cd579 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [Type::STRING, SecurityRequirement::class], + 'security' => [SecurityRequirement::class], 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index f306a571..b0525327 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [Type::STRING, SecurityRequirement::class], + 'security' => [SecurityRequirement::class], 'servers' => [Server::class], ]; } diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 7e083404..b678cd2d 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -4,6 +4,8 @@ use cebe\openapi\spec\OpenApi; use cebe\openapi\spec\Operation; use cebe\openapi\spec\PathItem; +use cebe\openapi\spec\Response; +use cebe\openapi\spec\Responses; use cebe\openapi\spec\SecurityRequirement; use cebe\openapi\spec\SecurityScheme; @@ -193,7 +195,7 @@ public function testWriteEmptySecurityPartYaml() ); } - public function testSecurity() + public function testSecurityAtPathOperationLevel() { $openapi = $this->createOpenAPI([ 'components' => new Components([ @@ -209,8 +211,11 @@ public function testSecurity() '/test' => new PathItem([ 'get' => new Operation([ 'security' => [ - 'BearerAuth' => new SecurityRequirement([]) + new SecurityRequirement(['BearerAuth' => []]) ], + 'responses' => new Responses([ + 200 => new Response(['description' => 'OK']), + ]) ]) ]) ] @@ -227,8 +232,12 @@ public function testSecurity() paths: /test: get: + responses: + '200': + description: OK security: - BearerAuth: { } + - + BearerAuth: [] components: securitySchemes: BearerAuth: @@ -236,6 +245,48 @@ public function testSecurity() scheme: bearer bearerFormat: 'AuthToken and JWT Format' +YAML + ), + $yaml + ); + } + + public function testSecurityAtGlobalLevel() + { + $openapi = $this->createOpenAPI([ + 'components' => new Components([ + 'securitySchemes' => [ + 'BearerAuth' => new SecurityScheme([ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ]) + ], + ]), + 'security' => [ + 'BearerAuth' => new SecurityRequirement([]) + ], + 'paths' => [], + ]); + + $yaml = \cebe\openapi\Writer::writeToYaml($openapi); + + + $this->assertEquals(preg_replace('~\R~', "\n", << Date: Wed, 12 Feb 2025 10:45:33 +0530 Subject: [PATCH 32/90] Add `SecurityRequirements` class and more --- src/spec/OpenApi.php | 2 +- src/spec/Operation.php | 2 +- src/spec/SecurityRequirements.php | 37 +++++++++++++ tests/WriterTest.php | 89 ++++++++++++++++--------------- 4 files changed, 84 insertions(+), 46 deletions(-) create mode 100644 src/spec/SecurityRequirements.php diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index d22cd579..34af5587 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [SecurityRequirement::class], + 'security' => [SecurityRequirements::class], 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index b0525327..d5a33d43 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [SecurityRequirement::class], + 'security' => [SecurityRequirements::class], 'servers' => [Server::class], ]; } diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php new file mode 100644 index 00000000..b234675a --- /dev/null +++ b/src/spec/SecurityRequirements.php @@ -0,0 +1,37 @@ + and contributors + * @license https://github.com/cebe/php-openapi/blob/master/LICENSE + */ + +namespace cebe\openapi\spec; + +use cebe\openapi\SpecBaseObject; + +/** + * Lists the required security schemes to execute this operation. + * + * @link https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#securityRequirementObject + * TODO docs + */ +class SecurityRequirements extends SpecBaseObject +{ + /** + * @return array array of attributes available in this object. + */ + protected function attributes(): array + { + // this object does not have a fixed set of attribute names + return [Type::STRING, SecurityRequirement::class]; + } + + /** + * Perform validation on this object, check data against OpenAPI Specification rules. + * + * Call `addError()` in case of validation errors. + */ + protected function performValidation() + { + } +} diff --git a/tests/WriterTest.php b/tests/WriterTest.php index b678cd2d..51f602ad 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -7,6 +7,7 @@ use cebe\openapi\spec\Response; use cebe\openapi\spec\Responses; use cebe\openapi\spec\SecurityRequirement; +use cebe\openapi\spec\SecurityRequirements; use cebe\openapi\spec\SecurityScheme; class WriterTest extends \PHPUnit\Framework\TestCase @@ -210,9 +211,9 @@ public function testSecurityAtPathOperationLevel() 'paths' => [ '/test' => new PathItem([ 'get' => new Operation([ - 'security' => [ - new SecurityRequirement(['BearerAuth' => []]) - ], + 'security' => new SecurityRequirements([ + 'BearerAuth' => new SecurityRequirement([]) + ]), 'responses' => new Responses([ 200 => new Response(['description' => 'OK']), ]) @@ -251,45 +252,45 @@ public function testSecurityAtPathOperationLevel() ); } - public function testSecurityAtGlobalLevel() - { - $openapi = $this->createOpenAPI([ - 'components' => new Components([ - 'securitySchemes' => [ - 'BearerAuth' => new SecurityScheme([ - 'type' => 'http', - 'scheme' => 'bearer', - 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes - ]) - ], - ]), - 'security' => [ - 'BearerAuth' => new SecurityRequirement([]) - ], - 'paths' => [], - ]); - - $yaml = \cebe\openapi\Writer::writeToYaml($openapi); - - - $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI([ +// 'components' => new Components([ +// 'securitySchemes' => [ +// 'BearerAuth' => new SecurityScheme([ +// 'type' => 'http', +// 'scheme' => 'bearer', +// 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes +// ]) +// ], +// ]), +// 'security' => [ +// 'BearerAuth' => new SecurityRequirement([]) +// ], +// 'paths' => [], +// ]); +// +// $yaml = \cebe\openapi\Writer::writeToYaml($openapi); +// +// +// $this->assertEquals(preg_replace('~\R~', "\n", << Date: Wed, 12 Feb 2025 12:05:53 +0530 Subject: [PATCH 33/90] In Progress --- src/spec/Operation.php | 2 +- src/spec/SecurityRequirements.php | 5 ++++- tests/WriterTest.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/spec/Operation.php b/src/spec/Operation.php index d5a33d43..8becca10 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [SecurityRequirements::class], + 'security' => SecurityRequirements::class, 'servers' => [Server::class], ]; } diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index b234675a..718f20d0 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -22,8 +22,11 @@ class SecurityRequirements extends SpecBaseObject */ protected function attributes(): array { +// (Type::STRING => Type::ANY)[] + // this object does not have a fixed set of attribute names - return [Type::STRING, SecurityRequirement::class]; + return []; +// return [Type::STRING, SecurityRequirement::class]; } /** diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 51f602ad..a39e49f4 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -212,7 +212,7 @@ public function testSecurityAtPathOperationLevel() '/test' => new PathItem([ 'get' => new Operation([ 'security' => new SecurityRequirements([ - 'BearerAuth' => new SecurityRequirement([]) + 'BearerAuth' => new SecurityRequirement([]), ]), 'responses' => new Responses([ 200 => new Response(['description' => 'OK']), From 6fd4971e3e793e0e4b1908209a7f2542693cd76d Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 12 Feb 2025 12:07:26 +0530 Subject: [PATCH 34/90] Apply same changes to other file --- src/spec/OpenApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index 34af5587..4a8aa243 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [SecurityRequirements::class], + 'security' => SecurityRequirements::class, 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; From 1e71fd564f9a5e4ed05c56e303f3fda478dffb61 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Thu, 27 Feb 2025 07:00:41 -0500 Subject: [PATCH 35/90] allow jsonrainbow / json-schema version 6 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a3054a52..b09398d4 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "php": ">=7.1.0", "ext-json": "*", "symfony/yaml": "^3.4 || ^4 || ^5 || ^6 || ^7.0", - "justinrainbow/json-schema": "^5.2" + "justinrainbow/json-schema": "^5.2 || ^6.0" }, "require-dev": { "cebe/indent": "*", From 72292fa4e47a8c0b72cf1326cf146b4884b86064 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 12 Mar 2025 18:31:42 +0530 Subject: [PATCH 36/90] Support for https://github.com/php-openapi/yii2-openapi/issues/81 --- src/RawSpecDataInterface.php | 16 ++++++++++++++++ src/SpecBaseObject.php | 9 ++++++++- src/spec/Reference.php | 19 +++++++++++++++---- 3 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 src/RawSpecDataInterface.php diff --git a/src/RawSpecDataInterface.php b/src/RawSpecDataInterface.php new file mode 100644 index 00000000..3fecc1f0 --- /dev/null +++ b/src/RawSpecDataInterface.php @@ -0,0 +1,16 @@ + and contributors + * @license https://github.com/cebe/php-openapi/blob/master/LICENSE + */ + +namespace cebe\openapi; + +/** + * Make raw spec data available to the implementing classes + */ +interface RawSpecDataInterface +{ + public function getRawSpecData(): array; +} diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index 1de429bd..ef93401e 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -20,8 +20,9 @@ * Implements property management and validation basics. * */ -abstract class SpecBaseObject implements SpecObjectInterface, DocumentContextInterface +abstract class SpecBaseObject implements SpecObjectInterface, DocumentContextInterface, RawSpecDataInterface { + private $_rawSpec; private $_properties = []; private $_errors = []; @@ -63,6 +64,7 @@ abstract protected function performValidation(); */ public function __construct(array $data) { + $this->_rawSpec = $data; foreach ($this->attributes() as $property => $type) { if (!isset($data[$property])) { continue; @@ -525,4 +527,9 @@ public function getExtensions(): array } return $extensions; } + + public function getRawSpecData(): array + { + return $this->_rawSpec; + } } diff --git a/src/spec/Reference.php b/src/spec/Reference.php index cda612a9..f9b84d67 100644 --- a/src/spec/Reference.php +++ b/src/spec/Reference.php @@ -8,16 +8,15 @@ namespace cebe\openapi\spec; use cebe\openapi\DocumentContextInterface; -use cebe\openapi\exceptions\IOException; use cebe\openapi\exceptions\TypeErrorException; use cebe\openapi\exceptions\UnresolvableReferenceException; use cebe\openapi\json\InvalidJsonPointerSyntaxException; use cebe\openapi\json\JsonPointer; use cebe\openapi\json\JsonReference; use cebe\openapi\json\NonexistentJsonPointerReferenceException; +use cebe\openapi\RawSpecDataInterface; use cebe\openapi\ReferenceContext; use cebe\openapi\SpecObjectInterface; -use Symfony\Component\Yaml\Yaml; /** * Reference Object @@ -27,8 +26,14 @@ * @link https://tools.ietf.org/html/rfc6901 * */ -class Reference implements SpecObjectInterface, DocumentContextInterface +class Reference implements SpecObjectInterface, DocumentContextInterface, RawSpecDataInterface { + /** + * Holds raw spec data + * @var array + */ + private $_rawSpec; + /** * @var string */ @@ -61,11 +66,12 @@ class Reference implements SpecObjectInterface, DocumentContextInterface /** * Create an object from spec data. * @param array $data spec data read from YAML or JSON - * @param string $to class name of the type referenced by this Reference + * @param string|null $to class name of the type referenced by this Reference * @throws TypeErrorException in case invalid data is supplied. */ public function __construct(array $data, string $to = null) { + $this->_rawSpec = $data; if (!isset($data['$ref'])) { throw new TypeErrorException( "Unable to instantiate Reference Object with data '" . print_r($data, true) . "'." @@ -402,4 +408,9 @@ public function getDocumentPosition(): ?JsonPointer { return $this->_jsonPointer; } + + public function getRawSpecData(): array + { + return $this->_rawSpec; + } } From 69e48918c1fd0549cbf4f92065ba2efd9621b010 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 13 Mar 2025 15:18:10 +0530 Subject: [PATCH 37/90] Add tests --- tests/ReaderTest.php | 108 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/tests/ReaderTest.php b/tests/ReaderTest.php index 589b7cbb..eee95951 100644 --- a/tests/ReaderTest.php +++ b/tests/ReaderTest.php @@ -128,6 +128,114 @@ public function testSymfonyYamlBugHunt() $this->assertEquals($expectedArray, $inlineYamlExample); } + public function testGetRawSpecData() + { + $spec = <<assertSame($openapi->getRawSpecData(), [ + 'openapi' => '3.0.0', + 'info' => [ + 'version' => '1.0.0', + 'title' => 'Check storage of raw spec data', + ], + 'paths' => [ + '/' => [ + 'get' => [ + 'summary' => 'List', + 'operationId' => 'list', + 'responses' => [ + '200' => [ + 'description' => 'The information', + ] + ] + ] + ] + ], + 'components' => [ + 'schemas' => [ + 'User' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'type' => 'integer', + ], + 'name' => [ + 'type' => 'string', + ] + ] + ], + 'Post' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'type' => 'integer', + ], + 'title' => [ + 'type' => 'string', + ], + 'user' => [ + '$ref' => '#/components/schemas/User', + ] + ] + ] + ] + ] + ]); + + $this->assertSame($openapi->components->schemas['User']->getRawSpecData(), [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'type' => 'integer', + ], + 'name' => [ + 'type' => 'string', + ] + ] + ]); + + $this->assertSame($openapi->components->schemas['Post']->properties['user']->getRawSpecData(), [ + '$ref' => '#/components/schemas/User', + ]); + + } + // TODO test invalid JSON // TODO test invalid YAML From b7c0a6d3011a65bfa42ab142206b83089023c484 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 14 Mar 2025 15:51:00 +0530 Subject: [PATCH 38/90] Revert changes --- src/spec/OpenApi.php | 2 +- src/spec/Operation.php | 2 +- tests/WriterTest.php | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index 4a8aa243..d22cd579 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => SecurityRequirements::class, + 'security' => [SecurityRequirement::class], 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index 8becca10..b0525327 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => SecurityRequirements::class, + 'security' => [SecurityRequirement::class], 'servers' => [Server::class], ]; } diff --git a/tests/WriterTest.php b/tests/WriterTest.php index a39e49f4..99f28da5 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -211,9 +211,7 @@ public function testSecurityAtPathOperationLevel() 'paths' => [ '/test' => new PathItem([ 'get' => new Operation([ - 'security' => new SecurityRequirements([ - 'BearerAuth' => new SecurityRequirement([]), - ]), + 'security' => [new SecurityRequirement(['BearerAuth' => []])], 'responses' => new Responses([ 200 => new Response(['description' => 'OK']), ]) From 29f5bbbcde2382dbbd5012151cd1ee94bc1653ba Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 14 Mar 2025 17:07:56 +0530 Subject: [PATCH 39/90] Change design of SecurityScheme --- src/spec/SecurityScheme.php | 9 ++++++++ src/spec/SecuritySchemes.php | 44 ++++++++++++++++++++++++++++++++++++ tests/WriterTest.php | 17 +++++++------- 3 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 src/spec/SecuritySchemes.php diff --git a/src/spec/SecurityScheme.php b/src/spec/SecurityScheme.php index 2962f743..eb52ad86 100644 --- a/src/spec/SecurityScheme.php +++ b/src/spec/SecurityScheme.php @@ -25,6 +25,8 @@ */ class SecurityScheme extends SpecBaseObject { + public $name; + public $scheme; private $knownTypes = [ "apiKey", "http", @@ -32,6 +34,13 @@ class SecurityScheme extends SpecBaseObject "openIdConnect" ]; + public function __construct(array $data) + { + parent::__construct($data); + $this->name = array_keys($data)[0]; + $this->scheme = array_values($data)[0]; + } + /** * @return array array of attributes available in this object. */ diff --git a/src/spec/SecuritySchemes.php b/src/spec/SecuritySchemes.php new file mode 100644 index 00000000..28c7fbf2 --- /dev/null +++ b/src/spec/SecuritySchemes.php @@ -0,0 +1,44 @@ + and contributors + * @license https://github.com/cebe/php-openapi/blob/master/LICENSE + */ + +namespace cebe\openapi\spec; + +use cebe\openapi\SpecBaseObject; + +class SecuritySchemes extends SpecBaseObject +{ + private $_securitySchemes = []; + + public function __construct(array $data) + { + parent::__construct($data); + $this->_securitySchemes = $data; + } + + protected function attributes(): array + { + return []; + } + + public function performValidation() + { + } + + /** + * @return mixed returns the serializable data of this object for converting it + * to JSON or YAML. + */ + public function getSerializableData() + { + $data = []; + foreach ($this->_securitySchemes as $securityScheme) { + /** @var $securityScheme SecurityScheme */ + $data[$securityScheme->name] = $securityScheme->scheme; + } + return (object) $data; + } +} \ No newline at end of file diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 99f28da5..5e74d882 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -1,14 +1,13 @@ createOpenAPI([ 'components' => new Components([ - 'securitySchemes' => [ - 'BearerAuth' => new SecurityScheme([ - 'type' => 'http', - 'scheme' => 'bearer', - 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + 'securitySchemes' => new SecuritySchemes([ + new SecurityScheme([ + 'BearerAuth' => [ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ] ]) - ], + ]), ]), 'paths' => [ '/test' => new PathItem([ From b46de764dd652791d82f81af7686d3810c8b0a86 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 14 Mar 2025 18:14:13 +0530 Subject: [PATCH 40/90] Complete the implementation --- src/spec/SecurityRequirements.php | 23 +++++++++++++++++++++++ src/spec/SecuritySchemes.php | 11 ++++++----- tests/WriterTest.php | 17 +++++++++-------- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 718f20d0..a17e5227 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -17,6 +17,14 @@ */ class SecurityRequirements extends SpecBaseObject { + private $_securityRequirements; + + public function __construct(array $data) + { + parent::__construct($data); + $this->_securityRequirements = $data; + } + /** * @return array array of attributes available in this object. */ @@ -37,4 +45,19 @@ protected function attributes(): array protected function performValidation() { } + + /** + * @return mixed returns the serializable data of this object for converting it + * to JSON or YAML. + * TODO + */ + public function getSerializableData() + { + $data = []; + foreach ($this->_securityRequirements as $name => $securityRequirement) { + /** @var SecurityRequirement $securityRequirement */ + $data[] = [$name => json_decode(json_encode($securityRequirement->getSerializableData()), true)]; + } + return $data; + } } diff --git a/src/spec/SecuritySchemes.php b/src/spec/SecuritySchemes.php index 28c7fbf2..c58dd059 100644 --- a/src/spec/SecuritySchemes.php +++ b/src/spec/SecuritySchemes.php @@ -11,7 +11,7 @@ class SecuritySchemes extends SpecBaseObject { - private $_securitySchemes = []; + private $_securitySchemes; public function __construct(array $data) { @@ -31,14 +31,15 @@ public function performValidation() /** * @return mixed returns the serializable data of this object for converting it * to JSON or YAML. + * TODO */ public function getSerializableData() { $data = []; - foreach ($this->_securitySchemes as $securityScheme) { - /** @var $securityScheme SecurityScheme */ - $data[$securityScheme->name] = $securityScheme->scheme; + foreach ($this->_securitySchemes as $name => $securityScheme) { + /** @var SecurityScheme $securityScheme */ + $data[$name] = $securityScheme->getSerializableData(); } return (object) $data; } -} \ No newline at end of file +} diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 5e74d882..99793881 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -6,6 +6,7 @@ use cebe\openapi\spec\Response; use cebe\openapi\spec\Responses; use cebe\openapi\spec\SecurityRequirement; +use cebe\openapi\spec\SecurityRequirements; use cebe\openapi\spec\SecurityScheme; use cebe\openapi\spec\SecuritySchemes; @@ -200,19 +201,19 @@ public function testSecurityAtPathOperationLevel() $openapi = $this->createOpenAPI([ 'components' => new Components([ 'securitySchemes' => new SecuritySchemes([ - new SecurityScheme([ - 'BearerAuth' => [ - 'type' => 'http', - 'scheme' => 'bearer', - 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes - ] - ]) + 'BearerAuth' => new SecurityScheme([ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ]), ]), ]), 'paths' => [ '/test' => new PathItem([ 'get' => new Operation([ - 'security' => [new SecurityRequirement(['BearerAuth' => []])], + 'security' => new SecurityRequirements([ + 'BearerAuth' => new SecurityRequirement([]), + ]), 'responses' => new Responses([ 200 => new Response(['description' => 'OK']), ]) From 219813f7e2826d782e6b705347dac654719b21ba Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 14:34:06 +0530 Subject: [PATCH 41/90] Fix failing test --- Makefile | 3 --- src/spec/OpenApi.php | 2 +- src/spec/Operation.php | 2 +- src/spec/SecurityRequirement.php | 12 ++++++++++++ src/spec/SecurityRequirements.php | 27 ++++++++++++++++++++------- tests/WriterTest.php | 8 ++++++-- tests/spec/OpenApiTest.php | 2 +- tests/spec/OperationTest.php | 9 +++++---- 8 files changed, 46 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 0d7ca4cf..934a37f1 100644 --- a/Makefile +++ b/Makefile @@ -40,9 +40,6 @@ fix-style: php-cs-fixer.phar cli: docker-compose run --rm php bash -#cli_root: -# docker-compose exec --user="root" php bash - install: $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index d22cd579..4a8aa243 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [SecurityRequirement::class], + 'security' => SecurityRequirements::class, 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index b0525327..8becca10 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [SecurityRequirement::class], + 'security' => SecurityRequirements::class, 'servers' => [Server::class], ]; } diff --git a/src/spec/SecurityRequirement.php b/src/spec/SecurityRequirement.php index 71f805c8..10099cae 100644 --- a/src/spec/SecurityRequirement.php +++ b/src/spec/SecurityRequirement.php @@ -17,6 +17,13 @@ */ class SecurityRequirement extends SpecBaseObject { + private $_securityRequirement; + public function __construct(array $data) + { + parent::__construct($data); + $this->_securityRequirement = $data; + } + /** * @return array array of attributes available in this object. */ @@ -34,4 +41,9 @@ protected function attributes(): array protected function performValidation() { } + + public function getSerializableData() + { + return $this->_securityRequirement; + } } diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index a17e5227..34cb0b19 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -10,7 +10,7 @@ use cebe\openapi\SpecBaseObject; /** - * Lists the required security schemes to execute this operation. + * Lists the required security requirement to execute this operation. * * @link https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#securityRequirementObject * TODO docs @@ -22,7 +22,18 @@ class SecurityRequirements extends SpecBaseObject public function __construct(array $data) { parent::__construct($data); - $this->_securityRequirements = $data; + + $read = true; + foreach($data as $index => $value) { + if (is_numeric($index)) { // read + $requirements = $value; + $this->_securityRequirements[array_keys($value)[0]] = new SecurityRequirement(array_values($value)[0]); + } else { // write + $read = false; + $requirements = $data; + $this->_securityRequirements[$index] = $value; + } + } } /** @@ -30,11 +41,8 @@ public function __construct(array $data) */ protected function attributes(): array { -// (Type::STRING => Type::ANY)[] - // this object does not have a fixed set of attribute names return []; -// return [Type::STRING, SecurityRequirement::class]; } /** @@ -54,10 +62,15 @@ protected function performValidation() public function getSerializableData() { $data = []; - foreach ($this->_securityRequirements as $name => $securityRequirement) { + foreach ($this->_securityRequirements ?? [] as $name => $securityRequirement) { /** @var SecurityRequirement $securityRequirement */ - $data[] = [$name => json_decode(json_encode($securityRequirement->getSerializableData()), true)]; + $data[] = [$name => $securityRequirement->getSerializableData()]; } return $data; } + + public function getRequirement(string $name) + { + return $this->_securityRequirements[$name] ?? 'nul5l'; + } } diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 99793881..792ae364 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -145,7 +145,9 @@ public function testWriteEmptySecurityYaml() public function testWriteEmptySecurityPartJson() { $openapi = $this->createOpenAPI([ - 'security' => [new SecurityRequirement(['Bearer' => []])], + 'security' => new SecurityRequirements([ + 'Bearer' => new SecurityRequirement([]) + ]), ]); $json = \cebe\openapi\Writer::writeToJson($openapi); @@ -174,7 +176,9 @@ public function testWriteEmptySecurityPartJson() public function testWriteEmptySecurityPartYaml() { $openapi = $this->createOpenAPI([ - 'security' => [new SecurityRequirement(['Bearer' => []])], + 'security' => new SecurityRequirements([ + 'Bearer' => new SecurityRequirement([]) + ]), ]); $yaml = \cebe\openapi\Writer::writeToYaml($openapi); diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index 20b568ed..fce2e040 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -72,7 +72,7 @@ public function testReadPetStore() $this->assertInstanceOf(\cebe\openapi\spec\Components::class, $openapi->components); // security - $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security); + $this->assertNull($openapi->security); # since it is not present in spec // tags $this->assertAllInstanceOf(\cebe\openapi\spec\Tag::class, $openapi->tags); diff --git a/tests/spec/OperationTest.php b/tests/spec/OperationTest.php index 6e30566f..b60b95ab 100644 --- a/tests/spec/OperationTest.php +++ b/tests/spec/OperationTest.php @@ -79,10 +79,11 @@ public function testRead() $this->assertInstanceOf(\cebe\openapi\spec\Responses::class, $operation->responses); - $this->assertCount(1, $operation->security); - $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $operation->security[0]); - $this->assertCount(2, $operation->security[0]->petstore_auth); - $this->assertEquals(['write:pets', 'read:pets'], $operation->security[0]->petstore_auth); + $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $operation->security); + $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $operation->security->getRequirement('petstore_auth')); + // TODO +// $this->assertCount(2, $operation->security[0]->petstore_auth); +// $this->assertEquals(['write:pets', 'read:pets'], $operation->security[0]->petstore_auth); $this->assertInstanceOf(ExternalDocumentation::class, $operation->externalDocs); $this->assertEquals('Find more info here', $operation->externalDocs->description); From 236a47e76b11ac383dfa441898410af7245a4012 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 15:18:20 +0530 Subject: [PATCH 42/90] Cleanup and fix issue and complete the implementation --- src/spec/SecurityRequirements.php | 12 +++++++-- src/spec/SecurityScheme.php | 9 ------- src/spec/SecuritySchemes.php | 45 ------------------------------- tests/WriterTest.php | 5 ++-- tests/spec/SecuritySchemeTest.php | 6 ++--- 5 files changed, 15 insertions(+), 62 deletions(-) delete mode 100644 src/spec/SecuritySchemes.php diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 34cb0b19..3cd0dd00 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -24,7 +24,7 @@ public function __construct(array $data) parent::__construct($data); $read = true; - foreach($data as $index => $value) { + foreach ($data as $index => $value) { if (is_numeric($index)) { // read $requirements = $value; $this->_securityRequirements[array_keys($value)[0]] = new SecurityRequirement(array_values($value)[0]); @@ -34,6 +34,9 @@ public function __construct(array $data) $this->_securityRequirements[$index] = $value; } } + if ($data === []) { + $this->_securityRequirements = []; + } } /** @@ -71,6 +74,11 @@ public function getSerializableData() public function getRequirement(string $name) { - return $this->_securityRequirements[$name] ?? 'nul5l'; + return $this->_securityRequirements[$name] ?? null; + } + + public function getRequirements() + { + return $this->_securityRequirements; } } diff --git a/src/spec/SecurityScheme.php b/src/spec/SecurityScheme.php index eb52ad86..2962f743 100644 --- a/src/spec/SecurityScheme.php +++ b/src/spec/SecurityScheme.php @@ -25,8 +25,6 @@ */ class SecurityScheme extends SpecBaseObject { - public $name; - public $scheme; private $knownTypes = [ "apiKey", "http", @@ -34,13 +32,6 @@ class SecurityScheme extends SpecBaseObject "openIdConnect" ]; - public function __construct(array $data) - { - parent::__construct($data); - $this->name = array_keys($data)[0]; - $this->scheme = array_values($data)[0]; - } - /** * @return array array of attributes available in this object. */ diff --git a/src/spec/SecuritySchemes.php b/src/spec/SecuritySchemes.php deleted file mode 100644 index c58dd059..00000000 --- a/src/spec/SecuritySchemes.php +++ /dev/null @@ -1,45 +0,0 @@ - and contributors - * @license https://github.com/cebe/php-openapi/blob/master/LICENSE - */ - -namespace cebe\openapi\spec; - -use cebe\openapi\SpecBaseObject; - -class SecuritySchemes extends SpecBaseObject -{ - private $_securitySchemes; - - public function __construct(array $data) - { - parent::__construct($data); - $this->_securitySchemes = $data; - } - - protected function attributes(): array - { - return []; - } - - public function performValidation() - { - } - - /** - * @return mixed returns the serializable data of this object for converting it - * to JSON or YAML. - * TODO - */ - public function getSerializableData() - { - $data = []; - foreach ($this->_securitySchemes as $name => $securityScheme) { - /** @var SecurityScheme $securityScheme */ - $data[$name] = $securityScheme->getSerializableData(); - } - return (object) $data; - } -} diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 792ae364..5450b64f 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -8,7 +8,6 @@ use cebe\openapi\spec\SecurityRequirement; use cebe\openapi\spec\SecurityRequirements; use cebe\openapi\spec\SecurityScheme; -use cebe\openapi\spec\SecuritySchemes; class WriterTest extends \PHPUnit\Framework\TestCase { @@ -204,13 +203,13 @@ public function testSecurityAtPathOperationLevel() { $openapi = $this->createOpenAPI([ 'components' => new Components([ - 'securitySchemes' => new SecuritySchemes([ + 'securitySchemes' => [ 'BearerAuth' => new SecurityScheme([ 'type' => 'http', 'scheme' => 'bearer', 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes ]), - ]), + ], ]), 'paths' => [ '/test' => new PathItem([ diff --git a/tests/spec/SecuritySchemeTest.php b/tests/spec/SecuritySchemeTest.php index 5e14d5f7..4bbbf4d6 100644 --- a/tests/spec/SecuritySchemeTest.php +++ b/tests/spec/SecuritySchemeTest.php @@ -199,10 +199,10 @@ public function testDefaultSecurity() YAML ); - $this->assertSame([], $openapi->paths->getPath('/path/one')->post->security); + $this->assertSame([], $openapi->paths->getPath('/path/one')->post->security->getRequirements()); $this->assertSame(null, $openapi->paths->getPath('/path/two')->post->security); - $this->assertCount(1, $openapi->security); - $this->assertSame([], $openapi->security[0]->Bearer); + $this->assertCount(1, $openapi->security->getRequirements()); + $this->assertSame([], $openapi->security->getRequirement('Bearer')->getSerializableData()); } } From 55f3e1fb95c1100b73fbf78384107f9cb6a3facf Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 15:24:27 +0530 Subject: [PATCH 43/90] Complete the test --- tests/spec/OperationTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/spec/OperationTest.php b/tests/spec/OperationTest.php index b60b95ab..35fd1fdd 100644 --- a/tests/spec/OperationTest.php +++ b/tests/spec/OperationTest.php @@ -81,9 +81,8 @@ public function testRead() $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $operation->security); $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $operation->security->getRequirement('petstore_auth')); - // TODO -// $this->assertCount(2, $operation->security[0]->petstore_auth); -// $this->assertEquals(['write:pets', 'read:pets'], $operation->security[0]->petstore_auth); + $this->assertCount(2, $operation->security->getRequirement('petstore_auth')->getSerializableData()); + $this->assertEquals(['write:pets', 'read:pets'], $operation->security->getRequirement('petstore_auth')->getSerializableData()); $this->assertInstanceOf(ExternalDocumentation::class, $operation->externalDocs); $this->assertEquals('Find more info here', $operation->externalDocs->description); From 23a53774874d396aff1682edf20710392178f23a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 15:55:19 +0530 Subject: [PATCH 44/90] Covers SecurityRequirements --- tests/spec/SecuritySchemeTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/spec/SecuritySchemeTest.php b/tests/spec/SecuritySchemeTest.php index 4bbbf4d6..4dc6a2a1 100644 --- a/tests/spec/SecuritySchemeTest.php +++ b/tests/spec/SecuritySchemeTest.php @@ -11,6 +11,7 @@ * @covers \cebe\openapi\spec\OAuthFlows * @covers \cebe\openapi\spec\OAuthFlow * @covers \cebe\openapi\spec\SecurityRequirement + * @covers \cebe\openapi\spec\SecurityRequirements */ class SecuritySchemeTest extends \PHPUnit\Framework\TestCase { From 565c1830a2171ea28e7999b85632dd6b94537d47 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 16:01:05 +0530 Subject: [PATCH 45/90] Put back removed Composer Package --- Makefile | 1 - composer.json | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 934a37f1..add949a6 100644 --- a/Makefile +++ b/Makefile @@ -85,4 +85,3 @@ coverage: .php-openapi-covA .php-openapi-covB grep -rhPo '^class \w+' src/spec/ | awk '{print $$2}' |grep -v '^Type$$' | sort > $@ .PHONY: all check-style fix-style install test lint coverage - diff --git a/composer.json b/composer.json index edabaf1e..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,8 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", + "apis-guru/openapi-directory": "1.0.0", + "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From c1db3243e0193359617379f3e93438e38a34fbc5 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 16:07:49 +0530 Subject: [PATCH 46/90] Fix failing tests --- tests/spec/OpenApiTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index fce2e040..ad99e743 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -221,7 +221,8 @@ public function testSpecs($openApiFile) } // security - $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security); + $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $openapi->security); + $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security->getRequirements()); // tags $this->assertAllInstanceOf(\cebe\openapi\spec\Tag::class, $openapi->tags); From c911987755490395b0238ce256ababe947a8a7ac Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 16:12:47 +0530 Subject: [PATCH 47/90] Fix failing tests 2 --- tests/spec/OpenApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index ad99e743..26713344 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -221,7 +221,7 @@ public function testSpecs($openApiFile) } // security - $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $openapi->security); + $openapi->security !== null && $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $openapi->security); $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security->getRequirements()); // tags From 98b3ef37c5aebe306e908bd9a22bd533123519db Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 16:15:55 +0530 Subject: [PATCH 48/90] Fix failing tests 3 --- tests/spec/OpenApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index 26713344..433bd352 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -222,7 +222,7 @@ public function testSpecs($openApiFile) // security $openapi->security !== null && $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $openapi->security); - $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security->getRequirements()); + $openapi->security !== null && $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security->getRequirements()); // tags $this->assertAllInstanceOf(\cebe\openapi\spec\Tag::class, $openapi->tags); From 15ef5f67e3e6101c879318d791fca1169cd01689 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Mon, 17 Mar 2025 07:18:57 +0530 Subject: [PATCH 49/90] Add more assertions in tests and refactor --- src/spec/SecurityRequirement.php | 1 + src/spec/SecurityRequirements.php | 7 +++---- tests/WriterTest.php | 1 + tests/spec/OperationTest.php | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/spec/SecurityRequirement.php b/src/spec/SecurityRequirement.php index 10099cae..a5e0c619 100644 --- a/src/spec/SecurityRequirement.php +++ b/src/spec/SecurityRequirement.php @@ -44,6 +44,7 @@ protected function performValidation() public function getSerializableData() { + parent::getSerializableData(); return $this->_securityRequirement; } } diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 3cd0dd00..7821ff2a 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -23,14 +23,10 @@ public function __construct(array $data) { parent::__construct($data); - $read = true; foreach ($data as $index => $value) { if (is_numeric($index)) { // read - $requirements = $value; $this->_securityRequirements[array_keys($value)[0]] = new SecurityRequirement(array_values($value)[0]); } else { // write - $read = false; - $requirements = $data; $this->_securityRequirements[$index] = $value; } } @@ -55,6 +51,7 @@ protected function attributes(): array */ protected function performValidation() { + // TODO } /** @@ -64,6 +61,8 @@ protected function performValidation() */ public function getSerializableData() { + parent::getSerializableData(); + $data = []; foreach ($this->_securityRequirements ?? [] as $name => $securityRequirement) { /** @var SecurityRequirement $securityRequirement */ diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 5450b64f..57ca5d09 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -255,6 +255,7 @@ public function testSecurityAtPathOperationLevel() ); } + // TODO // public function testSecurityAtGlobalLevel() // { // $openapi = $this->createOpenAPI([ diff --git a/tests/spec/OperationTest.php b/tests/spec/OperationTest.php index 35fd1fdd..734db321 100644 --- a/tests/spec/OperationTest.php +++ b/tests/spec/OperationTest.php @@ -79,6 +79,7 @@ public function testRead() $this->assertInstanceOf(\cebe\openapi\spec\Responses::class, $operation->responses); + $this->assertCount(1, $operation->security->getRequirements()); $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $operation->security); $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $operation->security->getRequirement('petstore_auth')); $this->assertCount(2, $operation->security->getRequirement('petstore_auth')->getSerializableData()); From 19e68bfbd4828f4eefbb14c31cda5a5b0ec8e0ea Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Mon, 17 Mar 2025 07:30:34 +0530 Subject: [PATCH 50/90] Add more test --- tests/WriterTest.php | 84 ++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 57ca5d09..355a7449 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -255,46 +255,46 @@ public function testSecurityAtPathOperationLevel() ); } - // TODO -// public function testSecurityAtGlobalLevel() -// { -// $openapi = $this->createOpenAPI([ -// 'components' => new Components([ -// 'securitySchemes' => [ -// 'BearerAuth' => new SecurityScheme([ -// 'type' => 'http', -// 'scheme' => 'bearer', -// 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes -// ]) -// ], -// ]), -// 'security' => [ -// 'BearerAuth' => new SecurityRequirement([]) -// ], -// 'paths' => [], -// ]); -// -// $yaml = \cebe\openapi\Writer::writeToYaml($openapi); -// -// -// $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI([ + 'components' => new Components([ + 'securitySchemes' => [ + 'BearerAuth' => new SecurityScheme([ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ]) + ], + ]), + 'security' => new SecurityRequirements([ + 'BearerAuth' => new SecurityRequirement([]) + ]), + 'paths' => [], + ]); + + $yaml = \cebe\openapi\Writer::writeToYaml($openapi); + + + $this->assertEquals(preg_replace('~\R~', "\n", << Date: Mon, 17 Mar 2025 16:28:28 +0530 Subject: [PATCH 51/90] Resolve TODOs --- src/spec/SecurityRequirement.php | 2 +- src/spec/SecurityRequirements.php | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/spec/SecurityRequirement.php b/src/spec/SecurityRequirement.php index a5e0c619..069c7711 100644 --- a/src/spec/SecurityRequirement.php +++ b/src/spec/SecurityRequirement.php @@ -10,7 +10,7 @@ use cebe\openapi\SpecBaseObject; /** - * Lists the required security schemes to execute this operation. + * A required security scheme to execute this operation. * * @link https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#securityRequirementObject * diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 7821ff2a..3b3bbb90 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -10,10 +10,10 @@ use cebe\openapi\SpecBaseObject; /** - * Lists the required security requirement to execute this operation. + * Lists the required security schemes to execute this operation. * * @link https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#securityRequirementObject - * TODO docs + * */ class SecurityRequirements extends SpecBaseObject { @@ -51,13 +51,10 @@ protected function attributes(): array */ protected function performValidation() { - // TODO } /** - * @return mixed returns the serializable data of this object for converting it - * to JSON or YAML. - * TODO + * {@inheritDoc} */ public function getSerializableData() { From 28c1b64b7a66152289980882db0dc4806ad410a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 12:46:27 +0000 Subject: [PATCH 52/90] Bump prismjs from 1.27.0 to 1.30.0 Bumps [prismjs](https://github.com/PrismJS/prism) from 1.27.0 to 1.30.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.27.0...v1.30.0) --- updated-dependencies: - dependency-name: prismjs dependency-version: 1.30.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 24b21b75..c940d0aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1144,9 +1144,9 @@ polished@^3.0.3: "@babel/runtime" "^7.12.5" prismjs@^1.15.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057" - integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA== + version "1.30.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.30.0.tgz#d9709969d9d4e16403f6f348c63553b19f0975a9" + integrity sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw== process@^0.11.10: version "0.11.10" From 2fb30669aaf56625ac0e0d3ca5a3536c29d9f14a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 12:47:18 +0000 Subject: [PATCH 53/90] Bump @babel/runtime from 7.17.2 to 7.27.0 Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.17.2 to 7.27.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.27.0/packages/babel-runtime) --- updated-dependencies: - dependency-name: "@babel/runtime" dependency-version: 7.27.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 24b21b75..71d8fa0d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24,11 +24,11 @@ js-tokens "^4.0.0" "@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941" - integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw== + version "7.27.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.0.tgz#fbee7cf97c709518ecc1f590984481d5460d4762" + integrity sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw== dependencies: - regenerator-runtime "^0.13.4" + regenerator-runtime "^0.14.0" "@cloudflare/json-schema-walker@^0.1.1": version "0.1.1" @@ -1273,10 +1273,10 @@ reftools@^1.1.0, reftools@^1.1.9: resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.9.tgz#e16e19f662ccd4648605312c06d34e5da3a2b77e" integrity sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w== -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== require-directory@^2.1.1: version "2.1.1" From 9acecc87c5d671c0c4dba8c0a201a22c2096e2c9 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 25 Apr 2025 18:15:53 +0530 Subject: [PATCH 54/90] Failing test --- compiled.yml | 124 +++++++++++++++++++++++ tests/spec/PathTest.php | 6 +- tests/spec/data/path-params/openapi.yaml | 6 +- tests/spec/data/path-params/user.yaml | 3 +- 4 files changed, 132 insertions(+), 7 deletions(-) create mode 100644 compiled.yml diff --git a/compiled.yml b/compiled.yml new file mode 100644 index 00000000..d544b3c3 --- /dev/null +++ b/compiled.yml @@ -0,0 +1,124 @@ +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: hi there + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index e5be1bfd..1ce585ae 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -205,8 +205,8 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(Paths::class, $openapi->paths); $this->assertIsArray($openapi->paths->getPaths()); - $this->assertInstanceOf(PathItem::class, $usersPath = $openapi->paths['/v1/{organizationId}/user']); - $this->assertInstanceOf(PathItem::class, $userIdPath = $openapi->paths['/v1/{organizationId}/user/{id}']); + $this->assertInstanceOf(PathItem::class, $usersPath = $openapi->paths['/v1/organizations/{organizationId}/user']); + $this->assertInstanceOf(PathItem::class, $userIdPath = $openapi->paths['/v1/organizations/{organizationId}/user/{id}']); $result = $usersPath->validate(); $this->assertTrue($result); @@ -220,7 +220,7 @@ public function testPathParametersAreArrays() $this->assertIsArray($userIdPath->parameters); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); - $this->assertEquals($userIdPath->parameters[2]->name, 'id'); + $this->assertEquals($userIdPath->parameters[2]->name, 'id'); } } diff --git a/tests/spec/data/path-params/openapi.yaml b/tests/spec/data/path-params/openapi.yaml index 722d8184..9decce27 100644 --- a/tests/spec/data/path-params/openapi.yaml +++ b/tests/spec/data/path-params/openapi.yaml @@ -11,8 +11,8 @@ servers: - url: 'http://localhost:8000' description: 'Test' -paths: - /v1/{organizationId}/user: +paths: + /v1/organizations/{organizationId}/user: $ref: 'user.yaml#/paths/Users' - /v1/{organizationId}/user/{id}: + /v1/organizations/{organizationId}/user/{id}: $ref: 'user.yaml#/paths/UserId' \ No newline at end of file diff --git a/tests/spec/data/path-params/user.yaml b/tests/spec/data/path-params/user.yaml index a842e783..23857811 100644 --- a/tests/spec/data/path-params/user.yaml +++ b/tests/spec/data/path-params/user.yaml @@ -1,3 +1,4 @@ + paths: Users: parameters: @@ -73,4 +74,4 @@ components: schema: type: string format: uuid - description: User's ID \ No newline at end of file + description: User's ID From 2a660593cbe4b8bf650db6d648f36bdda66b86bd Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 25 Apr 2025 18:22:59 +0530 Subject: [PATCH 55/90] Remove redundant method call --- src/spec/SecurityRequirement.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/spec/SecurityRequirement.php b/src/spec/SecurityRequirement.php index 069c7711..ec3e1d90 100644 --- a/src/spec/SecurityRequirement.php +++ b/src/spec/SecurityRequirement.php @@ -44,7 +44,6 @@ protected function performValidation() public function getSerializableData() { - parent::getSerializableData(); return $this->_securityRequirement; } } From 3ab78b6b4a8ba79d79b241b620e454a6a1019b47 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 26 Apr 2025 09:44:25 +0530 Subject: [PATCH 56/90] Original compiled file --- compiled.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/compiled.yml b/compiled.yml index d544b3c3..380bd8a5 100644 --- a/compiled.yml +++ b/compiled.yml @@ -53,14 +53,16 @@ paths: - BearerAuth: [] parameters: - - name: organizationId + '1': + name: organizationId in: path description: 'The Organization ID' required: true schema: type: string format: uuid - - name: api-version + '0': + name: api-version in: header description: 'The API version' required: false @@ -73,7 +75,7 @@ paths: summary: 'Gets a user' responses: '200': - description: hi there + description: 'A bar' content: application/json: schema: @@ -97,7 +99,7 @@ paths: - BearerAuth: [] parameters: - - + '1': name: organizationId in: path description: 'The Organization ID' @@ -105,7 +107,7 @@ paths: schema: type: string format: uuid - - + '0': name: api-version in: header description: 'The API version' @@ -114,7 +116,7 @@ paths: type: string format: date example: '2021-05-18' - - + '2': name: id in: path description: 'User''s ID' From a946647b976e639690d8737679db63b3f06fa114 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Tue, 29 Apr 2025 12:38:29 +0530 Subject: [PATCH 57/90] Fix typo --- bin/php-openapi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/php-openapi b/bin/php-openapi index ae2ffdc8..aa4b0697 100755 --- a/bin/php-openapi +++ b/bin/php-openapi @@ -215,7 +215,7 @@ switch ($command) { if ($outputFile === null) { if ($outputFormat === null) { - error("No output fromat specified, please specify --write-json or --write-yaml.", "usage"); + error("No output format specified, please specify --write-json or --write-yaml.", "usage"); } elseif ($outputFormat === 'json') { fwrite(STDOUT, \cebe\openapi\Writer::writeToJson($openApi)); } else { From aa73b3d3ae8b745cf794dc8e7a2f6403b11d6b77 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Tue, 29 Apr 2025 12:39:34 +0530 Subject: [PATCH 58/90] Remove redundant method call 2 --- src/spec/SecurityRequirements.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 3b3bbb90..cbda1ba7 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -58,8 +58,6 @@ protected function performValidation() */ public function getSerializableData() { - parent::getSerializableData(); - $data = []; foreach ($this->_securityRequirements ?? [] as $name => $securityRequirement) { /** @var SecurityRequirement $securityRequirement */ From aaff77168508b3d41ef2df307da089e1ffcc9470 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 07:47:17 +0530 Subject: [PATCH 59/90] Fix this issue --- compiled.yml | 40 ++++++++++++++------------- src/SpecBaseObject.php | 4 +++ tests/spec/data/path-params/user.yaml | 2 ++ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/compiled.yml b/compiled.yml index 380bd8a5..e1774005 100644 --- a/compiled.yml +++ b/compiled.yml @@ -13,6 +13,8 @@ servers: paths: '/v1/organizations/{organizationId}/user': post: + tags: + - pets summary: 'Creates a user' requestBody: content: @@ -53,15 +55,7 @@ paths: - BearerAuth: [] parameters: - '1': - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '0': + - name: api-version in: header description: 'The API version' @@ -70,6 +64,14 @@ paths: type: string format: date example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid '/v1/organizations/{organizationId}/user/{id}': get: summary: 'Gets a user' @@ -99,15 +101,7 @@ paths: - BearerAuth: [] parameters: - '1': - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '0': + - name: api-version in: header description: 'The API version' @@ -116,7 +110,15 @@ paths: type: string format: date example: '2021-05-18' - '2': + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - name: id in: path description: 'User''s ID' diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index ef93401e..a1008ce9 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -210,6 +210,10 @@ public function getSerializableData() // case 2: Attribute type is an object (specified in attributes() by an array which specifies two items (key and value type) $toObject = true; } + if ($k === 'parameters') { + ksort($data[$k]); + $toObject = false; + } if ($toObject) { $data[$k] = (object) $data[$k]; } diff --git a/tests/spec/data/path-params/user.yaml b/tests/spec/data/path-params/user.yaml index 23857811..6f1402bd 100644 --- a/tests/spec/data/path-params/user.yaml +++ b/tests/spec/data/path-params/user.yaml @@ -6,6 +6,8 @@ paths: - $ref: 'global.yaml#/components/parameters/OrganizationId' post: summary: Creates a user + tags: + - pets security: - BearerAuth: [] requestBody: From e02cce13728aa8a9d764b069d0e94374cc554e75 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 08:18:45 +0530 Subject: [PATCH 60/90] Fix this issue in more proper way --- src/SpecBaseObject.php | 4 ---- src/spec/PathItem.php | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index a1008ce9..ef93401e 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -210,10 +210,6 @@ public function getSerializableData() // case 2: Attribute type is an object (specified in attributes() by an array which specifies two items (key and value type) $toObject = true; } - if ($k === 'parameters') { - ksort($data[$k]); - $toObject = false; - } if ($toObject) { $data[$k] = (object) $data[$k]; } diff --git a/src/spec/PathItem.php b/src/spec/PathItem.php index 4b2debcd..6930e0af 100644 --- a/src/spec/PathItem.php +++ b/src/spec/PathItem.php @@ -180,7 +180,7 @@ public function resolveReferences(ReferenceContext $context = null) foreach ($this->$attribute as $k => $item) { if ($item instanceof Reference) { $referencedObject = $item->resolve(); - $this->$attribute = [$k => $referencedObject] + $this->$attribute; + $this->$attribute = $this->$attribute + [$k => $referencedObject]; if (!$referencedObject instanceof Reference && $referencedObject !== null) { $referencedObject->resolveReferences(); } From e8b8b2e627df63ec338f46c400eb819ec6f31017 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 08:28:27 +0530 Subject: [PATCH 61/90] Fix failing test --- tests/spec/PathTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 1ce585ae..d4b54ed1 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -204,7 +204,7 @@ public function testPathParametersAreArrays() $this->assertTrue($result); $this->assertInstanceOf(Paths::class, $openapi->paths); - $this->assertIsArray($openapi->paths->getPaths()); + $this->assertSame(gettype($openapi->paths->getPaths()), 'array'); $this->assertInstanceOf(PathItem::class, $usersPath = $openapi->paths['/v1/organizations/{organizationId}/user']); $this->assertInstanceOf(PathItem::class, $userIdPath = $openapi->paths['/v1/organizations/{organizationId}/user/{id}']); @@ -213,14 +213,14 @@ public function testPathParametersAreArrays() $this->assertIsArray($usersPath->parameters); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[1]); - $this->assertEquals($usersPath->parameters[0]->name, 'api-version'); + $this->assertEquals('api-version', $usersPath->parameters[0]->name); $result = $userIdPath->validate(); $this->assertTrue($result); $this->assertIsArray($userIdPath->parameters); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); - $this->assertEquals($userIdPath->parameters[2]->name, 'id'); + $this->assertEquals('id', $userIdPath->parameters[2]->name); } } From 9dfa3e80322376bddd133da9eb7c71923fb8bde3 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 08:34:44 +0530 Subject: [PATCH 62/90] Fix failing test 2 --- tests/spec/PathTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index d4b54ed1..83b7aab5 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -210,14 +210,14 @@ public function testPathParametersAreArrays() $result = $usersPath->validate(); $this->assertTrue($result); - $this->assertIsArray($usersPath->parameters); + $this->assertSame(gettype($usersPath->parameters), 'array'); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[1]); $this->assertEquals('api-version', $usersPath->parameters[0]->name); $result = $userIdPath->validate(); $this->assertTrue($result); - $this->assertIsArray($userIdPath->parameters); + $this->assertSame(gettype($userIdPath->parameters), 'array'); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); From f0a27b743b4a47dd5c127bb0e016af5bbdd03837 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 09:03:59 +0530 Subject: [PATCH 63/90] Add more assertions --- compiled.yml => tests/data/issue/155/compiled.yml | 0 tests/spec/PathTest.php | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename compiled.yml => tests/data/issue/155/compiled.yml (100%) diff --git a/compiled.yml b/tests/data/issue/155/compiled.yml similarity index 100% rename from compiled.yml rename to tests/data/issue/155/compiled.yml diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 83b7aab5..522ff924 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -221,6 +221,7 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); - + shell_exec(dirname(__DIR__, 2) . '/bin/php-openapi inline ' . $file . ' ' . dirname(__DIR__) . '/tmp/compiled.yml'); + $this->assertFileEquals(dirname(__DIR__) . '/tmp/compiled.yml', dirname(__DIR__) . '/data/issue/155/compiled.yml'); } } From 02b63bdb3d0251aafdae0e6f5126a8b28b1b8fbc Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 14:02:45 +0530 Subject: [PATCH 64/90] Fix issue in Github action --- tests/spec/PathTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 522ff924..8fbc6fcc 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -221,7 +221,8 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); - shell_exec(dirname(__DIR__, 2) . '/bin/php-openapi inline ' . $file . ' ' . dirname(__DIR__) . '/tmp/compiled.yml'); - $this->assertFileEquals(dirname(__DIR__) . '/tmp/compiled.yml', dirname(__DIR__) . '/data/issue/155/compiled.yml'); + shell_exec(dirname(__DIR__, 2) . '/bin/php-openapi inline ' . $file . ' ' . dirname(__DIR__) . '/compiled.yml'); + $this->assertFileEquals(dirname(__DIR__) . '/compiled.yml', dirname(__DIR__) . '/data/issue/155/compiled.yml'); + unlink(dirname(__DIR__) . '/compiled.yml'); } } From 61fe21687ebbc080002ee36da3a91eb88b343ecc Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 14:14:38 +0530 Subject: [PATCH 65/90] Fix issue in Github action for Windows --- tests/spec/PathTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 8fbc6fcc..ad9a24c7 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -221,8 +221,9 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); - shell_exec(dirname(__DIR__, 2) . '/bin/php-openapi inline ' . $file . ' ' . dirname(__DIR__) . '/compiled.yml'); - $this->assertFileEquals(dirname(__DIR__) . '/compiled.yml', dirname(__DIR__) . '/data/issue/155/compiled.yml'); - unlink(dirname(__DIR__) . '/compiled.yml'); + $dirSep = DIRECTORY_SEPARATOR; + shell_exec(dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); + $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled.yml"); + unlink(dirname(__DIR__) . $dirSep.'compiled.yml'); } } From 2e89e6add318c3acfd4d8abda4d562d88e766fee Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:23:09 +0530 Subject: [PATCH 66/90] Fix issue in Github action 2 - related to different symfony/yaml version --- .../{compiled.yml => compiled-symfony-5.yml} | 0 tests/data/issue/155/compiled-symfony-6.yml | 128 ++++++++++++++++++ tests/data/issue/155/compiled-symfony-7.yml | 128 ++++++++++++++++++ tests/spec/PathTest.php | 29 +++- 4 files changed, 282 insertions(+), 3 deletions(-) rename tests/data/issue/155/{compiled.yml => compiled-symfony-5.yml} (100%) create mode 100644 tests/data/issue/155/compiled-symfony-6.yml create mode 100644 tests/data/issue/155/compiled-symfony-7.yml diff --git a/tests/data/issue/155/compiled.yml b/tests/data/issue/155/compiled-symfony-5.yml similarity index 100% rename from tests/data/issue/155/compiled.yml rename to tests/data/issue/155/compiled-symfony-5.yml diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml new file mode 100644 index 00000000..e1774005 --- /dev/null +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -0,0 +1,128 @@ +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-7.yml b/tests/data/issue/155/compiled-symfony-7.yml new file mode 100644 index 00000000..e1774005 --- /dev/null +++ b/tests/data/issue/155/compiled-symfony-7.yml @@ -0,0 +1,128 @@ +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index ad9a24c7..9d3e2e6d 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -223,7 +223,30 @@ public function testPathParametersAreArrays() $this->assertEquals('id', $userIdPath->parameters[2]->name); $dirSep = DIRECTORY_SEPARATOR; shell_exec(dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); - $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled.yml"); - unlink(dirname(__DIR__) . $dirSep.'compiled.yml'); - } + + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + + if (static::majorSymfonyYamlVersion() == 6) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + } elseif (static::majorSymfonyYamlVersion() == 7) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + } + + $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); + unlink(dirname(__DIR__) . '/compiled.yml'); + } + + public static function majorSymfonyYamlVersion() + { + $package = 'symfony/yaml'; + $installed = json_decode(file_get_contents(__DIR__ . '/../../composer.lock'), true); + + foreach ($installed['packages'] as $pkg) { + if ($pkg['name'] === $package) { + $version = explode('.', $pkg['version'])[0]; + return str_replace('v', '', $version); + } + } + return 7; + } } From e04fc8371b2f1c37f13ae1e6383b27cee2af0502 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:26:30 +0530 Subject: [PATCH 67/90] Fix issue in Github action 3 - related to different symfony/yaml version --- tests/spec/PathTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 9d3e2e6d..4a3f4cb8 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -228,8 +228,8 @@ public function testPathParametersAreArrays() if (static::majorSymfonyYamlVersion() == 6) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; - } elseif (static::majorSymfonyYamlVersion() == 7) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + } elseif (static::majorSymfonyYamlVersion() == 5) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; } $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); From b12c74660a7232a91b002f85fe6766912d785d5a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:31:39 +0530 Subject: [PATCH 68/90] Fix issue in Github action 4 - related to different symfony/yaml version --- tests/data/issue/155/compiled-symfony-6.yml | 2 +- tests/data/issue/155/compiled-symfony-7.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e1774005..e7a45025 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: 'User''s ID' + description: "User's ID" required: true schema: type: string diff --git a/tests/data/issue/155/compiled-symfony-7.yml b/tests/data/issue/155/compiled-symfony-7.yml index e1774005..e7a45025 100644 --- a/tests/data/issue/155/compiled-symfony-7.yml +++ b/tests/data/issue/155/compiled-symfony-7.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: 'User''s ID' + description: "User's ID" required: true schema: type: string From db60bff10aec8e16d711fa2348cc7c67427714bf Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:35:23 +0530 Subject: [PATCH 69/90] Fix issue in Github action 5 - related to different symfony/yaml version --- tests/data/issue/155/compiled-symfony-6.yml | 2 +- tests/spec/PathTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e7a45025..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: "User's ID" + description: 'User''s ID' required: true schema: type: string diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 4a3f4cb8..d79fcca3 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -232,7 +232,7 @@ public function testPathParametersAreArrays() $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; } - $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); + $this->assertFileEquals(dirname(__DIR__) . $expected, dirname(__DIR__) . $dirSep.'compiled.yml'); unlink(dirname(__DIR__) . '/compiled.yml'); } From 7f34a3bc6112fc40019f2c169b56a76302faed76 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:39:17 +0530 Subject: [PATCH 70/90] Fix issue in Github action 6 - related to different symfony/yaml version --- tests/data/issue/155/compiled-symfony-6.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e1774005..e7a45025 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: 'User''s ID' + description: "User's ID" required: true schema: type: string From e05cbd03d92f66204c7d96b88f3d9cdf702483e6 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 2 May 2025 16:38:10 +0530 Subject: [PATCH 71/90] Fix issue in Github action 7 - related to different symfony/yaml version --- tests/data/issue/155/compiled-symfony-6.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e7a45025..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: "User's ID" + description: 'User''s ID' required: true schema: type: string From 9811689cb5d43d650dbf406d8cedba7476a983f5 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 2 May 2025 16:46:13 +0530 Subject: [PATCH 72/90] Fix issue in Github action 8 - related to different symfony/yaml version --- tests/spec/PathTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index d79fcca3..d0d18fb6 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -228,6 +228,9 @@ public function testPathParametersAreArrays() if (static::majorSymfonyYamlVersion() == 6) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + if (version_compare(PHP_VERSION, '8.1', '>=')) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + } } elseif (static::majorSymfonyYamlVersion() == 5) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; } From 7e721bf037e25fa644644853ac82085049cf001a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 2 May 2025 17:40:55 +0530 Subject: [PATCH 73/90] Fix issue in Github action 9 - related to different symfony/yaml version --- tests/spec/PathTest.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index d0d18fb6..92f9082f 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -225,13 +225,15 @@ public function testPathParametersAreArrays() shell_exec(dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + $version = static::symfonyYamlVersion(); + $majorVersion = explode('.', $version)[0]; - if (static::majorSymfonyYamlVersion() == 6) { + if ($majorVersion == 6) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; - if (version_compare(PHP_VERSION, '8.1', '>=')) { + if (version_compare(PHP_VERSION, '8.1', '>=') && version_compare($version, '6.0.0', '!=')) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; } - } elseif (static::majorSymfonyYamlVersion() == 5) { + } elseif ($majorVersion == 5) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; } @@ -239,17 +241,16 @@ public function testPathParametersAreArrays() unlink(dirname(__DIR__) . '/compiled.yml'); } - public static function majorSymfonyYamlVersion() + public static function symfonyYamlVersion() { $package = 'symfony/yaml'; $installed = json_decode(file_get_contents(__DIR__ . '/../../composer.lock'), true); foreach ($installed['packages'] as $pkg) { if ($pkg['name'] === $package) { - $version = explode('.', $pkg['version'])[0]; - return str_replace('v', '', $version); + return str_replace('v', '', $pkg['version']); } } - return 7; + return '7.0.0'; } } From 241c469e5f61aa6bcd37f74268b62f15ac01c277 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 2 May 2025 17:51:05 +0530 Subject: [PATCH 74/90] Fix test on Windows --- tests/spec/PathTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 92f9082f..1b5e3845 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -222,7 +222,7 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); $dirSep = DIRECTORY_SEPARATOR; - shell_exec(dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); + shell_exec('php '.dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; $version = static::symfonyYamlVersion(); From 1e379ae61b9f1bc59bfcb6818d80e403bca43c51 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 07:24:03 +0530 Subject: [PATCH 75/90] Fix test on Windows 2 --- ....yml => compiled-symfony-6-windows-lf.yml} | 256 +++++++++--------- tests/spec/PathTest.php | 5 +- 2 files changed, 132 insertions(+), 129 deletions(-) rename tests/data/issue/155/{compiled-symfony-5.yml => compiled-symfony-6-windows-lf.yml} (96%) diff --git a/tests/data/issue/155/compiled-symfony-5.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml similarity index 96% rename from tests/data/issue/155/compiled-symfony-5.yml rename to tests/data/issue/155/compiled-symfony-6-windows-lf.yml index e1774005..70aa7317 100644 --- a/tests/data/issue/155/compiled-symfony-5.yml +++ b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 1b5e3845..9d2b0727 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -234,7 +234,10 @@ public function testPathParametersAreArrays() $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; } } elseif ($majorVersion == 5) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + } + if (stripos(PHP_OS, 'WIN') === 0) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; } $this->assertFileEquals(dirname(__DIR__) . $expected, dirname(__DIR__) . $dirSep.'compiled.yml'); From 5bebb98868fecc52ab9cf717585aef9ad5d85ced Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 07:48:27 +0530 Subject: [PATCH 76/90] Fix test related to line ending --- .../155/compiled-symfony-6-windows-lf.yml | 256 +++++++++--------- 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml index 70aa7317..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml +++ b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid From 1da45e96b1dc19400c3b209c8a18d78234b019c4 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 08:17:50 +0530 Subject: [PATCH 77/90] Fix test related to line ending 2 --- tests/spec/PathTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 9d2b0727..3587e699 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -236,9 +236,9 @@ public function testPathParametersAreArrays() } elseif ($majorVersion == 5) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; } - if (stripos(PHP_OS, 'WIN') === 0) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; - } +// if (stripos(PHP_OS, 'WIN') === 0) { +//// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; +// } $this->assertFileEquals(dirname(__DIR__) . $expected, dirname(__DIR__) . $dirSep.'compiled.yml'); unlink(dirname(__DIR__) . '/compiled.yml'); From c7a965ff93bdc5833a13e056489ebabd6de3e701 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 08:27:59 +0530 Subject: [PATCH 78/90] Fix test related to line ending 3 --- .../155/compiled-symfony-6-windows-lf.yml | 256 +++++++++--------- tests/data/issue/155/compiled-symfony-6.yml | 256 +++++++++--------- tests/data/issue/155/compiled-symfony-7.yml | 256 +++++++++--------- 3 files changed, 384 insertions(+), 384 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml index e1774005..70aa7317 100644 --- a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml +++ b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e1774005..70aa7317 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-7.yml b/tests/data/issue/155/compiled-symfony-7.yml index e7a45025..1f4921b0 100644 --- a/tests/data/issue/155/compiled-symfony-7.yml +++ b/tests/data/issue/155/compiled-symfony-7.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: "User's ID" - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: "User's ID" + required: true + schema: + type: string + format: uuid From 6947e2480fc5cb1fb1c7e2ee9c066bf0da9032ed Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 08:33:27 +0530 Subject: [PATCH 79/90] Revert "Fix test related to line ending 3" This reverts commit c7a965ff93bdc5833a13e056489ebabd6de3e701. --- .../155/compiled-symfony-6-windows-lf.yml | 256 +++++++++--------- tests/data/issue/155/compiled-symfony-6.yml | 256 +++++++++--------- tests/data/issue/155/compiled-symfony-7.yml | 256 +++++++++--------- 3 files changed, 384 insertions(+), 384 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml index 70aa7317..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml +++ b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index 70aa7317..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-7.yml b/tests/data/issue/155/compiled-symfony-7.yml index 1f4921b0..e7a45025 100644 --- a/tests/data/issue/155/compiled-symfony-7.yml +++ b/tests/data/issue/155/compiled-symfony-7.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: "User's ID" - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: "User's ID" + required: true + schema: + type: string + format: uuid From 20016f2234fee4cdc0fe1b8d766a4eeddfb766ef Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 09:26:09 +0530 Subject: [PATCH 80/90] Check --- tests/spec/PathTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 3587e699..d0a71c4e 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -240,7 +240,7 @@ public function testPathParametersAreArrays() //// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; // } - $this->assertFileEquals(dirname(__DIR__) . $expected, dirname(__DIR__) . $dirSep.'compiled.yml'); + $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); unlink(dirname(__DIR__) . '/compiled.yml'); } From f4628b09d89df4b7bbd8ae927f28374af2903781 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 13:29:41 +0530 Subject: [PATCH 81/90] Fix line ending issue in Windows - 4 --- tests/spec/PathTest.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index d0a71c4e..e853c8d8 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -222,26 +222,29 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); $dirSep = DIRECTORY_SEPARATOR; - shell_exec('php '.dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); + $output = dirname(__DIR__) . $dirSep . 'compiled.yml'; + shell_exec('php ' . dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . $output); - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml"; $version = static::symfonyYamlVersion(); $majorVersion = explode('.', $version)[0]; if ($majorVersion == 6) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml"; if (version_compare(PHP_VERSION, '8.1', '>=') && version_compare($version, '6.0.0', '!=')) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml"; } } elseif ($majorVersion == 5) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml"; + } + if (stripos(PHP_OS, 'WIN') === 0) { +// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6-windows-lf.yml"; + ; + file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); } -// if (stripos(PHP_OS, 'WIN') === 0) { -//// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; -// } - $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); - unlink(dirname(__DIR__) . '/compiled.yml'); + $this->assertFileEquals($output, dirname(__DIR__) . $expected); + unlink($output); } public static function symfonyYamlVersion() From 8a41d7431b287af2f6ed18e5483aae44342bd56f Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 13:58:42 +0530 Subject: [PATCH 82/90] Fix line ending issue in Windows - 5 --- tests/spec/PathTest.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index e853c8d8..5882f5c4 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -225,25 +225,28 @@ public function testPathParametersAreArrays() $output = dirname(__DIR__) . $dirSep . 'compiled.yml'; shell_exec('php ' . dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . $output); - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml"; + $baseExpected = dirname(__DIR__)."{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}"; + $expected = $baseExpected.'compiled-symfony-7.yml'; $version = static::symfonyYamlVersion(); $majorVersion = explode('.', $version)[0]; if ($majorVersion == 6) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml"; + $expected = $baseExpected."compiled-symfony-6.yml"; if (version_compare(PHP_VERSION, '8.1', '>=') && version_compare($version, '6.0.0', '!=')) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml"; + $expected = $baseExpected."compiled-symfony-7.yml"; } } elseif ($majorVersion == 5) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml"; + $expected = $baseExpected."compiled-symfony-6.yml"; } if (stripos(PHP_OS, 'WIN') === 0) { + // $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6-windows-lf.yml"; ; file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); + file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); } - $this->assertFileEquals($output, dirname(__DIR__) . $expected); + $this->assertFileEquals($output, $expected); unlink($output); } From ebeffc6de32ff9bede72fbc042e401ff7ed2146c Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 14:07:21 +0530 Subject: [PATCH 83/90] Cleanup --- tests/spec/PathTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 5882f5c4..cb831144 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -221,6 +221,7 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); + $dirSep = DIRECTORY_SEPARATOR; $output = dirname(__DIR__) . $dirSep . 'compiled.yml'; shell_exec('php ' . dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . $output); @@ -238,10 +239,7 @@ public function testPathParametersAreArrays() } elseif ($majorVersion == 5) { $expected = $baseExpected."compiled-symfony-6.yml"; } - if (stripos(PHP_OS, 'WIN') === 0) { - -// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6-windows-lf.yml"; - ; + if (stripos(PHP_OS, 'WIN') === 0) { # fixes https://github.com/cebe/php-openapi/actions/runs/14808968938/job/41581244210 file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); } From 50fc31e6a62368cd34f617f7b5f042a82775169d Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 14:14:46 +0530 Subject: [PATCH 84/90] Change visibility --- tests/spec/PathTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index cb831144..196684d6 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -248,7 +248,7 @@ public function testPathParametersAreArrays() unlink($output); } - public static function symfonyYamlVersion() + protected static function symfonyYamlVersion() { $package = 'symfony/yaml'; $installed = json_decode(file_get_contents(__DIR__ . '/../../composer.lock'), true); From a38d47e1c5973978ebab8414ba0b7e0721015c1b Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 14:38:07 +0530 Subject: [PATCH 85/90] Test --- tests/spec/PathTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 196684d6..8d3dc7f8 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -240,7 +240,7 @@ public function testPathParametersAreArrays() $expected = $baseExpected."compiled-symfony-6.yml"; } if (stripos(PHP_OS, 'WIN') === 0) { # fixes https://github.com/cebe/php-openapi/actions/runs/14808968938/job/41581244210 - file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); +// file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); } From eeb37f0d96245a2b1dd2c8be1af43a41d43b10ca Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 14:49:23 +0530 Subject: [PATCH 86/90] Cleanup --- .../155/compiled-symfony-6-windows-lf.yml | 128 ------------------ tests/spec/PathTest.php | 3 +- 2 files changed, 1 insertion(+), 130 deletions(-) delete mode 100644 tests/data/issue/155/compiled-symfony-6-windows-lf.yml diff --git a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml deleted file mode 100644 index e1774005..00000000 --- a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml +++ /dev/null @@ -1,128 +0,0 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 8d3dc7f8..2d47e3e7 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -240,8 +240,7 @@ public function testPathParametersAreArrays() $expected = $baseExpected."compiled-symfony-6.yml"; } if (stripos(PHP_OS, 'WIN') === 0) { # fixes https://github.com/cebe/php-openapi/actions/runs/14808968938/job/41581244210 -// file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); - file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); + file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); # not an ideal solution, can be refactored } $this->assertFileEquals($output, $expected); From 2b26ea1aa33e478f55a3e717f8eec7a669870fe6 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Fri, 22 Jul 2022 22:41:35 +0200 Subject: [PATCH 87/90] Added failing test for #164 --- Makefile | 2 +- tests/ReferenceContextTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index add949a6..7d9358f0 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ fix-style: php-cs-fixer.phar cli: docker-compose run --rm php bash -install: +install: composer.json package.json $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install diff --git a/tests/ReferenceContextTest.php b/tests/ReferenceContextTest.php index b06eb5fc..40e65baf 100644 --- a/tests/ReferenceContextTest.php +++ b/tests/ReferenceContextTest.php @@ -179,6 +179,14 @@ public function normalizeUriProvider() '/var/www/api/../definitions.yaml', 'file:///var/www/definitions.yaml', ], + [ + '/var/www/api/schema/../../definitions.yaml', + 'file:///var/www/definitions.yaml', + ], + [ + '/var/www/api/schema/./../definitions.yaml', + 'file:///var/www/api/definitions.yaml', + ], [ '/var/www/api/../definitions.yaml#/components/Pet', 'file:///var/www/definitions.yaml#/components/Pet', From 705e08275d1c9d9eef1622e026720f5f98d13885 Mon Sep 17 00:00:00 2001 From: Arinzechukwu Date: Fri, 28 Jul 2023 16:49:47 +0100 Subject: [PATCH 88/90] Fixed issues with relative path reference parsing --- src/ReferenceContext.php | 16 ++++++++++++---- tests/ReferenceContextTest.php | 6 +++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/ReferenceContext.php b/src/ReferenceContext.php index bde0a964..302e00ce 100644 --- a/src/ReferenceContext.php +++ b/src/ReferenceContext.php @@ -121,10 +121,18 @@ private function reduceDots($path) unset($parts[$i]); continue; } - if ($i > 0 && $parts[$i] === '..' && $parts[$i - $parentOffset] !== '..') { - unset($parts[$i - $parentOffset]); - unset($parts[$i]); - $parentOffset += 2; + + if ($i > 0 && $parts[$i] === '..') { + $parent = $i - $parentOffset; + //Make sure parent exists, if not, check the next parent etc + while($parent >= 0 && empty($parts[$parent])){ + $parent--; + } + //Confirm parent is valid + if(!empty($parts[$parent]) && $parts[$parent] !== '..'){ + unset($parts[$parent]); + unset($parts[$i]); + } } } return '/'.implode('/', $parts); diff --git a/tests/ReferenceContextTest.php b/tests/ReferenceContextTest.php index 40e65baf..bd450bc5 100644 --- a/tests/ReferenceContextTest.php +++ b/tests/ReferenceContextTest.php @@ -183,10 +183,14 @@ public function normalizeUriProvider() '/var/www/api/schema/../../definitions.yaml', 'file:///var/www/definitions.yaml', ], + [ + '/var/www/api/schema/./../data/./../definitions.yaml', + 'file:///var/www/api/definitions.yaml', + ], [ '/var/www/api/schema/./../definitions.yaml', 'file:///var/www/api/definitions.yaml', - ], + ], [ '/var/www/api/../definitions.yaml#/components/Pet', 'file:///var/www/definitions.yaml#/components/Pet', From bbc57204ca2055fd5f86fbf148b97ea47e6dd63c Mon Sep 17 00:00:00 2001 From: Arinzechukwu Date: Mon, 31 Jul 2023 15:06:26 +0100 Subject: [PATCH 89/90] Fixed issues with reducing url dots --- src/ReferenceContext.php | 2 +- tests/ReferenceContextTest.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ReferenceContext.php b/src/ReferenceContext.php index 302e00ce..6c3a4f18 100644 --- a/src/ReferenceContext.php +++ b/src/ReferenceContext.php @@ -131,8 +131,8 @@ private function reduceDots($path) //Confirm parent is valid if(!empty($parts[$parent]) && $parts[$parent] !== '..'){ unset($parts[$parent]); - unset($parts[$i]); } + unset($parts[$i]); } } return '/'.implode('/', $parts); diff --git a/tests/ReferenceContextTest.php b/tests/ReferenceContextTest.php index bd450bc5..dad12c1f 100644 --- a/tests/ReferenceContextTest.php +++ b/tests/ReferenceContextTest.php @@ -179,6 +179,10 @@ public function normalizeUriProvider() '/var/www/api/../definitions.yaml', 'file:///var/www/definitions.yaml', ], + [ + '/./definitions.yaml', + 'file:///definitions.yaml', + ], [ '/var/www/api/schema/../../definitions.yaml', 'file:///var/www/definitions.yaml', From 893ab104be1f5dfe5a39766703f583584e43c6e1 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 7 May 2025 10:44:12 +0200 Subject: [PATCH 90/90] code style fixes --- src/ReferenceContext.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ReferenceContext.php b/src/ReferenceContext.php index 6c3a4f18..868ec920 100644 --- a/src/ReferenceContext.php +++ b/src/ReferenceContext.php @@ -125,11 +125,11 @@ private function reduceDots($path) if ($i > 0 && $parts[$i] === '..') { $parent = $i - $parentOffset; //Make sure parent exists, if not, check the next parent etc - while($parent >= 0 && empty($parts[$parent])){ - $parent--; + while ($parent >= 0 && empty($parts[$parent])) { + $parent--; } //Confirm parent is valid - if(!empty($parts[$parent]) && $parts[$parent] !== '..'){ + if (!empty($parts[$parent]) && $parts[$parent] !== '..') { unset($parts[$parent]); } unset($parts[$i]);