Comments (7)
Answered in Slack chat - and fixed! Thanks for raising it @aguirrel
from graphiti.
@richmolj could you post the solution here?
I had to create my own strong_param for floats
from graphiti.
If you upgrade to the latest compliable, you should no longer get an error. The swagger type is :number
and the payload type is Float
.
from graphiti.
How does this work?
I thought default declarations for strong_params where here:
https://github.com/jsonapi-suite/strong_resources/blob/master/lib/strong_resources/configuration.rb
from graphiti.
Yes - the mapping to :number
is here so attribute :number
maps to Parameters.decimal
. The payload bit is completely separate and is asserting on the rendered response as Float
when running the generator.
from graphiti.
Thank you @richmolj
Just in case my case helps someone: I had to use ActionController::Parameters.float
because ActionController::Parameters.decimal
was not accepting a Ruby's float, I guess it needs a BigDecimal. I do not remember if the error was happening at the controller level or when saving the Active Record model.
from graphiti.
Yes, there is an improvement needed here to support both float and decimal. I have this on my list, but happy to merge if youd like to take a crack at a PR
from graphiti.
Related Issues (20)
- sideposting - associating same newly created record with multiple records that are also being created
- Sideposting- includes don't show when test with Postman
- Polymorphic has_one and has_many doesn't respect custom polymorphic_name
- Data access questions HOT 1
- Missing next page link when the resource is a postgres table has json columns HOT 1
- Proposal to allow for overriding relationship getter HOT 1
- Record ID for authorization
- Guide - Outdated external link
- can not call method with args including keyword inside attribute/extra_attribute
- Problem in namespacing controllers HOT 2
- Template for tutorials are broken
- Parsing filter values with {{}} has unwanted side effects.
- Resources with circular relationships fail to load
- Can not call method with key args inside extra_attribute/attribute block HOT 3
- my_resource.data raises Graphiti::Errors::RecordNotFound in #create action after Graphiti::Resource#build(params) when the table is empty HOT 5
- Deep Query Filter HOT 1
- Not compatible with Rails 7.1 HOT 3
- The automated release is failing 🚨
- The automated release is failing 🚨
- ActiveRecord::ConnectionTimeoutError "all pooled connections were in use" after enabling concurrency HOT 8
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 graphiti.