Skip to content

Commit

Permalink
removes overiding default trough example
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Scholz committed Apr 22, 2016
1 parent ff42b8e commit e58b827
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

#### Fixes

* [#394](https://github.com/ruby-grape/grape-swagger/pull/394): removes overiding default trough example - [@LeFnord](https://github.com/LeFnord).
* [#393](https://github.com/ruby-grape/grape-swagger/pull/393): properly handle header parameters - [@wleeper](https://github.com/wleeper).
* [#389](https://github.com/ruby-grape/grape-swagger/pull/389): respect X-Forwarded-Host - [@edvakf](https://github.com/edvakf).
* [#393](https://github.com/ruby-grape/grape-swagger/pull/393): properly handle header parameters- [@wleeper](https://github.com/wleeper).

### 0.20.1 / 2016-04-17

Expand Down
6 changes: 1 addition & 5 deletions lib/grape-swagger/doc_methods/parse_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ def document_range_values(settings)
end

def document_default_value(settings)
default_value = settings[:default] || nil
example = settings[:example] || nil

@parsed_param[:default] = example if example
@parsed_param[:default] = default_value if default_value && example.blank?
@parsed_param[:default] = settings[:default] if settings[:default].present?
end

def document_type_and_format(data_type)
Expand Down

0 comments on commit e58b827

Please sign in to comment.