Skip to content
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

URL Prefix change #315

Merged
merged 5 commits into from
Apr 29, 2024
Merged

Conversation

dscervantes
Copy link
Contributor

The defaulturl is set to example.com and the logic grabs the baseurl from the openapi spec and tries to create a valid URL.

What I noticed was that some openapi specs have stuff like "/api/v1/example" as their base url which returns an error when trying to cast it as a URL in the code.

What I changed was that the defaulturl is now console.redhat.com instead of example.com, and I added a check to see if the baseurl from the openapi spec starts with a "/". If it does then I append it to the end of the defaulturl and use that as the url in the example code box.

If the openapi spec has a valid url already in it then the check is skipped and it works as expected

Screenshot from 2024-04-22 19-41-41

It is fixing this https://issues.redhat.com/browse/RHCLOUD-31601

Copy link

@vkrizan vkrizan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

src/components/APIDoc/hooks/useGroupedOperations.ts Outdated Show resolved Hide resolved
@gmcculloug gmcculloug requested a review from josejulio April 23, 2024 12:37
@tahmidefaz
Copy link
Member

tahmidefaz commented Apr 23, 2024

Needs some changes based off the conversation in slack.
We will need to introduce a new property for base url in Discovery.yml for each docs, and use it in the code snippets. Since, we host API docs that are not part of consoledot, defaulting to console.redhat.com might not be the best route to go here.

Copy link
Member

@tahmidefaz tahmidefaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! 👍
I just requested some changes. A bunch of non-consoledot APIs are mislabeled as consoledot.

packages/discovery/Discovery.yml Outdated Show resolved Hide resolved
Copy link
Member

@tahmidefaz tahmidefaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested 2 changes:

  • Let's not define the serverUrl for the Ansible automation controller API
  • Re-run the automations so that your changes gets updated in /pachages/common/config/api.ts

packages/discovery/Discovery.yml Outdated Show resolved Hide resolved
packages/common/config/apis.ts Outdated Show resolved Hide resolved
@dscervantes dscervantes requested a review from tahmidefaz April 29, 2024 15:49
Copy link
Member

@tahmidefaz tahmidefaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! 🎉

@tahmidefaz tahmidefaz merged commit cc502ae into RedHatInsights:main Apr 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants