-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'deprecated' and updated CHANGELOG and README
- Loading branch information
Andrew Schuster
committed
May 20, 2016
1 parent
c231cb3
commit f3dcb1d
Showing
7 changed files
with
97 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
require 'spec_helper' | ||
|
||
describe 'swagger spec v2.0 deprecation' do | ||
include_context "#{MODEL_PARSER} swagger example" | ||
|
||
def app | ||
Class.new(Grape::API) do | ||
format :json | ||
|
||
desc 'This is a test sample', deprecated: true | ||
get '/old' do | ||
present true | ||
end | ||
|
||
desc 'This is another test sample', deprecated: false | ||
get '/new' do | ||
present true | ||
end | ||
|
||
version 'v1', using: :path | ||
add_swagger_documentation api_version: 'v1', | ||
base_path: '/api', | ||
info: { | ||
title: 'The API title to be displayed on the API homepage.', | ||
description: 'A description of the API.', | ||
contact_name: 'Contact name', | ||
contact_email: 'Contact@email.com', | ||
contact_url: 'Contact URL', | ||
license: 'The name of the license.', | ||
license_url: 'www.The-URL-of-the-license.org', | ||
terms_of_service_url: 'www.The-URL-of-the-terms-and-service.com' | ||
} | ||
end | ||
end | ||
|
||
before do | ||
get '/v1/swagger_doc' | ||
end | ||
|
||
let(:json) { JSON.parse(last_response.body) } | ||
|
||
describe 'deprecation' do | ||
it { expect(json['paths']['/old']['get']['deprecated']).to eql true } | ||
it { expect(json['paths']['/new']['get']).to_not include 'deprecated' } | ||
end | ||
end |