Redocly / developer-portal-starter

Starter template for the Redocly developer portal
https://redoc.ly
Other
64 stars 101 forks source link

Version switcher not working #156

Closed kellym closed 2 years ago

kellym commented 2 years ago

When we created multiple versions of an API and followed the said documentation for configuring a .page.yaml file, we do indeed get a version switcher that shows up in the UI of the portal. However, selecting an option from the version switcher doesn't do anything, and manually changing the URL to the other version of the API shows the correct documentation, but the sidebar navigation remains collapsed.

Any suggestions? Happy to provide more feedback.

AntonKozachuk commented 2 years ago

Hi @kellym,

We weren't able to reproduce the mentioned issue.

Could you possibly contact us at team@redoc.ly and share more detail?

It would be helpful if you could share the .page.yaml and siteConfig.yaml file content.

Looking forward to hearing from you.

kellym commented 2 years ago

I did a little more testing and determined how to reproduce. Instead of using a wildcard operator for importing API documentation, we're referencing a specific tag. i.e.

        pages:
          - page: docs/api.page.yaml#tag/My-First-Page
          - page: docs/api.page.yaml#tag/My-Second-Page

When we use the wildcard operator like so, it works fine:

        pages:
          - page: docs/api.page.yaml/*

The problem is that we don't want the entire API docs to be posted, just specific endpoints.

adamaltman commented 2 years ago
          - page: docs/api.page.yaml#tag/My-First-Page
          - page: docs/api.page.yaml#tag/My-Second-Page

The same page.yaml cannot be referenced twice in the sidebar. Here is a workaround:

  1. Make two files with the same contents

    • first.page.yaml (adjust these names to meet your needs)
    • second.page.yaml
  2. Reference them in the sidebar:

        pages:
          - page: docs/first.page.yaml#tag/My-First-Page
          - page: docs/second.page.yaml#tag/My-Second-Page
RomanHotsiy commented 2 years ago

@kellym can it be closed?

kellym commented 2 years ago

Yeah, I'll close the issue. It's not an ideal solution but I understand the complexities. Thanks for the help!