jdoc 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/jdoc/generator.rb +2 -0
- data/lib/jdoc/link.rb +8 -1
- data/lib/jdoc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32fedb39817ea5f19c6fdd4f058715150348b50d
|
4
|
+
data.tar.gz: 046bbaaf9e08fb214ee5eca23c80c3f73ab34ebf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f67afb16cbcdea69460fd56253d371b84b84aacb88bdea7115331c8fd9e9b0f4633499cef1ed853f0691de56d569eb9834bc869b2211db05051b7a7c80f2515a
|
7
|
+
data.tar.gz: 521e04c49a756ae3e3e86058b0c070c49b67f3be906fd21adc8219516277352e1e81a808b352c92c75f39a7c8325c938106b3c922f0e6f1b218f1d7455f3cf5c
|
data/CHANGELOG.md
CHANGED
data/lib/jdoc/generator.rb
CHANGED
data/lib/jdoc/link.rb
CHANGED
@@ -63,11 +63,18 @@ module Jdoc
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# @returns [String] Path with embedded example variable
|
66
|
+
# @raise [Rack::Spec::Mock::ExampleNotFound]
|
66
67
|
# @example
|
67
68
|
# link.example_path #=> "GET /apps/1"
|
68
69
|
def example_path
|
69
70
|
@example_path ||= @raw_link.href.gsub(/{\((.+?)\)}/) do
|
70
|
-
|
71
|
+
pointer = CGI.unescape($1)
|
72
|
+
value = JsonPointer.evaluate(root_schema.data, pointer)
|
73
|
+
if value && value["example"]
|
74
|
+
value["example"]
|
75
|
+
else
|
76
|
+
raise ExampleNotFound, "No example found for #{pointer}"
|
77
|
+
end
|
71
78
|
end
|
72
79
|
end
|
73
80
|
|
data/lib/jdoc/version.rb
CHANGED