You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by Yubiao Feng <yu...@streamnative.io.INVALID> on 2023/01/11 18:40:15 UTC

[DISCUSS] Override PersistentTopics methods in class NonPersistentTopics to correctly generate the doc of pulsar site

Hi community

Now that site [admin-rest-api](https://pulsar.apache.org/admin-rest-api) is
automatically generated through swagger, each API in the site has its link
that we can walk through, the generated rule of API-link is `
https://pulsar.apache.org/admin-rest-api/#operation/{operationId}`, we call
the suffix `#operation/{operationId}` of link anchor.

Since the {operationId}'s default value is the method name of the endpoint
class, and there has the same method name in the multi endpoint-classes,
such as `Namespaces.setDispatchRate` and
`PersistentTopics.setDispatchRate`, so these both APIs will generate the
same link: `
https://pulsar.apache.org/admin-rest-api/#operation/setDispatchRate`. I
have submitted PR https://github.com/apache/pulsar/pull/19193 to solve the
problem that links are not unique due to method name conflicts.

(Highlight) But there has another issue: `NonPersistentTopics` extends
`PersistentTopics,` so there will have a lot of methods using the same
name, we need to find a good way to solve it.
I want to override all the parent `PersistentTopics` methods in class
`NonPersistentTopics` for resetting the `operationId` so that all the
issues are resolved.

Thanks
Yubiao Feng