L5-Swagger icon indicating copy to clipboard operation
L5-Swagger copied to clipboard

[Feature Request] Support for OpenAPI 3.1

Open ThaDaVos opened this issue 2 years ago • 6 comments

  • L5-Swagger Version: 8.3.3 (composer show | grep l5-swagger)
  • PHP Version (php -v): 8.0.21
  • OS: Ubuntu 20.04.4 LTS

Description:

According to this page, the latest spec supported seems to be OpenAPI 3.0: https://github.com/DarkaOnLine/L5-Swagger/wiki/Installation-&-Configuration Will there also be support for OpenAPI 3.1? It allows for some usefull extra features regarding $refs and other things

Steps To Reproduce:

No steps as it's a feature request

ThaDaVos avatar Sep 05 '22 07:09 ThaDaVos

See: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0

ThaDaVos avatar Sep 05 '22 07:09 ThaDaVos

We use https://github.com/zircote/swagger-php under the hood to parse annotations to OpenApi. So this question/suggestion should got to SwaggerPHP.

DarkaOnLine avatar Sep 09 '22 04:09 DarkaOnLine

I saw that https://github.com/zircote/swagger-php already supports 3.1, but i don't see any way to pass the version to the generator of swagger-php

ThaDaVos avatar Sep 09 '22 06:09 ThaDaVos

Oh I missed this. Hmm but they only allow to use this with the --version or Generator::setVersion() So we could have new config key and set version here: https://github.com/DarkaOnLine/L5-Swagger/blob/master/src/Generator.php#L207 - this should do the trick.

Would you be wiling to contribute and submit PR for this?

DarkaOnLine avatar Sep 09 '22 07:09 DarkaOnLine

Yeah something like that would fix it, i know it works as I extended and overrided somethings to test it and it's doable to pass it through

ThaDaVos avatar Sep 09 '22 07:09 ThaDaVos

Would you be wiling to contribute and submit PR for this? Or should I add this to my todo list :)

DarkaOnLine avatar Sep 09 '22 07:09 DarkaOnLine

Sadly using 3.1 isn't an option as the used swagger-ui doesn't support it yet. Is there a way to use something else than swagger-ui? I know there are others out there that already support 3.1. That said, it does seem that swagger-ui is actively working on 3.1 support. So maybe I should wait a little longer.

dietergeerts avatar Mar 24 '23 15:03 dietergeerts