diff --git a/data/3.0.1/Z_Object.yaml b/data/3.0.1/Z_Object.yaml index 5453eb6..601ad40 100644 --- a/data/3.0.1/Z_Object.yaml +++ b/data/3.0.1/Z_Object.yaml @@ -3,7 +3,11 @@ Z Object: description: | Test description with a [link](http://apihandyman.io) and another [one](#openapi/). fields: - - name: test + - name: required type: string + required: true description: | - Test properties with a [link](http://apihandyman.io) and another [one](#openapi/) \ No newline at end of file + Test properties with a [link](http://apihandyman.io) and another [one](#openapi/) + - name: notRequired + type: string + description: Non required property \ No newline at end of file diff --git a/web/static/css/tree.css b/web/static/css/tree.css index 352e6bb..9d1ee80 100644 --- a/web/static/css/tree.css +++ b/web/static/css/tree.css @@ -73,3 +73,7 @@ div.tooltip { margin-bottom: 20px; padding-left: 0px; } + +.node .nodeRequired { + fill:red; +} \ No newline at end of file diff --git a/web/static/js/drawTree.js b/web/static/js/drawTree.js index d8bb2bb..ae705b8 100644 --- a/web/static/js/drawTree.js +++ b/web/static/js/drawTree.js @@ -1,6 +1,19 @@ 'use strict'; var template = OpenAPISpecificationVisualDocumentation.tooltip; +function getNodeTextClass(node) { + console.log('getNodeTextClass') + var result; + if(node.required) { + result = 'nodeRequired'; + } + else { + result = 'nodeText'; + } + console.log(node.name + ',' + node.required +':'+result); + return result; +} + function getStrokeColor(node) { var color; if (node.isTechnical) { @@ -372,7 +385,7 @@ function drawTree(treeData){ return d.children || d.closedChildren ? -10 : 10; }) .attr('dy', '.35em') - .attr('class', 'nodeText') + .attr('class', function(d){return getNodeTextClass(d);}) .attr('text-anchor', function(d) { return d.children || d.closedChildren ? 'end' : 'start'; })