Comments (6)
Hi @spijet, thanks for your issue. The formatter does use ActiveModel naming and serialization related methods, but only if the object to be serialized actually responds to these methods.
I'm working on a PR to actually remove Rails as a dependency : #12, feel free to check it out and confirm me if it works. Just as well, I am open to suggestions for improvement.
Thanks!
from grape-jsonapi.
Thanks a lot! I'll check this new branch locally in my app and will let you know if it works. I'll add comments (or even commits, maybe 😉) in the PR if anything comes up.
Can you hold this issue as open while I test the PR, please?
from grape-jsonapi.
@spijet PR merged and gem published to rubygems
from grape-jsonapi.
require 'rails'
does not prevent library to be used with Sinatra-based apps tbc, but unnecessary dependency is unnecessary dependency.
from grape-jsonapi.
Actually, I just tried to comment out the require 'rails'
line by hand and it seems to work fine. Haven't checked all the features yet, though. But still, this won't do in a production environment, where gems are pulled in on every deployment.
from grape-jsonapi.
It seems that I was (kinda) mistaken, and the Formatter module uses some ActiveRecord-specific stuff when working with collections, so it may be better to depend on ActiveRecord instead of Rails, unless I miss something else. :)
from grape-jsonapi.
Related Issues (11)
- Needs tests HOT 1
- Update fast_jsonapi dependency HOT 6
- There're 2 license files? HOT 1
- Integration with grape-swagger: questions HOT 7
- Uninitialized Constant Grape::Formatter::Jsonapi HOT 3
- Document why/how it's better HOT 2
- Question: using render method for empty data HOT 4
- [Question] Any hints on best way to support swagger response/model parsers? HOT 5
- [Question] Best way to differentiate serializers that share type? HOT 2
- content-type not supported HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grape-jsonapi.