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

Add possible mode values to put /_admin/cluster/maintenance/<server-id> #406

Closed
wants to merge 1 commit into from

Conversation

aMahanna
Copy link
Member

@aMahanna aMahanna commented Dec 29, 2023

Description

Added a sentence to save users an extra click/search for its documentation page

The Rest API description for this endpoint (in the Web UI) doesn't specify the possible mode values:
image

Whereas a similar endpoint (PUT /_admin/cluster/maintenance) does indeed specify possible values for mode:
image

I'm aware that the possible values are also present under the Schema section in the Request Body header so feel free to close this PR if that is deemed sufficient

Upstream PRs

  • 3.10:
  • 3.11:
  • 3.12:

Copy link
Contributor

Deploy Preview Available Via
https://deploy-preview-406--docs-hugo.netlify.app

@cla-bot cla-bot bot added the cla-signed label Dec 29, 2023
@aMahanna aMahanna requested review from Simran-B and removed request for Simran-B December 29, 2023 17:05
@aMahanna aMahanna changed the title Add possible mode values to PUT /_admin/cluster/maintenance/<server-id> Add possible mode values to put /_admin/cluster/maintenance/<server-id> Dec 29, 2023
@aMahanna aMahanna requested a review from Simran-B December 29, 2023 17:09
Copy link
Contributor

@Simran-B Simran-B left a comment

Choose a reason for hiding this comment

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

Not a fan of having this information also in the free-text description if we already have it documented in a structured form - it's likely that the two drift apart if we ever add or rename modes. I think we should check first whether we can improve the request body description by using an OpenAPI enum. Not sure if Swagger-UI meanwhile displays something like this nicely (e.g. a dropdown menu with the two options)

@aMahanna
Copy link
Member Author

aMahanna commented Jan 4, 2024

makes senses! closing 👍

@aMahanna aMahanna closed this Jan 4, 2024
@aMahanna aMahanna deleted the put-cluster-maintenance-server-mode branch January 4, 2024 15:35
@Simran-B
Copy link
Contributor

@aMahanna Revisiting this issue, I found out that there is an option in Swagger-UI to show the Schema instead of the Example Value by default:

image

However, there is a problem: If no schema defined (which is unfortunately the case for many request and especially response descriptions), it still tries to select the non-existing Schema tab and then displays an error:

image

I can check whether this has been fixed in the latest Swagger-UI version. In the latest code, it actually looks like they check whether the tab exists before trying to activate it. I think the Schema tab is generally more useful than the Example Value tab, also because it often falls back to values like 0, false and "string" that aren't actually valid or nonsense. This would make it easier to discover the descriptions of the parameters. If you click the Try it out button, it automatically changes to a textarea still, revealing the example values.

@Simran-B
Copy link
Contributor

It has indeed been fixed:
image

PR to upgrade Swagger-UI: arangodb/arangodb#21685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants