-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix] [doc] fix multiple apis in the automatically generated documentation use the same anchor point #19193
[fix] [doc] fix multiple apis in the automatically generated documentation use the same anchor point #19193
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -697,11 +697,13 @@ | |
<plugin> | ||
<groupId>com.github.kongchen</groupId> | ||
<artifactId>swagger-maven-plugin</artifactId> | ||
<version>3.1.7</version> | ||
<version>3.1.8</version> | ||
<configuration> | ||
<apiSources> | ||
<apiSource> | ||
<springmvc>false</springmvc> | ||
<operationIdFormat>{{className}}_{{methodName}}</operationIdFormat> | ||
<outputFormats>json</outputFormats> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Is this json outputFormats necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It should be optional, but maven or swagger had issues, and I had null Pointers when testing locally. I tried troubleshooting the issue yesterday but couldn't get the root cause quickly, so I thought adding this configuration would avoid unnecessary trouble. |
||
<locations> | ||
<location>org.apache.pulsar.broker.admin.v2.Bookies</location> | ||
<location>org.apache.pulsar.broker.admin.v2.BrokerStats</location> | ||
|
@@ -737,6 +739,8 @@ | |
</apiSource> | ||
<apiSource> | ||
<springmvc>false</springmvc> | ||
<operationIdFormat>{{className}}_{{methodName}}</operationIdFormat> | ||
<outputFormats>json</outputFormats> | ||
<locations>org.apache.pulsar.broker.lookup.v2</locations> | ||
<schemes>http,https</schemes> | ||
<basePath>/lookup</basePath> | ||
|
@@ -754,6 +758,8 @@ | |
</apiSource> | ||
<apiSource> | ||
<springmvc>false</springmvc> | ||
<operationIdFormat>{{className}}_{{methodName}}</operationIdFormat> | ||
<outputFormats>json</outputFormats> | ||
<locations>org.apache.pulsar.broker.admin.v3.Functions</locations> | ||
<schemes>http,https</schemes> | ||
<basePath>/admin/v3</basePath> | ||
|
@@ -771,6 +777,8 @@ | |
</apiSource> | ||
<apiSource> | ||
<springmvc>false</springmvc> | ||
<operationIdFormat>{{className}}_{{methodName}}</operationIdFormat> | ||
<outputFormats>json</outputFormats> | ||
<locations>org.apache.pulsar.broker.admin.v3.Transactions</locations> | ||
<schemes>http,https</schemes> | ||
<basePath>/admin/v3</basePath> | ||
|
@@ -788,6 +796,8 @@ | |
</apiSource> | ||
<apiSource> | ||
<springmvc>false</springmvc> | ||
<operationIdFormat>{{className}}_{{methodName}}</operationIdFormat> | ||
<outputFormats>json</outputFormats> | ||
<locations>org.apache.pulsar.broker.admin.v3.Sources</locations> | ||
<schemes>http,https</schemes> | ||
<basePath>/admin/v3</basePath> | ||
|
@@ -805,6 +815,8 @@ | |
</apiSource> | ||
<apiSource> | ||
<springmvc>false</springmvc> | ||
<operationIdFormat>{{className}}_{{methodName}}</operationIdFormat> | ||
<outputFormats>json</outputFormats> | ||
<locations>org.apache.pulsar.broker.admin.v3.Sinks</locations> | ||
<schemes>http,https</schemes> | ||
<basePath>/admin/v3</basePath> | ||
|
@@ -822,6 +834,8 @@ | |
</apiSource> | ||
<apiSource> | ||
<springmvc>false</springmvc> | ||
<operationIdFormat>{{className}}_{{methodName}}</operationIdFormat> | ||
<outputFormats>json</outputFormats> | ||
<locations>org.apache.pulsar.broker.admin.v3.Packages</locations> | ||
<schemes>http,https</schemes> | ||
<basePath>/admin/v3</basePath> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think
{className}_{methodName}
is reasonable as the unique operationIdFormat.LGTM if we don't have duplicated apiSources from the same class and methodName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After keeping only the latest version of admin API(such as
v2
,v3
),{className}_{methodName}
will not conflict. If we open multiple versions of API in the future, we need to change the rule to{package_name}_{className}_{methodName}