All Questions
Tagged with json api-design
40 questions
-1
votes
2
answers
170
views
Rest Endpoint Design
I have 6 endpoints that return 6 json response:
/cities/{id} return a json object: {
"city": "Orlando",
"altitude": 10
}
/cities return an array: [{
"city": &...
0
votes
0
answers
300
views
Improve return type for CRUD GET list or details objects
When creating the crud GET methods to get a list of items, or the details, what should I return? The whole object properties for both cases? Or just the properties that are necessary? I'm asking this ...
0
votes
1
answer
439
views
Handling a numerical value that may be specific or a range in a REST API
Let's say I have a REST API that needs to return the width of an object, but that width may either be a specific value or a range of values. What would be the best practice for designing the API to ...
-1
votes
2
answers
133
views
Best practices for API design for an E-Commerce System
I have a few basic questions on how to implement an API for a basic e-commerce system.
The relevant entities are Customer, Puffle, and Review. Each Puffle can have zero or more Reviews. Each Review is ...
9
votes
6
answers
9k
views
How should an API handle unsupported fields?
Let's assume I have this API on /api/v2/persons that enables me to create new entries by POSTing this JSON:
{
"name": "me"
}
The API is implemented using Spring Boot and if ...
2
votes
1
answer
421
views
Best practice for designing a WebAPI for exposing data in a SQL database interacting with C++ and C# applications
I am looking for general guidance or any relevant links for a complex project.
We are a small business that sells a construction materials testing software. The client is a Windows application with ...
0
votes
3
answers
2k
views
How to design RESTful API for response object properties dependent on request parameter
I have a RESTful service where clients provide product codes, start date and end date. In response, the service returns a list of price metrics for the products over the date range. Start date is ...
4
votes
7
answers
8k
views
Representing a large list of complex objects in JSON
I am currently developing an API that returns JSON structures. One of the domain objects returned is a time series, which is a potentially large list (many thousands of elements) of complex objects.
...
0
votes
1
answer
542
views
How can I represent a graph for a visual programming language in JSON?
I am in the process of implementing a visual programming language similar to Blender's node editor or Unreal Engine Blueprints. It will be implemented as a SPA that will communicate with a JSON based ...
1
vote
1
answer
1k
views
Semantic meaning of empty list parameter in JSON API request
I'm attempting to find some authoritative references to address this particular scenario. References to best practices guides would be helpful, specifications even more so.
The scenario in question:
A ...
1
vote
1
answer
205
views
Consuming complex JSON service that does not have schema
Hi I have this weird situation where I have a JSON producing service that represents a very complex object graph and this bject graph does not have a JSON schema that it is based on. The reason for ...
14
votes
5
answers
36k
views
Is it a bad idea to pass JSON objects on the query string for an API "search" operation?
I'm building an API endpoint for a UI grid to search, filter, and display a list of domain objects, let's call them "widgets." In the past, I would have built this with a list of named query string ...
-1
votes
1
answer
65
views
Is it permissible to have relationships to parents of parents for JSON:API resources?
I have the following hierarchy:
venue -> concert -> booking
And within booking I have a relationship for the concert. But should the booking also have a relationship to the venue? Or is it bad ...
2
votes
2
answers
1k
views
backwards compatibility of REST API for update/patch when adding new fields
Context:
Suppose the current way to update a person is to use HTTP PATCH, where you can set the firstname and lastname:
{
"firstname": "john",
"lastname": "doe"
}
And you want to add an extra ...
5
votes
4
answers
847
views
Designing a flexible search API response
Quick Summary
I'm building a search micro-service that will allow searching across different types of resources in a particular system (e.g. blog posts, users etc.). The API that will be exposed will ...