Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Commit 11d23c9

Browse files
author
Matt Allan
committed
Move docs to master [skip ci]
1 parent a330ea1 commit 11d23c9

21 files changed

+719
-1
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
/phpunit.xml.dist export-ignore
99
/.scrutinizer.yml export-ignore
1010
/tests export-ignore
11+
/docs export-ignore

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
build
22
composer.lock
3-
docs
43
vendor

docs/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_site
2+
.sass-cache/
3+
.jekyll-metadata
4+
vendor/
5+
build/
6+
composer.lock

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
json-guard.thephpleague.com

docs/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
group :jekyll_plugins do
4+
gem "github-pages"
5+
gem "jekyll-github-metadata"
6+
end

docs/Gemfile.lock

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
activesupport (4.2.6)
5+
i18n (~> 0.7)
6+
json (~> 1.7, >= 1.7.7)
7+
minitest (~> 5.1)
8+
thread_safe (~> 0.3, >= 0.3.4)
9+
tzinfo (~> 1.1)
10+
addressable (2.4.0)
11+
coffee-script (2.4.1)
12+
coffee-script-source
13+
execjs
14+
coffee-script-source (1.10.0)
15+
colorator (0.1)
16+
ethon (0.9.0)
17+
ffi (>= 1.3.0)
18+
execjs (2.6.0)
19+
faraday (0.9.2)
20+
multipart-post (>= 1.2, < 3)
21+
ffi (1.9.10)
22+
gemoji (2.1.0)
23+
github-pages (78)
24+
github-pages-health-check (= 1.1.0)
25+
jekyll (= 3.0.5)
26+
jekyll-coffeescript (= 1.0.1)
27+
jekyll-feed (= 0.5.1)
28+
jekyll-gist (= 1.4.0)
29+
jekyll-github-metadata (= 1.11.1)
30+
jekyll-mentions (= 1.1.2)
31+
jekyll-paginate (= 1.1.0)
32+
jekyll-redirect-from (= 0.10.0)
33+
jekyll-sass-converter (= 1.3.0)
34+
jekyll-seo-tag (= 1.4.0)
35+
jekyll-sitemap (= 0.10.0)
36+
jemoji (= 0.6.2)
37+
kramdown (= 1.10.0)
38+
liquid (= 3.0.6)
39+
listen (= 3.0.6)
40+
mercenary (~> 0.3)
41+
rouge (= 1.10.1)
42+
terminal-table (~> 1.4)
43+
github-pages-health-check (1.1.0)
44+
addressable (~> 2.3)
45+
net-dns (~> 0.8)
46+
octokit (~> 4.0)
47+
public_suffix (~> 1.4)
48+
typhoeus (~> 0.7)
49+
html-pipeline (2.4.0)
50+
activesupport (>= 2, < 5)
51+
nokogiri (>= 1.4)
52+
i18n (0.7.0)
53+
jekyll (3.0.5)
54+
colorator (~> 0.1)
55+
jekyll-sass-converter (~> 1.0)
56+
jekyll-watch (~> 1.1)
57+
kramdown (~> 1.3)
58+
liquid (~> 3.0)
59+
mercenary (~> 0.3.3)
60+
rouge (~> 1.7)
61+
safe_yaml (~> 1.0)
62+
jekyll-coffeescript (1.0.1)
63+
coffee-script (~> 2.2)
64+
jekyll-feed (0.5.1)
65+
jekyll-gist (1.4.0)
66+
octokit (~> 4.2)
67+
jekyll-github-metadata (1.11.1)
68+
octokit (~> 4.0)
69+
jekyll-mentions (1.1.2)
70+
html-pipeline (~> 2.3)
71+
jekyll (~> 3.0)
72+
jekyll-paginate (1.1.0)
73+
jekyll-redirect-from (0.10.0)
74+
jekyll (>= 2.0)
75+
jekyll-sass-converter (1.3.0)
76+
sass (~> 3.2)
77+
jekyll-seo-tag (1.4.0)
78+
jekyll (~> 3.0)
79+
jekyll-sitemap (0.10.0)
80+
jekyll-watch (1.4.0)
81+
listen (~> 3.0, < 3.1)
82+
jemoji (0.6.2)
83+
gemoji (~> 2.0)
84+
html-pipeline (~> 2.2)
85+
jekyll (>= 3.0)
86+
json (1.8.3)
87+
kramdown (1.10.0)
88+
liquid (3.0.6)
89+
listen (3.0.6)
90+
rb-fsevent (>= 0.9.3)
91+
rb-inotify (>= 0.9.7)
92+
mercenary (0.3.6)
93+
mini_portile2 (2.0.0)
94+
minitest (5.8.4)
95+
multipart-post (2.0.0)
96+
net-dns (0.8.0)
97+
nokogiri (1.6.7.2)
98+
mini_portile2 (~> 2.0.0.rc2)
99+
octokit (4.3.0)
100+
sawyer (~> 0.7.0, >= 0.5.3)
101+
public_suffix (1.5.3)
102+
rb-fsevent (0.9.7)
103+
rb-inotify (0.9.7)
104+
ffi (>= 0.5.0)
105+
rouge (1.10.1)
106+
safe_yaml (1.0.4)
107+
sass (3.4.22)
108+
sawyer (0.7.0)
109+
addressable (>= 2.3.5, < 2.5)
110+
faraday (~> 0.8, < 0.10)
111+
terminal-table (1.5.2)
112+
thread_safe (0.3.5)
113+
typhoeus (0.8.0)
114+
ethon (>= 0.8.0)
115+
tzinfo (1.2.2)
116+
thread_safe (~> 0.1)
117+
118+
PLATFORMS
119+
ruby
120+
121+
DEPENDENCIES
122+
github-pages
123+
jekyll-github-metadata
124+
125+
BUNDLED WITH
126+
1.11.2

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
project docs.

docs/_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repository: thephpleague/json-guard

docs/_data/images.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Path to project specific favicon.ico, leave blank to use default
2+
favicon:
3+
4+
# Path to project specific apple-touch-icon-precomposed.png, leave blank to use default
5+
apple_touch:
6+
7+
# Path to project logo
8+
logo:

docs/_data/menu.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Getting Started:
2+
Introduction: '/'
3+
Simple Example: '/simple-example/'
4+
Installation: '/installation/'
5+
Dereferencing:
6+
Overview: '/dereferencing/overview/'
7+
Circular References: '/dereferencing/circular-references/'
8+
Validation:
9+
Overview: '/validation/overview/'
10+
Errors: '/validation/errors/'
11+
Extending: '/validation/extending/'
12+
FAQ: '/faq'

docs/_data/project.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
title: JSON Guard
2+
tagline: Validation of json-schema.org compliant schemas.
3+
description:
4+
google_analytics_tracking_id:

docs/_layouts/default.html

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
{% if page.url == '/' %}
8+
<title>{{ site.data.project.title }} - {{ site.data.project.tagline }}</title>
9+
{% else %}
10+
<title>{{ page.title }} - {{ site.data.project.title }}</title>
11+
{% endif %}
12+
{% if site.data.project.description %}
13+
<meta name="description" content="{{ site.data.project.description }}">
14+
{% endif %}
15+
{% if site.github.url %}
16+
<base href="{{ site.github.url }}">
17+
{% endif %}
18+
{% if site.data.images.favicon %}
19+
<link rel="icon" type="image/x-icon" href="{{ site.data.images.favicon }}" />
20+
{% else %}
21+
<link rel="icon" type="image/x-icon" href="http://theme.thephpleague.com/img/favicon.ico" />
22+
{% endif %}
23+
{% if site.data.images.apple_touch %}
24+
<link rel="apple-touch-icon-precomposed" href="{{ site.data.images.apple_touch }}">
25+
{% else %}
26+
<link rel="apple-touch-icon-precomposed" href="http://theme.thephpleague.com/img/apple-touch-icon-precomposed.png">
27+
{% endif %}
28+
<link rel="stylesheet" href="http://theme.thephpleague.com/css/all.css">
29+
</head>
30+
<body>
31+
32+
<section class="all_packages">
33+
<a href="http://thephpleague.com/">
34+
<img src="http://theme.thephpleague.com/img/loep_logo.png" width="195" height="200" alt="The League of Extraordinary Packages">
35+
</a>
36+
<h2>Our Packages:</h2>
37+
<ul>
38+
<!-- Loaded via JavaScript -->
39+
</ul>
40+
</section>
41+
42+
<header>
43+
<a class="logo" href="/">
44+
{% if site.data.images.logo %}
45+
<span class="icon">
46+
<img src="{{ site.data.images.logo }}" width="50" height="40" alt="{{ site.data.project.title }} - {{ site.data.project.tagline }}">
47+
</span>
48+
{% endif %}
49+
<span class="name">{{ site.data.project.title }}</span>
50+
<span class="tagline">{{ site.data.project.tagline }}</span>
51+
</a>
52+
<a href="http://thephpleague.com/" class="league">
53+
Presented by The League of Extraordinary Packages
54+
</a>
55+
</header>
56+
57+
<input type="checkbox" id="menu">
58+
<label for="menu" onclick>
59+
<div class="closed">&#9776; Menu</div>
60+
<div class="open">&#9776; Hide Menu</div>
61+
</label>
62+
63+
<main>
64+
<menu>
65+
{% for section in site.data.menu %}
66+
<h2>{{ section[0] }}</h2>
67+
<ul>
68+
{% for link in section[1] %}
69+
<li {% if page.url == link[1] %}class="selected"{% endif %}>
70+
<a href="{{ link[1] }}">{{ link[0] }}</a>
71+
</li>
72+
{% endfor %}
73+
</ul>
74+
{% endfor %}
75+
</menu>
76+
<article>
77+
{{ content }}
78+
</article>
79+
</main>
80+
81+
<footer>
82+
<span>&copy; Copyright <a href="http://thephpleague.com">The League of Extraordinary Packages</a>.</span>
83+
<span>Site design by <a href="http://reinink.ca">Jonathan Reinink</a>.</span>
84+
</footer>
85+
86+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
87+
<script src="http://theme.thephpleague.com/js/scripts.js"></script>
88+
<script src="http://theme.thephpleague.com/js/prism.js"></script>
89+
90+
{% if site.data.project.google_analytics_tracking_id %}
91+
<script>
92+
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
93+
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
94+
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
95+
e.src='//www.google-analytics.com/analytics.js';
96+
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
97+
ga('create','{{ site.data.project.google_analytics_tracking_id }}');ga('send','pageview');
98+
</script>
99+
{% endif %}
100+
101+
</body>
102+
</html>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
layout: default
3+
permalink: dereferencing/circular-references/
4+
title: Circular References
5+
---
6+
7+
# Circular References
8+
9+
This package fully supports recursive references. Consider the following example [^n]:
10+
11+
```json
12+
{
13+
"person": {
14+
"properties": {
15+
"name": {
16+
"type": "string"
17+
},
18+
"spouse": {
19+
"type": {
20+
"$ref": "#/person" // circular reference
21+
}
22+
}
23+
}
24+
}
25+
}
26+
```
27+
28+
## Resolving
29+
30+
If the dereferencer attempted to fully resolve this reference, the dereferencer would continue looping infintely. Instead of resolving references immediately, the $ref is replaced with a [reference object](https://github.com/league/json-guard/blob/master/src/Reference.php).
31+
32+
The reference object is resolved lazily by the validator. The validator will stop resolving once it runs out of data to validate or the maximum depth has been exceeded.
33+
34+
## Serializing
35+
36+
Because a $ref may be circular, attempting to inline the $ref would be impossible.
37+
38+
When serialized, all references are transformed into the original `{ "$ref": "#/some/reference" }` format instead of attempting to inline them.
39+
40+
[^n]: The example is from the [json-schema-ref-parser](https://github.com/BigstickCarpet/json-schema-ref-parser/blob/master/docs/README.md#circular-refs) docs.

0 commit comments

Comments
 (0)