flowchartsman opened a new issue #9200: URL: https://github.com/apache/pulsar/issues/9200
All of the swagger files downloadable from the site and found at https://github.com/apache/pulsar/tree/master/site2/website/static/swagger/2.7.0 are invalid according to several of the tools I've attempted to use. The following outputs are from interaction with the validatation API at swagger.io like so: ### swagger.json ``` curl -X GET "https://validator.swagger.io/validator/debug?url=https%3A%2F%2Fraw.githubusercontent.com%2Fapache%2Fpulsar%2Fmaster%2Fsite2%2Fwebsite%2Fstatic%2Fswagger%2F2.7.0%2Fswagger.json" -H "accept: application/yaml" --- messages: - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/backlogQuota'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/backlogQuota'(delete).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/backlogQuotaMap'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/compactionThreshold'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/compactionThreshold'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/deduplicationSnapshotInterval'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/deduplicationSnapshotInterval'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/delayedDelivery'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/delayedDelivery'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/dispatchRate'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/dispatchRate'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/inactiveTopicPolicies'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/inactiveTopicPolicies'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/maxConsumersPerSubscription'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/maxConsumersPerSubscription'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/offloadPolicies'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/offloadPolicies'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/offloadPolicies'(delete).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/persistence'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/persistence'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/retention'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/retention'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/subscribeRate'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/subscribeRate'(post).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/subscriptionDispatchRate'(get).operationId\ \ is repeated" - "attribute paths.'/non-persistent/{tenant}/{namespace}/{topic}/subscriptionDispatchRate'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}'(get).operationId is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/partitioned'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}'(put).operationId is\ \ repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/all_subscription/expireMessages/{expireTimeInSeconds}'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/backlog'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/backlogQuota'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/backlogQuota'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/backlogQuotaMap'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/compaction'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/compaction'(put).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/compactionThreshold'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/compactionThreshold'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/compactionThreshold'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/createMissedPartitions'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/deduplicationEnabled'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/deduplicationEnabled'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/deduplicationEnabled'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/deduplicationSnapshotInterval'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/deduplicationSnapshotInterval'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/deduplicationSnapshotInterval'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/delayedDelivery'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/delayedDelivery'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/delayedDelivery'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/dispatchRate'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/dispatchRate'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/dispatchRate'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/examinemessage'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/inactiveTopicPolicies'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/inactiveTopicPolicies'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/inactiveTopicPolicies'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/internal-info'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/internalStats'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/lastMessageId'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/ledger/{ledgerId}/entry/{entryId}'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxConsumers'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxConsumers'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxConsumers'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxConsumersPerSubscription'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxConsumersPerSubscription'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxConsumersPerSubscription'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxProducers'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxProducers'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxProducers'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxUnackedMessagesOnConsumer'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxUnackedMessagesOnConsumer'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxUnackedMessagesOnConsumer'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxUnackedMessagesOnSubscription'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxUnackedMessagesOnSubscription'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/maxUnackedMessagesOnSubscription'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/messageTTL'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/messageTTL'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/messageTTL'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/offload'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/offload'(put).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/offloadPolicies'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/offloadPolicies'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/offloadPolicies'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/partitioned-stats'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/partitions'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/partitions'(put).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/partitions'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/partitions'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/permissions'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/permissions/{role}'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/permissions/{role}'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/persistence'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/persistence'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/persistence'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/publishRate'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/publishRate'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/publishRate'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/retention'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/retention'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/retention'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/stats'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscribeRate'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscribeRate'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscribeRate'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}/expireMessages/{expireTimeInSeconds}'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}/position/{messagePosition}'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}/resetcursor'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}/resetcursor/{timestamp}'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}/skip/{numMessages}'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscription/{subName}/skip_all'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscription/{subscriptionName}'(put).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscriptionDispatchRate'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscriptionDispatchRate'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscriptionDispatchRate'(delete).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/subscriptions'(get).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/terminate'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/terminate/partitions'(post).operationId\ \ is repeated" - "attribute paths.'/persistent/{tenant}/{namespace}/{topic}/unload'(put).operationId\ \ is repeated" - "attribute paths.'/schemas/{tenant}/{namespace}/{topic}/schema/{version}'(get).operationId\ \ is repeated" schemaValidationMessages: null ``` ### swaggerfunctions.json ``` curl -X GET "https://validator.swagger.io/validator/debug?url=https%3A%2F%2Fraw.githubusercontent.com%2Fapache%2Fpulsar%2Fmaster%2Fsite2%2Fwebsite%2Fstatic%2Fswagger%2F2.7.0%2Fswaggerfunctions.json" -H "accept: application/yaml" --- messages: - "attribute paths.'/functions/{tenant}/{namespace}/{functionName}/{instanceId}/restart'(post).operationId\ \ is repeated" - "attribute paths.'/functions/{tenant}/{namespace}/{functionName}/{instanceId}/start'(post).operationId\ \ is repeated" - "attribute paths.'/functions/{tenant}/{namespace}/{functionName}/{instanceId}/stop'(post).operationId\ \ is repeated" schemaValidationMessages: null ``` ### swaggersink.json ``` curl -X GET "https://validator.swagger.io/validator/debug?url=https%3A%2F%2Fraw.githubusercontent.com%2Fapache%2Fpulsar%2Fmaster%2Fsite2%2Fwebsite%2Fstatic%2Fswagger%2F2.7.0%2Fswaggersink.json" -H "accept: application/yaml" --- messages: - "attribute paths.'/sinks/{tenant}/{namespace}/{sinkName}/{instanceId}/restart'(post).operationId\ \ is repeated" - "attribute paths.'/sinks/{tenant}/{namespace}/{sinkName}/{instanceId}/start'(post).operationId\ \ is repeated" - "attribute paths.'/sinks/{tenant}/{namespace}/{sinkName}/{instanceId}/stop'(post).operationId\ \ is repeated" schemaValidationMessages: null ``` ### swaggersource.json ``` curl -X GET "https://validator.swagger.io/validator/debug?url=https%3A%2F%2Fraw.githubusercontent.com%2Fapache%2Fpulsar%2Fmaster%2Fsite2%2Fwebsite%2Fstatic%2Fswagger%2F2.7.0%2Fswaggersource.json" -H "accept: application/yaml" --- messages: - "attribute paths.'/sources/{tenant}/{namespace}/{sourceName}/{instanceId}/restart'(post).operationId\ \ is repeated" - "attribute paths.'/sources/{tenant}/{namespace}/{sourceName}/{instanceId}/start'(post).operationId\ \ is repeated" - "attribute paths.'/sources/{tenant}/{namespace}/{sourceName}/{instanceId}/stop'(post).operationId\ \ is repeated" schemaValidationMessages: null ``` In addition, when these duplicate opreationId errors are resolved through heuristics, several routes from the combined swagger violate the spec by including two or more body parameters, which is not allowed: ``` The swagger spec at "/Users/awalker/devel/pulsaradmin/clienttest/combined.json" is invalid against swagger specification 2.0. see errors : - duplicate parameter name "body" for "body" in operation "triggerFunction" - duplicate parameter name "body" for "body" in operation "updateFunction" - duplicate parameter name "body" for "body" in operation "updateSink" - duplicate parameter name "body" for "body" in operation "updateSource" ``` As it stands, it is not possible to build administrative clients for pulsar from the swagger using any tool that respects the spec. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
