From e58b8279dcf3bc98d5035f8c9c7be31e572e8b32 Mon Sep 17 00:00:00 2001 From: Peter Scholz Date: Fri, 22 Apr 2016 18:39:47 +0200 Subject: [PATCH] removes overiding default trough example --- CHANGELOG.md | 3 ++- lib/grape-swagger/doc_methods/parse_params.rb | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf20845b..c4495f50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/grape-swagger/doc_methods/parse_params.rb b/lib/grape-swagger/doc_methods/parse_params.rb index f9d935f7..8655d9ad 100644 --- a/lib/grape-swagger/doc_methods/parse_params.rb +++ b/lib/grape-swagger/doc_methods/parse_params.rb @@ -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)