-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix attributes next to ref not rendered when re-used (#239)
- Loading branch information
1 parent
c62d0f8
commit a4380d3
Showing
28 changed files
with
36,635 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
# 0.48 | ||
|
||
(Issue #190) Now correctly display elements next to a `$ref` with reused nodes, e.g.: | ||
|
||
```json | ||
{ | ||
"$schema": "https://json-schema.org/draft/2019-09/schema", | ||
"type": "object", | ||
"title": "Example", | ||
"properties": { | ||
"prop1": { | ||
"$ref": "#/$defs/a", | ||
"description": "Prop1", | ||
"examples": ["1"] | ||
}, | ||
"prop2": { | ||
"$ref": "#/$defs/a", | ||
"description": "Prop2", | ||
"examples": ["2"] | ||
} | ||
}, | ||
"$defs": { | ||
"a": { | ||
"type": "string", | ||
"maxLength": 5 | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Previously, `prop2` would have been a link to `prop1`, hiding the different example for `prop2`. | ||
|
||
This may increase the size of rendered schemas in certain situations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2019-09/schema", | ||
"type": "object", | ||
"title": "OF", | ||
"properties": { | ||
"uuid": { | ||
"$ref": "#/$defs/ofString", | ||
"description": "Unique Identifer", | ||
"examples": [ | ||
"29292929292929292929292" | ||
] | ||
}, | ||
"firstName": { | ||
"$ref": "#/$defs/ofString", | ||
"description": "first name", | ||
"minLength": 10, | ||
"examples": [ | ||
"John" | ||
] | ||
}, | ||
"lastName": { | ||
"$ref": "#/$defs/ofString", | ||
"description": "last name", | ||
"maxLength": 10, | ||
"examples": [ | ||
"Doe" | ||
] | ||
} | ||
}, | ||
"$defs": { | ||
"ofString": { | ||
"type": "string", | ||
"minLength": 5, | ||
"maxLength": 250 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,15 @@ <h2 class="mb-0"> | |
|
||
|
||
|
||
<a href="#a" class="ref-link">Same definition as a</a> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div> | ||
</div> | ||
|
||
|
171 changes: 171 additions & 0 deletions
171
docs/examples/examples_flat_default/ref_with_other_elements.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
|
||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Overpass:300,400,600,800"> | ||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> | ||
<link rel="stylesheet" type="text/css" href="schema_doc.css"> | ||
<meta charset="utf-8"/> | ||
|
||
|
||
<title>OF</title> | ||
</head> | ||
<body id="root"><h1>OF</h1> | ||
|
||
<div class="breadcrumbs"></div><span class="badge badge-dark value-type">Type: object</span><br/> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="card"> | ||
<div class="card-header" id="uuid"> | ||
<h2 class="mb-0"> | ||
<a href="#uuid"><span class="property-name">uuid</span></a></h2> | ||
</div> | ||
|
||
<div class="card-body property-definition-div"> | ||
|
||
<div class="breadcrumbs">root | ||
<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-arrow-right-short" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
fill-rule="evenodd" | ||
d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" | ||
/> | ||
</svg> | ||
<a href="#uuid">uuid</a></div><span class="badge badge-dark value-type">Type: string</span><br/> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<p>Unique Identifer</p> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<p><span class="badge badge-light restriction min-length-restriction" id="uuid_minLength">Must be at least <code>5</code> characters long</span></p><p><span class="badge badge-light restriction max-length-restriction" id="uuid_maxLength">Must be at most <code>250</code> characters long</span></p> | ||
|
||
<br/> | ||
<div class="badge badge-secondary">Example:</div> | ||
<br/><div id="uuid_ex1" class="jumbotron examples"><div class="highlight"><pre><span></span><span class="s2">"29292929292929292929292"</span> | ||
</pre></div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="card"> | ||
<div class="card-header" id="firstName"> | ||
<h2 class="mb-0"> | ||
<a href="#firstName"><span class="property-name">firstName</span></a></h2> | ||
</div> | ||
|
||
<div class="card-body property-definition-div"> | ||
|
||
<div class="breadcrumbs">root | ||
<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-arrow-right-short" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
fill-rule="evenodd" | ||
d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" | ||
/> | ||
</svg> | ||
<a href="#firstName">firstName</a></div><span class="badge badge-dark value-type">Type: string</span><br/> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<p>first name</p> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<p><span class="badge badge-light restriction min-length-restriction" id="firstName_minLength">Must be at least <code>10</code> characters long</span></p><p><span class="badge badge-light restriction max-length-restriction" id="uuid_maxLength">Must be at most <code>250</code> characters long</span></p> | ||
|
||
<br/> | ||
<div class="badge badge-secondary">Example:</div> | ||
<br/><div id="uuid_ex1" class="jumbotron examples"><div class="highlight"><pre><span></span><span class="s2">"John"</span> | ||
</pre></div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="card"> | ||
<div class="card-header" id="lastName"> | ||
<h2 class="mb-0"> | ||
<a href="#lastName"><span class="property-name">lastName</span></a></h2> | ||
</div> | ||
|
||
<div class="card-body property-definition-div"> | ||
|
||
<div class="breadcrumbs">root | ||
<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-arrow-right-short" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
fill-rule="evenodd" | ||
d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z" | ||
/> | ||
</svg> | ||
<a href="#lastName">lastName</a></div><span class="badge badge-dark value-type">Type: string</span><br/> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<p>last name</p> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<p><span class="badge badge-light restriction min-length-restriction" id="uuid_minLength">Must be at least <code>5</code> characters long</span></p><p><span class="badge badge-light restriction max-length-restriction" id="lastName_maxLength">Must be at most <code>10</code> characters long</span></p> | ||
|
||
<br/> | ||
<div class="badge badge-secondary">Example:</div> | ||
<br/><div id="uuid_ex1" class="jumbotron examples"><div class="highlight"><pre><span></span><span class="s2">"Doe"</span> | ||
</pre></div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<footer> | ||
<p class="generated-by-footer">Generated using <a href="https://github.com/coveooss/json-schema-for-humans">json-schema-for-humans</a></p> | ||
</footer></body> | ||
</html> |
Oops, something went wrong.