swagger-diff 1.0.2 → 1.0.3

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
  SHA1:
3
- metadata.gz: 638ec30e17eae19c41b449c5131505c8b3d8e5c9
4
- data.tar.gz: 0b02d469a24f0900c609703adac3a799c27e30b4
3
+ metadata.gz: 7ae6fdf94f4dc25c8bfbf9f42bb07ff0ebba67af
4
+ data.tar.gz: 9e8f57a36a415c6b4fc81d0cb3c78d141aa99e8b
5
5
  SHA512:
6
- metadata.gz: fb91efd6e75a08517c1ec0204e7af4cec68f0013d87d1e9ae185221a46fba51703383afe97a26af4659928958da4115040d2af37e5eaf2fe946004a3be53ae3b
7
- data.tar.gz: 6c37666eb4bcfb96fb5b1863008f08099861463101b351af411296a530c9a8671ee3ac38b988ee6def1239ebfd6adaaf0237a6db6bfb139cd133501ebc1de182
6
+ metadata.gz: c00e84cc7383e90c6ef54c58b6f0223148bd7aed155fe5abaf8501620eea913fc8232cf51decf13fdbf05b309dba541db89e4d65b33cbf9a1c731b2cba78423a
7
+ data.tar.gz: fd40d8875ffd46534e3b1780290c8bef4beeb9f21280b862636225ccf954ac541c139d4286210b91653b7ac2e6c29f30a948a2defe68567c08d8c0b48bf6333e
data/.travis.yml CHANGED
@@ -1,5 +1,2 @@
1
1
  language: ruby
2
2
  cache: bundler
3
- script:
4
- - bundle exec rubocop
5
- - bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.0.3 (2015-11-04)
4
+
5
+ ### Changes
6
+
7
+ * Added a default Rake task to run Rubocop and RSpec
8
+ * Added [CONTRIBUTING.md](CONTRIBUTING.md)
9
+
10
+ ### Bugs Fixed
11
+
12
+ * [#8](https://github.com/civisanalytics/swagger-diff/pull/8)
13
+ fixed parsing of header and formData parameters
14
+ * [#10](https://github.com/civisanalytics/swagger-diff/pull/10)
15
+ detect if a parameter's location (*i.e.*, `in` value) changes
16
+
3
17
  ## 1.0.2 (2015-10-08)
4
18
 
5
19
  ### Bugs Fixed
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,27 @@
1
+ # Contributing to Swagger::Diff
2
+
3
+ We welcome pull requests from everyone!
4
+
5
+ ## Getting Started
6
+
7
+ 1. Fork it ( https://github.com/civisanalytics/swagger-diff/fork )
8
+ 2. Install the development dependencies (`bundle install`)
9
+ 3. Make sure you are able to run the test suite locally (`rake`)
10
+ 4. Create a feature branch (`git checkout -b my-new-feature`)
11
+ 5. Make your change. Don't forget tests
12
+ 6. Make sure the test suite, including your new tests, passes (`rake`)
13
+ 7. Commit your changes (`git commit -am 'Add some feature'`)
14
+ 8. Push to the branch (`git push origin my-new-feature`)
15
+ 9. Create a new pull request
16
+ 10. If the Travis build fails, address any issues
17
+
18
+ ## Tips
19
+
20
+ - All pull requests must include test coverage. If you’re not sure how to test
21
+ your changes, feel free to ask for help.
22
+ - Contributions must conform to the
23
+ [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide).
24
+ - Don’t forget to add your change to the [CHANGELOG](CHANGELOG.md). See
25
+ [Keep a CHANGELOG](http://keepachangelog.com/) for guidelines.
26
+
27
+ Thank you for taking the time to contribute to Swagger::Diff!
data/README.md CHANGED
@@ -27,6 +27,8 @@ Specifications are considered backwards compatible if:
27
27
  - all response attributes in the old specification have the same type in the new
28
28
  one
29
29
 
30
+ Read more on the [Civis Analytics blog](https://civisanalytics.com/blog/engineering/2015/10/02/using-swagger-to-detect-breaking-api-changes/).
31
+
30
32
  ## Installation
31
33
 
32
34
  Add this line to your application's Gemfile:
@@ -116,11 +118,7 @@ To release a new version, update the version number in `version.rb`, and then ru
116
118
 
117
119
  ## Contributing
118
120
 
119
- 1. Fork it ( https://github.com/civisanalytics/swagger-diff/fork )
120
- 2. Create your feature branch (`git checkout -b my-new-feature`)
121
- 3. Commit your changes (`git commit -am 'Add some feature'`)
122
- 4. Push to the branch (`git push origin my-new-feature`)
123
- 5. Create a new Pull Request
121
+ See [CONTRIBUTING](CONTRIBUTING.md).
124
122
 
125
123
  ## License
126
124
 
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
1
  require 'bundler/gem_tasks'
2
+
3
+ require 'rspec/core/rake_task'
4
+ RSpec::Core::RakeTask.new
5
+
6
+ require 'rubocop/rake_task'
7
+ RuboCop::RakeTask.new
8
+
9
+ task default: [:rubocop, :spec]
@@ -111,7 +111,7 @@ module Swagger
111
111
  if prefix == "#{name}/" || prefix =~ %r{/#{name}(\[\])?/}
112
112
  # Anonymizing the reference in case the name changed (e.g.,
113
113
  # generated Swagger).
114
- { all: ["#{key} (type: reference)"] }
114
+ { all: ["#{key} (in: body, type: reference)"] }
115
115
  else
116
116
  refs(ref, "#{key}/")
117
117
  end
@@ -124,7 +124,7 @@ module Swagger
124
124
  merge_refs!(ret, nested(schema['$ref'], prefix, name, list))
125
125
  else
126
126
  ret[:required].add(key) if required && required.include?(name)
127
- ret[:all].add("#{key} (type: #{schema.type}#{'[]' if list})")
127
+ ret[:all].add("#{key} (in: body, type: #{schema.type}#{'[]' if list})")
128
128
  end
129
129
  ret
130
130
  end
@@ -148,7 +148,7 @@ module Swagger
148
148
  else
149
149
  '*'
150
150
  end
151
- ret[:all].add("#{prefix}#{name} (type: Hash[string, #{type}])")
151
+ ret[:all].add("#{prefix}#{name} (in: body, type: Hash[string, #{type}])")
152
152
  end
153
153
  else
154
154
  merge_refs!(ret, properties_for_ref(prefix, name, schema, required))
@@ -161,11 +161,11 @@ module Swagger
161
161
  ret = { required: Set.new, all: Set.new }
162
162
  return ret if params.nil?
163
163
  params.each do |param|
164
- if param.in == 'path' || param.in == 'query'
165
- ret[:required].add(param.name) if param.required
166
- ret[:all].add("#{param.name} (type: #{param.type})")
167
- else
164
+ if param.in == 'body'
168
165
  merge_refs!(ret, refs(param.schema['$ref']))
166
+ else
167
+ ret[:required].add(param.name) if param.required
168
+ ret[:all].add("#{param.name} (in: #{param.in}, type: #{param.type})")
169
169
  end
170
170
  end
171
171
  ret
@@ -1,5 +1,5 @@
1
1
  module Swagger
2
2
  module Diff
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
data/swagger-diff.gif CHANGED
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger-diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Cousens
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-08 00:00:00.000000000 Z
11
+ date: 2015-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: swagger-core
@@ -154,6 +154,7 @@ files:
154
154
  - ".ruby-version"
155
155
  - ".travis.yml"
156
156
  - CHANGELOG.md
157
+ - CONTRIBUTING.md
157
158
  - Gemfile
158
159
  - LICENSE.txt
159
160
  - README.md
@@ -194,3 +195,4 @@ signing_key:
194
195
  specification_version: 4
195
196
  summary: Utility for comparing two Swagger specifications.
196
197
  test_files: []
198
+ has_rdoc: