-
Notifications
You must be signed in to change notification settings - Fork 68
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
Issues versioning serializers with Grape 1.4 master #55
Comments
Hey @nhinze, I did some work on namespacing against ASM v0.10.0+ in this pull. The changes in the pull should address your issue. Grape-ASM tries to send a namespace key to |
@drn, thanks. I'll wait until its merged into master to try it out. In my signup.rb above, I use "resource", how do I namespace it? Just namespace right around the "get"? I was trying to get it to work with ams .9.5, but it's giving me the same error. |
Namespacing is based off of the I'll get that v0.10 support pull merged onto master today. If it doesn't solve your issue, let me know and we'll work on adding some specs and a fix for your use case. |
@nhinze can you try your project against master? |
Using grape-active_model_serializers 1.4.0 from https://github.com/ruby-grape/grape-active_model_serializers.git (at master@a48d57c) I still get this error: |
The API structure above is inspired from http://codetunes.com/2014/introduction-to-building-apis-with-grape/ . I also named my first API "Mobile", because this one will interact with my mobile app. There will be a separate API for another backend. This is my first time building an API and maybe my setup is not quite correct. I'll gladly take any recommendations. |
@nhinze would you be able to give me access to the project you're experiencing this error with? If so, I can dig into the error. If not, would you be able to write a spec that covers this issue? Re: the |
The "mobile" api used to be called " api" and the folder structure was /app/api/api/v1 . I plan to have a second API for another service. The api would not work in /app/api/v1. I have the project on GitLab. I'll PM you. |
@drn this works well. Thank You! |
Great! I'll let you know when a fix is merged after I get back from vacation on Thursday. I'll close this issue then |
@drn tried to use the master branch, but it doesn't work. I get the same error as before. The namespace-inferred-serializer branch works fine. |
Thanks. It works now. |
Perfect, thanks for following up |
I'm building an API with:
My JSON serializers work well until I try to introduce API Versioning as described here: https://github.com/ruby-grape/grape-active_model_serializers
Unversioned serializer:
Versioned serializer:
The error message is:
API Organization:
base.rb:
v1/root.rb:
api/v1/signup.rb:
Any ideas?
The text was updated successfully, but these errors were encountered: