question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cosmetic: request header description set as placeholder for related textbox

See original GitHub issue

Don’t get distracted by values, please. Pictures = 1000 words:

swagger-json; request params: image

This is expected (swagger-json > default becomes input.value): image

But, input.placeholder being set to swagger-json > name + " - " + description seems out of place: image

Rendered HTML: image

How about not setting the input.placeholder to anything, if same information is displayed right next to it (name, description). There is nothing new to show, really. Maybe, it could be set to default, so once retyped and then cleared, the user can still see what it was (although it won’t be much useful, since browsers remove the placeholder value the moment you start typing).

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:9
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

24reactions
cmlcciecommented, Jan 30, 2019

I would like to provide (via some reasonable means) the text that Swagger UI will render as placeholder text. Using the description, which is immediately above the text input field (redundant) and often doesn’t fit inside the input control isn’t attractive and doesn’t add value to the UI.

I suggest populating the placeholder text with either:

  1. The example value. I don’t like that the example values become request defaults. If you don’t want to make the example request, you have to delete the example values everytime you make a request using the UI. Setting the example as the placeholder text seems more intuitive to me. It shows the user an example of what could go in the field without providing the value as some sort of default.
  2. The summary value. If people really like having the example values prepopulated, that’s okay. One can just opt to not provide examples if they don’t want this behavior. In this case, using the summary text as the placeholder text would at least provide an option for providing more concise text (that might fit inside the text input control) and it wouldn’t be redundant with the already provided description.

My $0.02. 😎

0reactions
GearTheWorldcommented, Jan 27, 2021

Any possible workaround right now to get only the name for the placeholder? 5.6.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenAPI query parameter description not set to text box as ...
If the parameter has an example or default value (or x-example in OpenAPI 2.0), Swagger UI will use this value as a placeholder...
Read more >
Adding Placeholders - Microsoft Dynamics CRM Forum ...
I am looking to add placeholders for a text fields in a form, and want to know how can it be done if...
Read more >
Placeholder for a text field - Discussion - BMC Community
Hi,. I am working on cosmetic changes to a form. One of the things in the design was to have placeholders for some...
Read more >
Don't Use The Placeholder Attribute - Smashing Magazine
An interoperable input is created by programmatically associating a label element with it. Labels describe the purpose of an input field, ...
Read more >
Format text and placeholders in paginated reports
When a simple or complex expression is defined inside a text box, the resulting UI representation of this expression is known as a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found