Unable to group
caixingyue opened this issue ยท 9 comments
Must be a feature of the specific library.
What exactly does this change in the generated spec? I do not remember groups as an open API concept?
Must be a feature of the specific library. What exactly does this change in the generated spec? I do not remember groups as an open API concept?
It is a common scenario that there are multiple system interfaces for the same Laravel. Generally, we provide different interfaces to third-party partners, apps, operation backgrounds, etc., and there will be different prefix routes depending on the situation. How should we provide documents for this scenario? Putting them directly in one document will be bloated because they do not need interfaces with different routes.
In spring, we will directly use the grouping method.
Fair enough, that is roughly what I thought the reason might be.
Ah, I missed that dropdown - never seen that before. So far the only way I knew of is using tags.
So, my question again - how does this grouping look like in the actual generated Yaml/Json if it is not tags? I just checked out the latest swagger-ui and I cannot see the dropdown at all...?
Fair enough, that is roughly what I thought the reason might be.
Ah, I missed that dropdown - never seen that before. So far the only way I knew of is using tags.
So, my question again - how does this grouping look like in the actual generated Yaml/Json if it is not tags? I just checked out the latest swagger-ui and I cannot see the dropdown at all...?
If you use tags, they will still be displayed on the same page, so that no matter which system's APIs are, they will be displayed together, which is not appropriate. At present, I have simply checked the source code, and it seems that multiple documents can be generated, but they cannot be switched like groups, and there is no relevant document that mentions how to generate multiple documents.
Could you please post a sample of a document that contains that grouping you want? I think we need to work backwards from that. Maybe this is a custom extension of the Spring library?
Could you please post a sample of a document that contains that grouping you want? I think we need to work backwards from that. Maybe this is a custom extension of the Spring library?
He generates multiple json files based on the group name, and then when switching in the UI, it will jump to different json.
As I mentioned earlier, l5-swagger also has this implementation, but it seems not perfect?
For example, if there are these two configuration methods in spring, two api-docs will be generated.
In the UI, there will be tabs for switching.
You are right, I think this is indeed not the swagger specification, but it is a very useful extension.
GroupedOpenApi.builder().group("starcore-partner").pathsToMatch("/api/**")
http://127.0.0.1:8080/v3/api-docs/starcore-partner
GroupedOpenApi.builder().group("starcore-partner2").pathsToMatch("/api/**")
http://127.0.0.1:8080/v3/api-docs/starcore-partner2
Ok, I think I have it:
- The spec selector is the topbar plugin in swagger-ui (core) that allows to toggle between different spec files
- The group by creates specs using subsets (regexp) of url patterns.
I guess the selector is out of scope (good) ๐, the grouping could be a feature (also good).
Ok, I think I have it:
- The spec selector is the topbar plugin in swagger-ui (core) that allows to toggle between different spec files
- The group by creates specs using subsets (regexp) of url patterns.
I guess the selector is out of scope (good) ๐, the grouping could be a feature (also good).
Well, for example, if there are multiple configurations, multiple docs can be generated by default, and when there are multiple, the top bar becomes a selector or something like that.
We usually create different routes based on different API systems, and different routes have their own prefixes.
It is very useful to be able to generate different documents based on prefixes, and I am looking forward to seeing such a feature in future versions.