Questions tagged [api-design]
Application Programming Interface (API) Design discusses best practises for creating libraries intended for general purpose or public use.
1,170 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
3
answers
171
views
API Design: Should I explicitly check for and throw on nullptr parameters if I have full control?
Say I have the following header
#ifndef WINDOW_HPP
#define WINDOW_HPP
// includes...
namespace window
{
struct Window
{
GLFWwindow *handle = nullptr;
};
struct ...
0
votes
2
answers
185
views
Is exposing full backend entities to a Vue frontend a bad practice? A case for DTOs?
I am doing the frontend for a Java Spring backend. The project uses JavaFX for the front but I a migrating it for web usage (with VueJS). When I make an API call to retrieve an object, I am receiving ...
1
vote
1
answer
121
views
Should pagination metadata like totalCount be included in the ETag for cached paginated API responses?
I am currently rethinking my API response schema and caching strategy while implementing ETag-based caching for a paginated REST API (for example, listing places).
Each paginated response looks like ...
1
vote
3
answers
272
views
How to pass arguments of a complex search in RESTful API request params
I’m building an app that lets users manage data across multiple tables. I also expose an API so they can fetch their data and process it in external services.
I’d like to enhance the API to support ...
1
vote
2
answers
563
views
Is there anything that rest APIs can do that GraphQL still cannot do?
I just started learning about the specification, but I still have some doubts about why GraphQL simply hasn't replaced REST since it was created.
REST APIs are very inflexible and straightforward. ...
2
votes
1
answer
160
views
Serving several external APIs in Django + Angular application
I'm working on a web-based app that uses Django and Angular. This app uses several external APIs to fetch environmental data from different monitoring networks. We then use these data to perform ...
0
votes
1
answer
149
views
Microservice Architecture Design
I want to create one service that reads data from two databases and passes it to the customer devices. Is this an overall bad design decision? I think that since it is only read-only, it should be ...
2
votes
8
answers
495
views
Contract extensibility as it relates to enums and type unions
Say I have a contract returning a type:
type CreditCard = {
scheme: "Visa" | "Mastercard"
}
and later we decided to include Amex as card type, then making this change:
type ...
2
votes
1
answer
179
views
Should I split endpoints by parameter requirements?
Preface: This will not be available publicly or to third parties, so I am not concerned about users having the background knowledge to properly form GET requests. These are also not only analytical ...
user avatar
user402444
2
votes
2
answers
153
views
Could concurrent user-triggered data fetches and inserts lead to deadlocks in a multi-user ASP.NET Core + MSSQL application?
I'm facing a tricky situation that might result from a not thoroughly thought-out design, and I'm hoping to understand whether a deadlock might be a realistic cause – and if so, how to prevent similar ...
2
votes
3
answers
279
views
Allowing POST as fallback for GET when query would exceed maximum length of URL
A typical search query looks something like
GET example.com/entity/search?q=John
If we want to add some filtering to this endpoint, we could for example add ...&filter= followed by a URL encoding ...
0
votes
3
answers
308
views
How does HTML-based HATEOAS apply in applications which also want to expose an external API?
I recently read through Hypermedia Systems, and found its arguments incredibly compelling. The book brought a lot of clarity and structure to ideas and frustrations that have been bouncing around in ...
1
vote
1
answer
231
views
System design for tracking viewed posts and returning unseen posts
I came across this system design question and have been wondering what is a good approach.
Requirement :
We have a typical blog or a mini social media kind of website where users create "Posts&...
3
votes
5
answers
1k
views
What is the root cause of a proliferation of "null checks"?
I work with a lot of Groovy code. One feature of the language is the "safe navigation operator" (?), which I think of as an inline null check. There are many things about Groovy that I like, ...
0
votes
1
answer
269
views
Should I let objects, whose copying is "costly", be naively copyable?
I'm devising an API - or actually, a wrapper API for another, lower-level API - in a programming language with objects.
This API represents some entity E which is reference-counted (for example - a ...