-
Notifications
You must be signed in to change notification settings - Fork 9.1k
No provision to group API's and then $ref it to reference it in other file #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry, but I really don't follow the question. Can you provide further details? |
Suppose we have two modules pet and user. Both these modules have few apis which is to be documented using swagger pet (Module 1):
user (Module 2):
Now as per swagger rules and using '$ref' final api-docs would look like:
But no. of such modules and no. of apis per module can vary largely and it becomes difficult to ask teams associated with particular modules to document each api separately in api-docs file With module wise separation of apis:
Such swagger json would be much cleaner and easier for teams to work with |
That's closer to the concept of microservices documentation which doesn't exist in 2.0. There are several existing discussions on it in this repo and other forums. |
Parent issue #560 |
FWIW, I've felt this pain, too. The "module wise separation of APIs" example at the end is the best suggestion I've seen, but it still feels forced. Sadly, I don't have a better proposal to make. |
In our application, we have apis divided among various modules.
As per swagger-spec, It becomes very difficult to have only one swagger file (api-docs) for all the modules considering the number of apis and also number of teams working on various modules.
So I started using $ref (purpose: same folder reference) and third party swagger parsers to dereference it. But I still cannot figure out a way in swagger to group apis with one $ref.
So that I can assign all apis for a particular module to a team and then just $ref in api-docs that can be dereferenced lately to get complete single api-docs file
Eg:
Which when dereferenced, will change to
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: