Skip to content
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

API Versioning: Supporting Active Model Serializers namespacing #49

Merged
merged 5 commits into from
May 17, 2016

Conversation

syntaxTerr0r
Copy link
Contributor

Adding failling spec for issue #48

@dblock
Copy link
Member

dblock commented May 9, 2016

Do fix the build to start, squash your commits, describe how this is problematic and describe a path for an existing user in UPGRADING.

@syntaxTerr0r
Copy link
Contributor Author

@dblock The build seems to fail for external reason of my PR: dependencies are outdated.
Gem::InstallError: listen requires Ruby version >= 2.2.3, ~> 2.2.

listen is a dependencies of guard-rspec.

I can do the following:

  • fix .travis.yml to build against ruby 2.2 (and remove 2.1.1)
  • lock down guard-rspec to a previous version

Which sound better to you? What's the policy here? Since it's a development dependency I think it should be kept up to date, especially because Guard officially announced to not support Ruby 2.1 anymore: https://github.com/guard/guard#readme

@syntaxTerr0r syntaxTerr0r force-pushed the versioned-api branch 2 times, most recently from 16f4870 to cbd95ed Compare May 9, 2016 23:55
Adding failing specs for issue ruby-grape#48
Proposition of implementation for ruby-grape#48
Readme update
Travis fix
@syntaxTerr0r
Copy link
Contributor Author

Okay, anything legacy:

  • 1.9.3
  • rbx-2.2.10
  • jruby-19mode

... won't pass build.

@dblock
Copy link
Member

dblock commented May 10, 2016

I took care of this in #50, you can rebase against master.

@syntaxTerr0r
Copy link
Contributor Author

Okay, this seems to be okay now.

@@ -5,6 +5,8 @@ Use [active_model_serializers](https://github.com/rails-api/active_model_seriali
[![Build Status](https://api.travis-ci.org/jrhe/grape-active_model_serializers.png)](http://travis-ci.org/jrhe/grape-active_model_serializers) [![Dependency Status](https://gemnasium.com/jrhe/grape-active_model_serializers.png)](https://gemnasium.com/jrhe/grape-active_model_serializers) [![Code Climate](https://codeclimate.com/github/jrhe/grape-active_model_serializers.png)](https://codeclimate.com/github/jrhe/grape-active_model_serializers)

## Breaking Changes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets move this into an UPGRADING document like https://github.com/ruby-grape/grape/blob/master/UPGRADING.md?

@dblock
Copy link
Member

dblock commented May 17, 2016

I'll merge this and move the CHANGELOGs and other UPGRADING things around after. Thanks!

@@ -15,8 +15,12 @@ def call(resource, env)
def fetch_serializer(resource, env)
endpoint = env['api.endpoint']
options = build_options_from_endpoint(endpoint)
ams_options = {}.tap do |ns|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is almost too much Ruby IMO :)

ams_options = {}
ams_options[:namespace] = options[:version].try(:classify) if options.try(:[], :version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants