22 questions
0
votes
1
answer
88
views
JsonApiDotNetCore - How to filter by related object property?
Imagine I have two objects
public class OrderLine : Identifiable<Guid>
{
[HasOne]
public Order Order {get;set;}
...
// other properties
}
public class Order : Identifiable<Guid&...
0
votes
0
answers
391
views
How to access relationship with JSON:API serializer
I am currently developping an comment system using ruby on rails and React. Everything was working well, my User can post comments, and products can receive comments. But now I have a problem.
Here is ...
0
votes
0
answers
155
views
Error while parsing JSON Object in Android
In my Android application, I want to fetch the details of the user's profile using the token that is sent in the header format, but I get the following errors
Specify the JSON Parsing Error:
java.io....
0
votes
2
answers
333
views
JSONAPI Complex attributes
Is this sample in a correct format based on JSON API specifications? In another word can we have in attributes an array?
{
"meta": {
},
"links": {
"self": "...
-1
votes
1
answer
235
views
JSON Self referencing loop on POST call
I'm trying to send a POST call via JsonApi with this as example:
{
"data": {
"attributes": {
"booked_by_patient": true,
"class&...
0
votes
1
answer
547
views
JsonApi Serializer Not Found [duplicate]
I have run gem 'jsonapi-serializer' and bundle install.
I then try to run a generator rails g serializer User username id but the command always freezes. So I created the serializer manually:
# app/...
0
votes
1
answer
1k
views
Way to include multiple relationships with same id and type in jsonapi
I have this requirement of fetching data from database based on id. This record can have multiple values for same id and type since it is of type history. The versions however that we use change ...
0
votes
1
answer
984
views
Jsonapi serializer parameters to has_many query
I would need to filter the records to include for has_many relation with the params that are passed to the serializer. The object_method_name option is invoking a method in the model, but how can I ...
1
vote
2
answers
2k
views
Conditional attributes with jsonapi-serializers throwing TypeError
I am working on a Ruby on Rails project with ruby-2.6.0 and Rails 6. i am working on api part, i have used jsonapi-serializers gem in my app. I want to add conditional attribute in serializer.
...
0
votes
1
answer
705
views
How to customize jsonapi-serializer caching namespace - Ruby on Rails
In my rails application I have categories which are classified based on location. I want to cache these categories on serializer level by using jsonapi-serializer's caching method cache_options store: ...
0
votes
1
answer
590
views
How to save a nested one-to-many relationship in API-only Rails?
In my Rails (api only) learning project, I have 2 models, Group and Album, that have a one-to-many relationship. When I try to save the group with the nested (already existing) albums, I get the ...
-1
votes
1
answer
1k
views
How to save a nested many-to-many relationship in API-only Rails?
In my Rails (api only) learning project, I have 2 models, Group and Artist, that have a many-to-many relationship with a joining model, Role, that has additional information about the relationship. I ...
0
votes
1
answer
773
views
Flutter : The getter was called on null (JSON API call)
I've a problem where I know where something went wrong but I can't figure how to solve it.
I'm new to the Flutter developpement and I'm trying to create an application.
For this application, I need to ...
1
vote
0
answers
177
views
How to Convert JsonApiSerializerSettings and JsonOutputFormatter to .Net Core 3.0
Hi Im current changing out a solution from targetting .Net Core 2.2 to .Net Core 3.0. The .Net Core2.2 soultion has the JsonApiSerializerSettings and JsonOutputFormatter setup as below.
var ...
0
votes
1
answer
439
views
Filter Django ResourceRelatedField's queryset
In our project we are using ResourceRelatedField for a foreign key field in one of our serializers to comply with JSON:API format. This is how it looks:
types = ResourceRelatedField(
...
0
votes
1
answer
3k
views
How to use conditional attributes with jsonapi-serializers
I am working on a Ruby on Rails project with ruby-2.5.0 and Rails 5. i am working on api part, i have used jsonapi-serializers gem in my app. I want to add conditional attribute in serializer.
...
1
vote
1
answer
2k
views
How to write unit test using rspec for serializer with custom attributes
Hi i am working on a RoR project with ruby-2.5.0 and rails 5. I am using the jsonapi-serializers for my api. I have a serializer with custom attribute as follows:-
class ReceiptPartialSerializer
...
2
votes
1
answer
1k
views
Rails JSON API serializer with custom attributes
I am working on an RoR project with ruby-2.5.0 and rails 5. I am using the jsonapi-serializers for my API. I want to customize the attributes of the associated model. I have two models Receipt and ...
1
vote
1
answer
134
views
(Ember.js) How to save Sideloaded data from ajax call?
Good day!
Just want to ask on how to create a JSONAPISerializer for an ajax call?
From what I understand on the docs. I must first create a model before I can make a JSONAPISerializer. But I need to ...
0
votes
1
answer
434
views
jsonapi-rb probleams with Relationsship
I have a problem with the gem jsonapi-rb, i try to used the relation in the serializable but it does work.
the models
class Customer < ApplicationRecord
has_one :card
end
class Card < ...
0
votes
1
answer
873
views
Json API Include filter not working
I have an issue, I want to apply filter on included data but it's not working
here is the scenario
API :
/patient/257?include=patientdiagnosis&filter[patientdiagnosis.IsDeleted]=0
or
/patient/...
3
votes
2
answers
5k
views
Using JSON API Serializer to create more complicated JSON
The examples here don't go nearly far enough in explaining how to produce a more complicated structure...
If I want to end up with something like:
{
"data": {
"type": "mobile_screens",
"id"...