706 questions
0
votes
0
answers
63
views
Resolving conflicts between attributes and relationships in JsonApiSerializer
I'm working on a C# program that will integrate with Planning Center's json-api compliant API (docs can be found here.) For (de)serialization purposes, I'm using the JsonApiSerializer library, which ...
0
votes
0
answers
60
views
Must I bind all attributes when using JsonApiSerializer
I'm working on putting together a web app that (among other things) fetches data from Planning Center, which is json-api-compliant. After some thought, I've decided to use the JsonApiSerializer ...
0
votes
1
answer
129
views
Java LocalDateTime Serialized output is giving incorrect values
I am working on replacing crnk with Spring Hateos Json APi . I was getting a exception for LocalDateTime so I have used
@JsonSerialize(using = LocalDateTimeSerializer.class)
@JsonDeserialize(using =...
0
votes
0
answers
33
views
Unable to call post method for Spring Hateos JSON API with relationships
I am working on using Spring Hateos Json APi as a replacement for crnk .I want to implement a post request ie to save the Book object
import static com.toedter.spring.hateoas.jsonapi.MediaTypes....
0
votes
0
answers
47
views
Spring Hateos Json APi add included to the response
I am working on using Spring Hateos Json APi as a replacement for crnk .As per the documentation. I was able to get the expected response when I retrieve a List of object ie when I did
import static ...
0
votes
1
answer
49
views
Spring Hateos Json api list deserialise issue
I am working on using Spring Hateos Json api as a replacement for crnk. As per the documentation. I was able to get the expected response when I retrieve a object ie when I did
import static com....
0
votes
0
answers
23
views
django json api ordering_fields not working on include resources
Hi I am working on ordering_fields on include resources using django_json_api. I have 2 models activities and activity_enrollments(activity is foreign_key). I am ordering on 2 fields one is related to ...
0
votes
1
answer
84
views
How to handle jsonapi returning empty struct for struct with false value in golang
It looks like jsonapi.Marshal returns an empty json object for a golang struct with a value that is false. I understand that a struct of zero values is considered zero, but as a caller of this API, am ...
0
votes
1
answer
30
views
What's the Accept header syntax for multiple extensions in JSON:API?
What is the syntax for a JSON:API Accept HTTP header with multiple extensions? I can't find it in the spec.
Here are some possibilities I could think of for a client that wants to use both the https://...
1
vote
2
answers
497
views
How to get Media image url link rendered in JSON:API response
I am trying to get the URL of the media image served via JSON to the frontend, but I'm unable to do so. My expected output is the following.
{
"data": {
"type": "...
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&...
1
vote
0
answers
86
views
Laravel JSON:API Create endpoint/resource(?) for calculated/computed values
I'm creating an API using Laravel with the laravel json-api package.
I'm trying to create an endpoint that will return a set of calculated values for a user. The endpoint will be returning a set of ...
1
vote
0
answers
86
views
JsonApiDotNetCore and filtering using a udf
I am using JsonApiDotNetCore, .NET Core, and EF Core on SQL Server and creating a REST project implementing the Json API standard.
I have plenty of resources (models) but one of them has some fields ...
0
votes
0
answers
59
views
Unable to set HTTP status code for Policy response (Laravel)
I'm building an API with Laravel 10 and the JSON:API library. In this app, one of the main resources (Expense) has a to-one relationship with de User model. I decided to build this application ...
1
vote
1
answer
910
views
How can I implement multiple optional fields but with at least one of them mandatory in MyPy or Pydantic?
I'm trying to write a minimal, custom, JSON:API 1.1 implementation using Python.
For the top level, the RFC/doc says:
https://jsonapi.org/format/#document-top-level
A document MUST contain at least ...
0
votes
1
answer
171
views
Example of using "lid" in JSON:API
The spec for JSON:API v1.1 mentions that "when the resource object originates at the client and represents a new resource to be created on the server", "a lid member may be included to ...
0
votes
2
answers
191
views
PowerShell script parallelization effort - A job does not wait until it gets an answer from the REST API and finishes the job prematurely
Edited with last version code:
I have a PowerShell script which is doing following steps:
Connect to SQL server, download table of 3 variables (three fields)
Then Connect to REST API (based on three ...
0
votes
2
answers
252
views
Parse parameters/values from JSON API query with JavaScript
How do I parse a JSON API style query in JavaScript? An example query would be:
/search?filter[industries.id]=1&filter[locations.id]=3&filter[item_type][0]=temporary
I want to extract the ...
0
votes
2
answers
51
views
Deserialization using djangorestframework-jsonapi
I am trying to use djangorestframework-jsonapi to deserialize JSON:API payload.
Payload :
{
"data": {
"id": "1234",
"type": "parking",
&...
1
vote
0
answers
263
views
API query param definitions in OpenAPI
We have an API which I am looking to generate an OpenAPI spec for. The API conforms to a JSON:API standard and I have an issue defining the query filter parameters when doing gets on collections.
The ...
1
vote
1
answer
142
views
Missing Resource Type: received resource data with a type 'events' but no schema could be found with that name
I have a basic Rails 7 application that uses the jsonapi-resources gem. On the Rails side of the application, I implemented a simple structure of two resources - events and event_categories. They are ...
3
votes
2
answers
1k
views
How to pass multiple related parameters in GET request for "filter query parameter family" standards defined in in JSON:API?
I'm using ASP.NET Core 6.0 and i need to create an api endpoint that can handle two fix parameters that must be provided always and a list of optional filter parameters:
https://<host>/api/...
1
vote
1
answer
203
views
How can I use JSON:API along with Angular/RxJs?
I have a (Laravel) API that is following json:api spec. Everything is working great—using Postman I'm able to make requests for related resources and such.
I am using Angular for my front-end, but I'm ...
2
votes
1
answer
70
views
Spring Boot 2, Feign and JSON:API consumption
I am writing a REST API which consumes other APIs (mainly using Feign clients), performs business logic to compile/massage data and serves it as a response from this one. One of the APIs being ...
0
votes
1
answer
510
views
How can I create a belongsToMany relationship with Laravel JSON:API?
I am familiar with creating a Many To Many relationship using Laravel.
In my example, I have many resources that share many activities. I have been able to successfully create this relationship in ...
1
vote
0
answers
109
views
JsonApiDotNetCore.BaseJsonApiController<TResource, TIdentifier> not able to limit routes
I have created a custom controller Which inherits from BaseJsonApiController<> and i have overridden methods like GetAsync, GetById, PatchResource, PostResource. So while running the application ...
0
votes
0
answers
31
views
How to deal with circular json structure in Vue2 PHP application
In my frontend I was dealing circular structure and the response was returning an infinite loop.
I am a frontend developer but to fix this issue I converted the backend from this point:
if ($...
1
vote
1
answer
235
views
How can i Integrate my custom method inside elide
I want to create a method that ping the backend server and get me some informations, i want this methos to be integrated with the Elide endpoint for an entity called ping to get the response as JSON/...
1
vote
1
answer
142
views
How to deserialize JSON API response with two the same id?
I have a response data from php in JSON API format. The data I received I deserialize it using this library jsona, but after deserializing it the second data gets overwritten with what is in the ...
0
votes
1
answer
134
views
JSON Schema for JSON:API-- how to add "type" keyword for JSON:API Type
I have a webapp that communicates with a different server via JSON:API. I am trying to use JSON Schema via Ajv in the webapp to validate the JSON from the server (Drupal 10 JSON:API).
However, JSON:...
0
votes
0
answers
203
views
Drupal : Accessing "Json Page" type content as headless API with "JSON:API" module
I've created a JSON Page type content on Drupal 8/9/10 as below that has JSON Config as below.
I used this field to build the headless content that needs to exposed to UI Apps.
I want to expose this ...
0
votes
2
answers
216
views
Trying to use filter with jsonApi (Maven project + Elide) and gets this error : InvalidPredicateException: Invalid filter format
Everything works fine until I start including filter in my Get request.
Following is the request that I am trying:
/message/1/clickMessages?filter[clickMessages][recipientEmail]='[email protected]'
0
votes
1
answer
74
views
How can I pause execution of function that queries API until API has finished updating from prior fetch call?
Background
I have an email-client (Single Page Application) containing various mailboxes, where the emails in each mailbox are represented by JSON objects.
Users can send, delete and archive emails by ...
0
votes
1
answer
669
views
Drupal9 JSON:API filtering on Paragraphs content
I have a json api endpoint that I can search on title that contains a term:
/jsonapi/node/article?filter[title][operator]=CONTAINS&filter[title][value]=search term
But I also have a Paragraphs ...
2
votes
1
answer
155
views
JsonApiDotNetCore and SignalR implementation
I'm using the JsonApiDotNetCore library, and I'm trying to push data through SignalR to the clients.
Pushing the data is no problem, however, I want to be this data formatted according to the JSON:API ...
0
votes
1
answer
613
views
Rest API getting data for multiple relationships
As per the JSON API Specification
If you want comments of a article do this http://example.com/articles/1/comments
If you want author of a article do this http://example.com/articles/1/author
What ...
0
votes
1
answer
1k
views
How to post a request with JSON:API compliant data to json server?
I am trying out a simple project wherein I want to post JSON:API compliant data to json-server.
But whenever I am trying to post, only the id is being saved and the data is not persisted.
The db.json ...
0
votes
0
answers
510
views
Unable to encode compound document JSON:API error
Struggling with an newbee issue. When I hit an endpoint that is registered under the JSONAPIRoute facade, I get an error (attached).
This is what I have in my routes:
JsonApiRoute::server('v1')
-&...
3
votes
1
answer
728
views
Go JSON:API (google/jsonapi) Pagination Example
Can someone show an example of how to output pagination links in the response using google/jsonapi? I've tried a couple approaches and none seems to work. I can directly output the object or an ...
0
votes
0
answers
37
views
Is there a way to add a body on destroy method using the json_api_client gem?
I need to add a body on default destroy method, as a follow:
DELETE /path/{id}, body: {}
Googling around, I couldn't find an answer that came close to the solution I need. Has anyone done something ...
0
votes
1
answer
143
views
Django REST Framework JSON API show an empty object of relationships link when use relations.HyperlinkedRelatedField from rest_framework_json_api
I'm create the REST API for space conjunction report, I want the conjunction to be a child of each report.
My models:
from django.db import models
from django.utils import timezone
class Report(...
0
votes
1
answer
748
views
How to allow 'filter' query parameter Django REST Framework JSON API?
I am using Django REST Framework with djangorestframework-jsonapi
When I query with filter[name]=THEOS DRF raise an error into my browser.
I tried to query with this URL
http://localhost:8000/api/...
0
votes
0
answers
258
views
Laravel JSON-API, includes are not consistent when a model is included multiple times
We have stumbled across a bug that I can only assume is a bug with the JSON API code. This is for the old laravel JSON API (in my composer.json file its "cloudcreativity/laravel-json-api": &...
0
votes
1
answer
861
views
Not getting expected data for Laravel JSON:API
I am trying to create an API based on the following two Models:
Product.php
<?php
namespace App\Models\Commerce;
use ...
class Product extends Model {
use HasFactory;
use SoftDeletes;
...
0
votes
1
answer
113
views
Laravel JSON:API - Allow users to create objects related only to themselves
I have a JSON API set up where I would like to allow users to only create addresses for themselves.
In the docs it shows that there is no request to check against in the Policy when creating a ...
0
votes
2
answers
1k
views
C# JsonApiDotNetCore handle int (in DTO) as string in JSON for attribute properties
We've upgrade a C# API with JsonApiDotNetCore from netcore 3.1 to .NET 7. We've also updated the Entity Framework to version 7 and the JsonApiDotNetCore to version 5.1 (all latest at the moment).
Due ...
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": "...
2
votes
0
answers
708
views
How to get the total number of results on Drupal with JSON:API?
I need to get the total number of results when using JSON:API with Drupal.
Apparently that's been introduced in Drupal 9.3 as described on this page:
https://www.drupal.org/node/3246951
However the ...
1
vote
1
answer
309
views
API error - Unable to load one or more of the requested types Method CommitAsync from assembly JsonApiDotNetCore
I have a basic API developed using ASP.NET Core, Entity Framework Core and JsonApiDotNetCore. When I try to execute the I am getting the following exception:
Unable to load one or more of the ...
0
votes
1
answer
179
views
Is Elide library Miscroservice architecture friendly?
I notice that Elide expose GraphQL and JSON API at the same time. So from microservices point of view only one technology will be used at a time. It looks like a lot of resources will be wasted. From ...