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 option to remove required flag #1095

Closed
vlebourl opened this issue Nov 17, 2021 · 5 comments
Closed

Add option to remove required flag #1095

vlebourl opened this issue Nov 17, 2021 · 5 comments
Labels
feature request fixed on dev for issues fixed on dev branch

Comments

@vlebourl
Copy link

vlebourl commented Nov 17, 2021

Feature request

Although having parameters as required as default option is IMO a good idea, showing the required flag in the rendering is sometimes a bit too much... For instance, the following block as a required or optional showing up in response and errors areas, which doesn't make much sens to me...

I may have missed how to disable that. But if not, adding an option to not show those would be great!

Cheers and thanks for the great work!

/**
 * @api {post} /api/login Retrieve user's password salted hash.
 * @apiName Login
 * @apiGroup API
 *
 * @apiBody {String} userId    The user's id.
 * @apiBody {String} password  The user's password.
 * @apiParamExample {json} Request-Example:
 *   {
 *     "userId": "user1",
 *     "password": "password"
 *   }
 * 
 * @apiSuccess {String} loginHash Salted hash of the user's password.
 *
 * @apiSuccessExample {json} Success-Response:
 *  HTTP/1.1 200 OK
 *  {
 *    "loginHash": "9LfzEggSuUPj4DKGkyxm5vSk7fBaUgKKUvwDQeJoVF3MkEbxhr6JG2czF3gPb3r6N2sq8wxry5pePfYRUwKXEG"
 *  }
 * 
 * @apiError (500 Internal Server Error) [InternalServerError] Server Out of Memory.
 * @apiError (Error 4xx)                 BadRequest          <code>userId</code> is either unknown or does not have access to this StarQube Server.
 * @apiError (Error 4xx)                 BadRequest          <code>userId</code> requires kerberos authentication.
 * @apiError (Error 4xx)                 Unauthorized        Invalid password.
 */

image
image

@TheJaysH
Copy link

+1 for this.. I'm sure it never used to do this. But i could be wrong.

@NicolasCARPi
Copy link
Collaborator

I think I will add an option showRequiredLabels, so the default won't show it.

@TheJaysH
Copy link

Maybe prefix the value with a ! or something to dictate its required? just an idea? Love the project btw. thanks :)

@NicolasCARPi
Copy link
Collaborator

NicolasCARPi commented Dec 21, 2021

Maybe prefix the value with a ! or something to dictate its required?

No it needs to be the same as the optional label (also prefixing with ! means "not"). I think the big issue here is mainly aesthetic, with too many red labels.

Love the project btw. thanks :)

Cheers :)

@NicolasCARPi NicolasCARPi added the fixed on dev for issues fixed on dev branch label Dec 24, 2021
@NicolasCARPi
Copy link
Collaborator

The option showRequiredLabels has been added (default: false) and will be available in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request fixed on dev for issues fixed on dev branch
Projects
None yet
Development

No branches or pull requests

3 participants