DarkaOnLine / L5-Swagger

OpenApi or Swagger integration to Laravel
https://github.com/DarkaOnLine/L5-Swagger
MIT License
2.64k stars 394 forks source link

Reuse OA annotations from parent controller in child one? #434

Closed kolinko-ant closed 1 year ago

kolinko-ant commented 2 years ago

Description:

Hey guys. Thanks for such cool product, it really helps us a lot! I want to ask a question about how we can work with documentation when you already have multiple API versions. In our setup we have 2 folders API/V1/Controllers and API/V2/Controllers. Let's say we have V2UserController that extends V1UserController. In V1UserController for each method we have api annotations /**

V2UserController (because it extends V1) has the same logic so I don't want to override any methods there. I just want to keep V2 controller empty, but at the same time I want to see those methods also in V2 documentation. Apparently because V2 controller empty, there is no such methods in v2 documentation. Is there way they can appear there because of class extension? Are there any ways?

DarkaOnLine commented 2 years ago

Have you checked refs? Maybe this can work

DerManoMann commented 2 years ago

This might be more a question for zircote/swagger-php which is used under the hood.

However, class hierachies are currently only supported for @OA\Schema (models).