json-schema-docs 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3049cd9fed945058bbd3d668f0cda02d75f50aa114ea0e93e7aa3ed17313011b
|
|
4
|
+
data.tar.gz: f247ed95de772c8461e7022dc12a1d922288cb9b85d4d259c2a904ccfb09bae3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce9a9ef62d0216c5f7fb110850c71d2b1f9da4738f12eb204fa588d22078ba046361907b0594fb9fc8ec919fb52b16060f8c6ffd163d17251ceeeb60228f1b25
|
|
7
|
+
data.tar.gz: 180f02533338faa832fe751eea09c7cde31ee9abcb81e4d19b384bb09d3dc2a29313cc1e882b17a97497f01640b738906890666766d1964a08ec04eae7b702cf
|
data/.gitignore
CHANGED
|
@@ -24,10 +24,10 @@ module JsonSchemaDocs
|
|
|
24
24
|
|
|
25
25
|
@parsed_schema.each_pair do |resource, schemata|
|
|
26
26
|
%i(endpoint object).each do |type|
|
|
27
|
-
contents = render(type, schemata)
|
|
27
|
+
contents = render(type, resource, schemata)
|
|
28
28
|
write_file(type, resource, contents)
|
|
29
29
|
|
|
30
|
-
contents = render(type, schemata)
|
|
30
|
+
contents = render(type, resource, schemata)
|
|
31
31
|
write_file(type, resource, contents)
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -35,10 +35,11 @@ module JsonSchemaDocs
|
|
|
35
35
|
|
|
36
36
|
private
|
|
37
37
|
|
|
38
|
-
def render(type, schemata)
|
|
38
|
+
def render(type, resource, schemata)
|
|
39
39
|
layout = instance_variable_get("@json_schema_#{type}_template")
|
|
40
40
|
opts = @options.merge(helper_methods)
|
|
41
41
|
|
|
42
|
+
opts[:schemata_resource] = resource
|
|
42
43
|
opts[:schemata] = schemata
|
|
43
44
|
layout.result(OpenStruct.new(opts).instance_eval { binding })
|
|
44
45
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# <a class="header-link" name="resource-<%= slugify.(schemata['title']) %>"><%= schemata['title'] %></a>
|
|
2
2
|
|
|
3
|
-
<%
|
|
3
|
+
<% schemata['links'].each do |link, datum| %>
|
|
4
4
|
|
|
5
5
|
## <a class="header-link" name="link-<%= link['method'] %>-<%= resource %>-<%= link['href'] %>"><%= schemata['title'] %> <%= link['title'] %></a>
|
|
6
6
|
|
|
@@ -44,8 +44,10 @@ module JsonSchemaDocs
|
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
+
schemata['links'] ||= []
|
|
48
|
+
|
|
47
49
|
# establish full link description
|
|
48
|
-
|
|
50
|
+
schemata['links'].each do |link, datum|
|
|
49
51
|
link_path = build_link_path(@schema, link)
|
|
50
52
|
response_example = link['response_example']
|
|
51
53
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: json-schema-docs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Garen Torikian
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-09-
|
|
11
|
+
date: 2019-09-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: prmd
|