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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d88fe73f27e482546009e28c3810e92241f3f4cc
4
- data.tar.gz: 5ac90aac06f9a6619476b8a93e3b5e5d87058835
3
+ metadata.gz: 47212adcccb0edfe8f1058feabc603ea3e1939eb
4
+ data.tar.gz: 8bbe1b9d189ee522f672e1631478d3c9feb0cf32
5
5
  SHA512:
6
- metadata.gz: 9c678821956ee4d4a7733c06ca1f8146577e8e31f947a14d77361cfc7c55c4aae8615fc01dfb4409ecf6b2950d32001a308acd1f7063a25f1ca7c9bc7a12a364
7
- data.tar.gz: d7fe7d672443830ae9c667ec65bde92fbc6280b6e2ac34305ce987cc8b4c1c6c318ab23a49269088fd84404cfc623e287537d458b2ce8140184cf5caf318ad79
6
+ metadata.gz: ec46ebe280c77d5ec82fba05aad22084e64b9d1dc6820587a06c1575f7f30d49ce61a5dbd4b73dbdce976941f6fce9738ed356399e2f73bbed76a9475e2f6546
7
+ data.tar.gz: d6bf92c7f97e02219ccef2dec8f18de0490aa246f54c359f95862215ddab7908f4a8d8706578596cb0957b30f03e0e02541cca9cc6b20590f651c0024f332fc1
data/CHANGELOG CHANGED
@@ -3,6 +3,12 @@ CHANGELOG
3
3
 
4
4
  This project does *not* adhere to Semantic Versioning
5
5
 
6
+ ## 0.0.9 - 2015-03-02
7
+
8
+ ### Fixed
9
+
10
+ - Generated JSON Schema no-longer include the displayName attribute from RAML
11
+
6
12
  ## 0.0.8 - 2015-02-25
7
13
 
8
14
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jekyll-ramler'
3
- s.version = '0.0.8'
3
+ s.version = '0.0.9'
4
4
  s.date = '2015-02-09'
5
5
  s.authors = ['GovDelivery']
6
6
  s.email = 'support@govdelivery.com'
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 is not a supported keyword in JSON Schema
88
- if param.include?('repeat')
89
- param.delete('repeat')
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']))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-ramler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - GovDelivery