From 4842055ee69d9043132ff7f6702ed23130de5663 Mon Sep 17 00:00:00 2001 From: andrew morton Date: Tue, 13 Sep 2016 06:43:39 -0600 Subject: [PATCH 01/23] Add a contributing file The exact sequence of commands to be able to run the tests wasn't obvious to me so I'm assumiing others could use a hand. I used the factory_girl_rails gem's file as a starting point. --- CONTRIBUTING.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..618eda5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# Contributing + +Fork, then clone the repo: + +``` +git clone git@github.com:your-username/swagger_rails.git +cd swagger_rails +``` + +Set up your machine: + +``` +bundle +cd spec/dummy +bundle exec rake db:setup +cd - +``` + +Make sure the tests pass: + +``` +bundle exec rspec +``` + +Make your change. Add tests for your change. Make the tests pass: + +``` +bundle exec rspec +``` + +Push to your fork and [submit a pull request][pr]. + +[pr]: https://github.com/domaindrivendev/swagger_rails/compare/ From 3eda72155a368edd9273f46638a5824cc4666114 Mon Sep 17 00:00:00 2001 From: Tomasz Czernuszenko Date: Mon, 7 Aug 2017 14:12:40 +0100 Subject: [PATCH 02/23] Updated Readme.md: Added a section on markdown formatting and and clarified some descriptions of API versioning --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 63ed64a..4c1dce4 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,8 @@ RSpec.configure do |config| swagger: '2.0', info: { title: 'API V1', - version: 'v1' + version: 'v1', + description: 'This is the first version of my API' }, basePath: '/api/v1' }, @@ -183,7 +184,8 @@ RSpec.configure do |config| swagger: '2.0', info: { title: 'API V2', - version: 'v2' + version: 'v2', + description: 'This is the second version of my API' }, basePath: '/api/v2' } @@ -191,7 +193,8 @@ RSpec.configure do |config| end ``` -__NOTE__: By default, the paths, operations and responses defined in your spec files will be associated with the first Swagger document in _swagger_helper.rb_. If you're using multiple documents, you'll need to tag the individual specs with their target document name: +#### Supporting multiple versions of API #### +By default, the paths, operations and responses defined in your spec files will be associated with the first Swagger document in _swagger_helper.rb_. If your API has multiple versions, you should be using separate documents to describe each of them. In order to assign a file with a given version of API, you'll need to add the ```swagger_doc``` tag to each spec specifying its target document name: ```ruby # spec/integration/v2/blogs_spec.rb @@ -205,6 +208,25 @@ describe 'Blogs API', swagger_doc: 'v2/swagger.json' do end ``` +#### Formatting the description literals: #### +Swagger supports the Markdown syntax to format strings. This can be especially handy if you were to provide a long description of a given API version or endpoint. Use [this guide](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) for reference. + +__NOTE:__ There is one difference between the official Markdown syntax and Swagger interpretation, namely tables. To create a table like this: + +| Column1 | Collumn2 | +| ------- | -------- | +| cell1 | cell2 | + +you should use the folowing syntax, making sure there are no whitespaces at the start of any of the lines: + +``` + +| Column1 | Collumn2 | +| ------- | -------- | +| cell1 | cell2 | + +``` + ### Specifying/Testing API Security ### Swagger allows for the specification of different security schemes and their applicability to operations in an API. To leverage this in rswag, you define the schemes globally in _swagger_helper.rb_ and then use the "security" attribute at the operation level to specify which schemes, if any, are applicable to that operation. Swagger supports :basic, :apiKey and :oauth2 scheme types. See [the spec](http://swagger.io/specification/#security-definitions-object-109) for more info. From 9642937ee25f224888d04eabee39c607e1abc837 Mon Sep 17 00:00:00 2001 From: Greg Myers Date: Tue, 18 Dec 2018 13:29:40 +0000 Subject: [PATCH 03/23] Update swagger_helper.rb Use standard filesystem helpers to avoid OS specific slash errors. --- .../generators/rswag/specs/install/templates/swagger_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rswag-specs/lib/generators/rswag/specs/install/templates/swagger_helper.rb b/rswag-specs/lib/generators/rswag/specs/install/templates/swagger_helper.rb index 3d27729..3855920 100644 --- a/rswag-specs/lib/generators/rswag/specs/install/templates/swagger_helper.rb +++ b/rswag-specs/lib/generators/rswag/specs/install/templates/swagger_helper.rb @@ -4,7 +4,7 @@ RSpec.configure do |config| # Specify a root folder where Swagger JSON files are generated # NOTE: If you're using the rswag-api to serve API descriptions, you'll need # to ensure that it's configured to serve Swagger from the same folder - config.swagger_root = Rails.root.to_s + '/swagger' + config.swagger_root = Rails.root.join('swagger').to_s # Define one or more Swagger documents and provide global metadata for each one # When you run the 'rswag:specs:swaggerize' rake task, the complete Swagger will From e381bf85d4e927474777a0ad48228b85a954678c Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Sat, 22 Dec 2018 15:20:38 +0700 Subject: [PATCH 04/23] Show response body when the response code is unexpected. Makes it much easier to debug test failures --- rswag-specs/lib/rswag/specs/response_validator.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rswag-specs/lib/rswag/specs/response_validator.rb b/rswag-specs/lib/rswag/specs/response_validator.rb index 5b366ce..c3e363f 100644 --- a/rswag-specs/lib/rswag/specs/response_validator.rb +++ b/rswag-specs/lib/rswag/specs/response_validator.rb @@ -14,17 +14,19 @@ module Rswag def validate!(metadata, response) swagger_doc = @config.get_swagger_doc(metadata[:swagger_doc]) - validate_code!(metadata, response.code) + validate_code!(metadata, response) validate_headers!(metadata, response.headers) validate_body!(metadata, swagger_doc, response.body) end private - def validate_code!(metadata, code) + def validate_code!(metadata, response) expected = metadata[:response][:code].to_s - if code != expected - raise UnexpectedResponse, "Expected response code '#{code}' to match '#{expected}'" + if response.code != expected + raise UnexpectedResponse, + "Expected response code '#{response.code}' to match '#{expected}'\n" \ + "Response body: #{response.body}" end end From f969fb6573f67a6e1e53cf66b8a776f9bec4cb6e Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Wed, 17 Apr 2019 14:46:26 +0200 Subject: [PATCH 05/23] CONTRIBUTING: Correct URL --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 618eda5..46eb827 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,8 +3,8 @@ Fork, then clone the repo: ``` -git clone git@github.com:your-username/swagger_rails.git -cd swagger_rails +git clone git@github.com:domaindrivendev/rswag.git +cd rswag ``` Set up your machine: @@ -28,6 +28,6 @@ Make your change. Add tests for your change. Make the tests pass: bundle exec rspec ``` -Push to your fork and [submit a pull request][pr]. +Push to your fork and [submit a Pull Request][pr]. -[pr]: https://github.com/domaindrivendev/swagger_rails/compare/ +[pr]: https://github.com/domaindrivendev/rswag/compare/ From a00145c1f77776ac18e2303d049aa093a95f22e1 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Tue, 20 Aug 2019 16:51:27 +0300 Subject: [PATCH 06/23] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ac0e3e..9e2259f 100644 --- a/README.md +++ b/README.md @@ -486,7 +486,7 @@ Rswag::Api.configure do |c| end ``` -Note how the filter is passed the rack env for the current request. This provides a lot of flexibilty. For example, you can assign the "host" property (as shown) or you could inspect session information or an Authoriation header and remove operations based on user permissions. +Note how the filter is passed the rack env for the current request. This provides a lot of flexibilty. For example, you can assign the "host" property (as shown) or you could inspect session information or an Authorization header and remove operations based on user permissions. ### Enable Swagger Endpoints for swagger-ui ### From ac65dc17803b915e0770f7b0ca2b11afb573cdd3 Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Sun, 25 Aug 2019 22:35:54 -0300 Subject: [PATCH 07/23] Gemfile / gemspec files compatible with Rails 6 --- .ruby-version | 2 +- Gemfile | 2 +- rswag-api/rswag-api.gemspec | 2 +- rswag-specs/rswag-specs.gemspec | 4 ++-- rswag-ui/rswag-ui.gemspec | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.ruby-version b/.ruby-version index 2bf1c1c..ec1cf33 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.1 +2.6.3 diff --git a/Gemfile b/Gemfile index bbd3d73..d351ace 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ gem 'rails', "#{rails_version}" case rails_version.split('.').first when '3' gem 'strong_parameters' -when '4', '5' +when '4', '5', '6' gem 'responders' end diff --git a/rswag-api/rswag-api.gemspec b/rswag-api/rswag-api.gemspec index 299172d..3a14bb2 100644 --- a/rswag-api/rswag-api.gemspec +++ b/rswag-api/rswag-api.gemspec @@ -13,5 +13,5 @@ Gem::Specification.new do |s| s.files = Dir["{lib}/**/*"] + ["MIT-LICENSE", "Rakefile"] - s.add_dependency 'railties', '>= 3.1', '< 6.0' + s.add_dependency 'railties', '>= 3.1', '< 6.1' end diff --git a/rswag-specs/rswag-specs.gemspec b/rswag-specs/rswag-specs.gemspec index 0e4686e..e3ddaf3 100644 --- a/rswag-specs/rswag-specs.gemspec +++ b/rswag-specs/rswag-specs.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |s| s.files = Dir["{lib}/**/*"] + ["MIT-LICENSE", "Rakefile" ] - s.add_dependency 'activesupport', '>= 3.1', '< 6.0' - s.add_dependency 'railties', '>= 3.1', '< 6.0' + s.add_dependency 'activesupport', '>= 3.1', '< 6.1' + s.add_dependency 'railties', '>= 3.1', '< 6.1' s.add_dependency 'json-schema', '~> 2.2' end diff --git a/rswag-ui/rswag-ui.gemspec b/rswag-ui/rswag-ui.gemspec index 5b53548..1584470 100644 --- a/rswag-ui/rswag-ui.gemspec +++ b/rswag-ui/rswag-ui.gemspec @@ -13,6 +13,6 @@ Gem::Specification.new do |s| s.files = Dir.glob("{lib,node_modules}/**/*") + ["MIT-LICENSE", "Rakefile" ] - s.add_dependency 'actionpack', '>=3.1', '< 6.0' - s.add_dependency 'railties', '>= 3.1', '< 6.0' + s.add_dependency 'actionpack', '>=3.1', '< 6.1' + s.add_dependency 'railties', '>= 3.1', '< 6.1' end From 621d6f47540df542a451d330386dde452365f4a4 Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Sun, 25 Aug 2019 22:37:22 -0300 Subject: [PATCH 08/23] Updating travis file and adding Rails 6 to build matrix --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bdf321a..ce0f6fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,17 @@ language: ruby rvm: - - 2.2.5 + - 2.6.3 env: + - RAILS_VERSION=6.0.0 - RAILS_VERSION=5.2.0 - RAILS_VERSION=4.2.0 - RAILS_VERSION=3.2.22 cache: directories: - - /home/travis/.rvm/gems/ruby-2.2.5 + - /home/travis/.rvm/gems/ruby-2.6.3 install: ./ci/build.sh From 16458d458ac3adfdb8b8b021afeac9fddd7444c6 Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Sun, 25 Aug 2019 22:45:12 -0300 Subject: [PATCH 09/23] Adding extra lib to fix build --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index ce0f6fd..2327462 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,12 @@ env: - RAILS_VERSION=4.2.0 - RAILS_VERSION=3.2.22 +addons: + apt: + packages: + - libqtwebkit-dev + - libqtwebkit4 + cache: directories: - /home/travis/.rvm/gems/ruby-2.6.3 From 7179802fe07e5650375dfa17d78bd981522fcbf1 Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Sun, 25 Aug 2019 22:50:28 -0300 Subject: [PATCH 10/23] Using alternative config for xfvb --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2327462..2e9171b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,9 @@ language: ruby +dist: xenial +services: + - xvfb + rvm: - 2.6.3 @@ -21,11 +25,6 @@ cache: install: ./ci/build.sh -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - - sleep 3 - script: ./ci/test.sh jobs: From d37933801716d6e6ff3a30053d95512f81b65d4f Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Sun, 25 Aug 2019 23:00:07 -0300 Subject: [PATCH 11/23] Enforce SQlite version --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d351ace..a688e2c 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ when '4', '5', '6' gem 'responders' end -gem 'sqlite3' +gem 'sqlite3', '1.4.1' gem 'rswag-api', path: './rswag-api' gem 'rswag-ui', path: './rswag-ui' From 586d0211ff06f33023c49ad4bfc427afa6a25095 Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Sun, 25 Aug 2019 23:06:19 -0300 Subject: [PATCH 12/23] Force SQlite 1.3 version --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index a688e2c..c9ebb7b 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ when '4', '5', '6' gem 'responders' end -gem 'sqlite3', '1.4.1' +gem 'sqlite3', '~> 1.3.6' gem 'rswag-api', path: './rswag-api' gem 'rswag-ui', path: './rswag-ui' From 91a0f88eb5d96753cbda8593ed75dcb2b1c4671f Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Sun, 25 Aug 2019 23:11:57 -0300 Subject: [PATCH 13/23] Use different Sqlite versions for Rails versions --- Gemfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index c9ebb7b..c9d5c4e 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,12 @@ when '4', '5', '6' gem 'responders' end -gem 'sqlite3', '~> 1.3.6' +case rails_version.split('.').first +when '3', '4', '5' + gem 'sqlite3', '~> 1.3.6' +when '6' + gem 'sqlite3', '~> 1.4.1' +end gem 'rswag-api', path: './rswag-api' gem 'rswag-ui', path: './rswag-ui' From 81f8e0dbaff7aef176991808e31f56054d00856a Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Sun, 25 Aug 2019 23:19:03 -0300 Subject: [PATCH 14/23] Removing Rails 3/4 - they are not supported by the Rails Core Team --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e9171b..f9edbb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,6 @@ rvm: env: - RAILS_VERSION=6.0.0 - RAILS_VERSION=5.2.0 - - RAILS_VERSION=4.2.0 - - RAILS_VERSION=3.2.22 addons: apt: From 6c684729d11336fb77365d0a04214f3151c2d089 Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Mon, 23 Sep 2019 22:56:24 -0300 Subject: [PATCH 15/23] Use updated ruby version --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index ec1cf33..2714f53 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.3 +2.6.4 From 4bdbd7ed9843e6e1fb10e0e414f53f67e9d71608 Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Mon, 23 Sep 2019 23:03:09 -0300 Subject: [PATCH 16/23] Use updated ruby on CI too --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f9edbb2..304c64c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ services: - xvfb rvm: - - 2.6.3 + - 2.6.4 env: - RAILS_VERSION=6.0.0 @@ -19,7 +19,7 @@ addons: cache: directories: - - /home/travis/.rvm/gems/ruby-2.6.3 + - /home/travis/.rvm/gems/ruby-2.6.4 install: ./ci/build.sh From b7a6b2de8bbe6f07ec5b3025f277c5d55ffae47f Mon Sep 17 00:00:00 2001 From: Greg Myers Date: Mon, 30 Sep 2019 21:06:14 +0100 Subject: [PATCH 17/23] Update README.md Repoint readme links --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ac0e3e..e783234 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ rswag ========= -[![Build Status](https://travis-ci.org/domaindrivendev/rswag.svg?branch=master)](https://travis-ci.org/domaindrivendev/rswag) +[![Build Status](https://travis-ci.org/rswag/rswag.svg?branch=master)](https://travis-ci.org/rswag/rswag) [Swagger](http://swagger.io) tooling for Rails API's. Generate beautiful API documentation, including a UI to explore and test operations, directly from your rspec integration tests. @@ -14,9 +14,9 @@ Once you have an API that can describe itself in Swagger, you've opened the trea |Rswag Version|Swagger (OpenAPI) Spec.|swagger-ui| |----------|----------|----------| -|[master](https://github.com/domaindrivendev/rswag/tree/master)|2.0|3.17.3| -|[2.0.5](https://github.com/domaindrivendev/rswag/tree/2.0.4)|2.0|3.17.3| -|[1.6.0](https://github.com/domaindrivendev/rswag/tree/1.6.0)|2.0|2.2.5| +|[master](https://github.com/rswag/rswag/tree/master)|2.0|3.17.3| +|[2.0.5](https://github.com/rswag/rswag/tree/2.0.4)|2.0|3.17.3| +|[1.6.0](https://github.com/rswag/rswag/tree/1.6.0)|2.0|2.2.5| ## Getting Started ## From 8bdf3eac083915ecae1e94bdab8afcc756441b39 Mon Sep 17 00:00:00 2001 From: Greg Myers Date: Wed, 2 Oct 2019 13:50:56 +0100 Subject: [PATCH 18/23] Update the contributing doc, referencing the CI files --- CONTRIBUTING.md | 26 +++++++++++++++++++------- test-app/db/schema.rb | 12 ++++++------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 46eb827..f406098 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,24 +1,36 @@ # Contributing -Fork, then clone the repo: - +## Fork, then clone the repo: ``` -git clone git@github.com:domaindrivendev/rswag.git +git clone git@github.com:rswag/rswag.git cd rswag ``` +## Build Set up your machine: - +``` +./ci/build.sh +``` +Or manually ``` bundle -cd spec/dummy +cd test-app bundle exec rake db:setup cd - + +cd rswag-ui +npm install +cd - ``` +## Test Make sure the tests pass: - ``` +./ci/test.sh +``` +or manually +``` +cd test-app bundle exec rspec ``` @@ -30,4 +42,4 @@ bundle exec rspec Push to your fork and [submit a Pull Request][pr]. -[pr]: https://github.com/domaindrivendev/rswag/compare/ +[pr]: https://github.com/rswag/rswag/compare/ diff --git a/test-app/db/schema.rb b/test-app/db/schema.rb index 8accba1..e01f8f3 100644 --- a/test-app/db/schema.rb +++ b/test-app/db/schema.rb @@ -2,15 +2,15 @@ # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). +# This file is the source Rails uses to define your schema when running `rails +# db:schema:load`. When creating a new database, `rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160218212104) do +ActiveRecord::Schema.define(version: 2016_02_18_212104) do create_table "blogs", force: :cascade do |t| t.string "title" From 3329c1ec55555c7adbc66ce17aca457cc88afe02 Mon Sep 17 00:00:00 2001 From: Greg Myers Date: Wed, 2 Oct 2019 14:10:12 +0100 Subject: [PATCH 19/23] Add Changelog Fix #38 --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8d7499e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ +# rswag +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Added +- Support for Rails 6 [#228](https://github.com/rswag/rswag/pull/228) +- Support for Windows paths [#176](https://github.com/rswag/rswag/pull/176) +### Changed +- Show response body when error code is not expected [#117](https://github.com/rswag/rswag/pull/177) +### Deprecated +### Removed +### Fixed +### Security + +## [2.0.5] - 2018-07-10 \ No newline at end of file From a3aa56e2df23a7367f7ae1568f8ee874bbb66162 Mon Sep 17 00:00:00 2001 From: Greg Myers Date: Thu, 3 Oct 2019 22:37:48 +0100 Subject: [PATCH 20/23] Add a message on how to release to contributing guide --- CHANGELOG.md | 10 +++++++++- CONTRIBUTING.md | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d7499e..0a8b599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +### Changed +### Deprecated +### Removed +### Fixed +### Security + +## [2.0.6] - 2019-10-03 +### Added - Support for Rails 6 [#228](https://github.com/rswag/rswag/pull/228) - Support for Windows paths [#176](https://github.com/rswag/rswag/pull/176) ### Changed @@ -15,4 +23,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security -## [2.0.5] - 2018-07-10 \ No newline at end of file +## [2.0.5] - 2018-07-10 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f406098..c22b355 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,3 +43,17 @@ bundle exec rspec Push to your fork and [submit a Pull Request][pr]. [pr]: https://github.com/rswag/rswag/compare/ + +## Release +(for maintainers) + +Update the changelog.md, putting the new version number in and moving the Unreleased marker. + +Merge the changes into master you wish to release. + +Add and push a new git tag, annotated tags preferred: +``` +git tag -s 2.0.6 -m 'v2.0.6' +``` + +Travis will detect the tag and release all gems with that tag version number. From 0246ff164fcd418969d6309af257ed1bbb007b6e Mon Sep 17 00:00:00 2001 From: Greg Myers Date: Thu, 3 Oct 2019 23:00:27 +0100 Subject: [PATCH 21/23] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 045cda0..267b563 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Once you have an API that can describe itself in Swagger, you've opened the trea |Rswag Version|Swagger (OpenAPI) Spec.|swagger-ui| |----------|----------|----------| |[master](https://github.com/rswag/rswag/tree/master)|2.0|3.17.3| -|[2.0.5](https://github.com/rswag/rswag/tree/2.0.4)|2.0|3.17.3| +|[2.0.6](https://github.com/rswag/rswag/tree/2.0.6)|2.0|3.17.3| |[1.6.0](https://github.com/rswag/rswag/tree/1.6.0)|2.0|2.2.5| ## Getting Started ## From 5c9154864e90115c299eea87308d0332da97514a Mon Sep 17 00:00:00 2001 From: Peter McCready Date: Fri, 4 Oct 2019 14:51:41 +0100 Subject: [PATCH 22/23] add options and trace verbs --- rswag-specs/lib/rswag/specs/example_group_helpers.rb | 2 +- .../spec/rswag/specs/example_group_helpers_spec.rb | 2 +- test-app/db/schema.rb | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rswag-specs/lib/rswag/specs/example_group_helpers.rb b/rswag-specs/lib/rswag/specs/example_group_helpers.rb index c293c63..4939abb 100644 --- a/rswag-specs/lib/rswag/specs/example_group_helpers.rb +++ b/rswag-specs/lib/rswag/specs/example_group_helpers.rb @@ -7,7 +7,7 @@ module Rswag describe(template, metadata, &block) end - [ :get, :post, :patch, :put, :delete, :head ].each do |verb| + [ :get, :post, :patch, :put, :delete, :head, :options, :trace ].each do |verb| define_method(verb) do |summary, &block| api_metadata = { operation: { verb: verb, summary: summary } } describe(verb, api_metadata, &block) diff --git a/rswag-specs/spec/rswag/specs/example_group_helpers_spec.rb b/rswag-specs/spec/rswag/specs/example_group_helpers_spec.rb index 619a8d7..c870bfc 100644 --- a/rswag-specs/spec/rswag/specs/example_group_helpers_spec.rb +++ b/rswag-specs/spec/rswag/specs/example_group_helpers_spec.rb @@ -24,7 +24,7 @@ module Rswag end end - describe '#get|post|patch|put|delete|head(verb, summary)' do + describe '#get|post|patch|put|delete|head|options|trace(verb, summary)' do before { subject.post('Creates a blog') } it "delegates to 'describe' with 'operation' metadata" do diff --git a/test-app/db/schema.rb b/test-app/db/schema.rb index e01f8f3..8accba1 100644 --- a/test-app/db/schema.rb +++ b/test-app/db/schema.rb @@ -2,15 +2,15 @@ # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# This file is the source Rails uses to define your schema when running `rails -# db:schema:load`. When creating a new database, `rails db:schema:load` tends to -# be faster and is potentially less error prone than running all of your -# migrations from scratch. Old migrations may fail to apply correctly if those -# migrations use external dependencies or application code. +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2016_02_18_212104) do +ActiveRecord::Schema.define(version: 20160218212104) do create_table "blogs", force: :cascade do |t| t.string "title" From dc2ebd94bb701883581bd1b92db6d77766bb4285 Mon Sep 17 00:00:00 2001 From: Hayley Date: Tue, 8 Oct 2019 16:18:55 +0100 Subject: [PATCH 23/23] update swagger ui to 3.18.2 --- CHANGELOG.md | 1 + README.md | 2 +- rswag-ui/package-lock.json | 6 +++--- rswag-ui/package.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a8b599..7f30a85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added ### Changed +- Update swagger-ui to 3.18.2 ### Deprecated ### Removed ### Fixed diff --git a/README.md b/README.md index 267b563..3cfff07 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Once you have an API that can describe itself in Swagger, you've opened the trea |Rswag Version|Swagger (OpenAPI) Spec.|swagger-ui| |----------|----------|----------| -|[master](https://github.com/rswag/rswag/tree/master)|2.0|3.17.3| +|[master](https://github.com/rswag/rswag/tree/master)|2.0|3.18.2| |[2.0.6](https://github.com/rswag/rswag/tree/2.0.6)|2.0|3.17.3| |[1.6.0](https://github.com/rswag/rswag/tree/1.6.0)|2.0|2.2.5| diff --git a/rswag-ui/package-lock.json b/rswag-ui/package-lock.json index 664d3fa..144573b 100644 --- a/rswag-ui/package-lock.json +++ b/rswag-ui/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "swagger-ui-dist": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-3.17.3.tgz", - "integrity": "sha1-37lkCMzEZ3UVX3NpGQxdSyAW/lw=" + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-3.18.2.tgz", + "integrity": "sha512-pWAEiKkgWUJvjmLW9AojudnutJ+NTn5g6OdNLj1iIJWwCkoy40K3Upwa24DqFbmIE4vLX4XplND61hp2L+s5vg==" } } } diff --git a/rswag-ui/package.json b/rswag-ui/package.json index 1fce627..27dbc6c 100644 --- a/rswag-ui/package.json +++ b/rswag-ui/package.json @@ -3,6 +3,6 @@ "version": "1.0.0", "private": true, "dependencies": { - "swagger-ui-dist": "3.17.3" + "swagger-ui-dist": "3.18.2" } }