docson icon indicating copy to clipboard operation
docson copied to clipboard

Support of `required` keyword

Open sserhii-95 opened this issue 6 years ago • 2 comments

Please add support of required keyword. It would be nice to have some little label near field name, that is in the 'required array'

sserhii-95 avatar Aug 20 '18 15:08 sserhii-95

Unless I’m misunderstanding the request, this is already supported (and has been for a long time). Maybe the bold font used for it is not noticeable enough? One version I have lying around here adds an asterisk, but I can’t find that in any Git revision, so maybe I added it myself?

diff --git a/public/css/docson.css b/public/css/docson.css
index e315b22..803566a 100644
--- a/public/css/docson.css
+++ b/public/css/docson.css
@@ -181,8 +181,13 @@
 .docson .required {
     font-weight: bold;
 }
 
+.docson .required:after {
+	content: " *";
+	color: #880000;
+}
+
 .docson .type-keyword {
     font-size: 80%;
     color: dimgray;
 }

cwalther avatar Sep 20 '19 10:09 cwalther

Oh, and, probably a duplicate of #30.

cwalther avatar Sep 20 '19 10:09 cwalther