Skip to content

Make sure models array has unique list of models #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 0.8.1 (Next)

* [#162](https://github.com/tim-vandecasteele/grape-swagger/pull/162): Make sure models array has unique list of models, otherwise it piles up duplicates from previous calls and affects performance severely. - [@elado](https://github.com/elado).
* [#91](https://github.com/tim-vandecasteele/grape-swagger/issues/91): Fixed empty field for group parameters' name with type hash or Array - [@dukedave](https://github.com/dukedave).
* [#154](https://github.com/tim-vandecasteele/grape-swagger/pull/154): Allow Classes for type declarations inside documentation - [@mrmargolis](https://github.com/mrmargolis).
* Your contribution here.
Expand Down
4 changes: 2 additions & 2 deletions lib/grape-swagger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ def self.setup(options)

http_codes = parse_http_codes(route.route_http_codes, models)

models << @@models if @@models.present?
models |= @@models if @@models.present?

models << route.route_entity if route.route_entity.present?
models |= [route.route_entity] if route.route_entity.present?

models = models_with_included_presenters(models.flatten.compact)

Expand Down