TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.6k stars 1.08k forks source link

[TT-6441]APIs in the API Catalogue do not have stable slugs #4253

Open drpebcak opened 2 years ago

drpebcak commented 2 years ago

Branch/Environment/Version

Describe the bug When adding APIs to the API Catalogue, the slug that identifies the API documentation is changed every time the entry is saved.

Reproduction steps Steps to reproduce the behavior:

  1. Create an API Entry with a swagger doc
  2. Visit the API Catalog documentation in the dev portal
  3. Click save again for the API entry in the dashboard
  4. Refresh the page and see that it 404s now because the slug has changed

Actual behavior The slug in the url that identifies the API changes on every save.

Expected behavior I expect the slug to be stable for the life of this particular API Entry, so that I can link to some particular API Documentation.

Additional context This happens when using the tyk-operator as well as the portal UI. I typically use the operator, so any solution would ideally work with that.

drpebcak commented 2 years ago

My memory is that on versions sub 4.x, we did not have this issue with the slug changing.

pagemag commented 2 years ago

@drpebcak Thanks for posting your issue here. It seems that I can't replicate your issue when using UI. Can you please elaborate the third point of what you are doing (Click save again for the API entry in the dashboard)? Are you clicking the update on the Catalog API documentation?

drpebcak commented 2 years ago

@pagemag I realized while stepping through this again that there is an additional step. This seems to happen if you don't add swagger documentation when you initially create the catalog entry. I've recorded a video, but I would rather not share my dashboard/developer urls here on github, so I have trimmed off the top of the browser. When I refresh and it 404s, its because the slug in the url has changed - https://<my-dev-portal>/apis/<slug-that-changes>/documentation/.

https://imgur.com/XLpVu3W

pagemag commented 2 years ago

@drpebcak Thank you for providing the video on how to replicate this. I filed an internal ticket for this.