jekyll-ramler 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/jekyll-ramler.gemspec +1 -1
- data/lib/utils.rb +3 -4
- data/spec/spec_helper.rb +2 -0
- data/spec/utils_raml_schema_generator_spec.rb +8 -0
- 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: 47212adcccb0edfe8f1058feabc603ea3e1939eb
|
4
|
+
data.tar.gz: 8bbe1b9d189ee522f672e1631478d3c9feb0cf32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec46ebe280c77d5ec82fba05aad22084e64b9d1dc6820587a06c1575f7f30d49ce61a5dbd4b73dbdce976941f6fce9738ed356399e2f73bbed76a9475e2f6546
|
7
|
+
data.tar.gz: d6bf92c7f97e02219ccef2dec8f18de0490aa246f54c359f95862215ddab7908f4a8d8706578596cb0957b30f03e0e02541cca9cc6b20590f651c0024f332fc1
|
data/CHANGELOG
CHANGED
data/jekyll-ramler.gemspec
CHANGED
data/lib/utils.rb
CHANGED
@@ -84,10 +84,9 @@ module Jekyll
|
|
84
84
|
param['description'] = Jekyll::sanatize_json_string(param['description'])
|
85
85
|
end
|
86
86
|
|
87
|
-
# Repeat
|
88
|
-
|
89
|
-
|
90
|
-
end
|
87
|
+
# Repeat and displayName are not supported keywords in JSON Schema
|
88
|
+
param.delete('repeat')
|
89
|
+
param.delete('displayName')
|
91
90
|
end
|
92
91
|
schema_hash['required'] = required_properties if not required_properties.empty?
|
93
92
|
|
data/spec/spec_helper.rb
CHANGED
@@ -30,11 +30,13 @@ def example_raml_hash
|
|
30
30
|
'application/x-www-form-urlencoded' => {
|
31
31
|
'formParameters' => {
|
32
32
|
'foo' => {
|
33
|
+
'displayName' => 'foo',
|
33
34
|
'description' => 'Fooing',
|
34
35
|
'type' => 'string',
|
35
36
|
'example' => 'Foo'
|
36
37
|
},
|
37
38
|
'bar' => {
|
39
|
+
'displayName' => 'bar',
|
38
40
|
'description' => 'A place to get a drink',
|
39
41
|
'type' => 'object'
|
40
42
|
}
|
@@ -17,6 +17,14 @@ describe 'Utils' do
|
|
17
17
|
expect(json_schema['properties']).to eq(JSON.parse(simple_schema)['properties'])
|
18
18
|
end
|
19
19
|
|
20
|
+
it 'creates a JSON Schema string that does not include unsupported RAML keywords' do
|
21
|
+
json_schema = JSON.parse(@rsg.generate_json_schema(@raml_hash['resources']['/test_resource']['post']) )
|
22
|
+
json_schema['properties'].each do |prop|
|
23
|
+
expect(prop).not_to include('repeat')
|
24
|
+
expect(prop).not_to include('displayName')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
20
28
|
it 'creates a JSON Schema with a required attribute if application/x-www-form-urlencoded:formParameters includes a required parameter' do
|
21
29
|
@raml_hash['resources']['/test_resource']['post']['body']['application/x-www-form-urlencoded']['formParameters']['bar']['required'] = true
|
22
30
|
json_schema = JSON.parse(@rsg.generate_json_schema(@raml_hash['resources']['/test_resource']['post']))
|