2,326 questions
Best practices
0
votes
2
replies
31
views
Is it normal to send a JSON response with a list of objects where the properties of the objects differ based on their type?
My client has requested that I provide a response from my API that looks like the following:
{
"entity_type": "company",
"registered_date": "2020-01-01",...
Best practices
0
votes
1
replies
42
views
How do you handle CI/CD for APIs? I’m stuck on how setups with multiple local/staging/prod fit together
We built a CI/CD monorepo -- it makes intuitive sense with local/staging/prod. You push small commits and it auto-deploys. That makes sense when you just have that one pipeline for one app.
But now as ...
0
votes
1
answer
28
views
Allowing a filter query in a PUT endpoint that updates a set
I'm designing a REST API that provides an integration layer to an underlying system I have no control over.
Without going in to detail, in this system, there are products with default prices. A custom ...
-1
votes
2
answers
62
views
Docker: is not providing a default to ARG really "bad"?
Docker docs say that this is "bad":
ARG TAG
FROM busybox:${TAG}
Their rationale:
An ARG used in an image reference should be valid when no build arguments are used. An image build should ...
0
votes
1
answer
74
views
REST API design with OneToMany relationship with Spring and JPA [closed]
Let's say I have two entities
public class Container {
UUID id;
String name;
@OneToMany
List<Element> elements
}
and
public class Element {
UUID id;
...
6
votes
1
answer
222
views
Why is std::function_ref(F*) not constexpr, while other ctors are all constexpr?
At the cppref page of std::function_ref, I found an inconsistency issue:
The copy constructor is defined as:
std::function_ref(std::function_ref const&) = default;
while the copy assignment ...
3
votes
1
answer
139
views
Why fstream read and write functions expect char* and not unsigned char*?
The spec says the following for creating an object using an existing storage - [intro.object#3]:
If a complete object is created ([expr.new]) in storage associated with another object e of type “...
-3
votes
1
answer
131
views
Trying to query games whose first release was on a given platform via the IGDB API
I am trying to get a list of games whose first release was on a given platform. Because I've noticed that if you simply filter for games released on a platform and sort them by release dates, you get ...
1
vote
1
answer
174
views
Laravel Scramble generate docs for https routes not working
I have Laravel 11.x app developing on Github Codespaces. I am trying to generate the documentation using Scramble package.
Github Codespaces publish urls are using https.
I am using api_domain entry ...
0
votes
0
answers
63
views
Correct usage of the Process.StartTime to run the process and measure its runtime duration
Let's say I want to run the process and measure its execution time.
var process = Process.Start("test.exe");
process.WaitForExit();
var executionTime = process.ExitTime - process.StartTime;
...
0
votes
2
answers
115
views
RESTFul API Respond Code 200 or other while query data from server database?
The proplem from my job.I'm Android Developer,My co-work is RESTFul API developer(Call him ResA).
My App is Map App,user click map,app search nearly device ids from map.then search device information ...
0
votes
1
answer
86
views
Avoiding Self Referential Structs
I'm writing a program that operates on a Vault object. This Vault object contains a directories field which is a vec of Directory objects. So something like this
struct Vault{
directories: Vec<...
0
votes
1
answer
52
views
Getting a Null result when using json data from Site A using Site B Controller
I am having issue and I'm trying to figure out what causes this.
SITE A
SITE A Code
web.php
Route::get('/eon/auth/check/login',
[ApiController::class, 'checkLogin']
);
<?php
namespace ...
1
vote
1
answer
146
views
Semantic versioning and the experimental API element
I version my APIs (of various types: REST, Java, etc.) according to the rules of semantic versioning (for REST API specifying the version in the OAS in the version field of the Info Object; for Java ...
0
votes
1
answer
554
views
What is the correct structure of a multi-language monorepo on Nx?
I'm building an airline booking site, i need to handle user registration, authentication, booking, seatmap, etc. I'm using 2 API's in 2 languages (.NET in a API that handles the flight search, booking ...
0
votes
1
answer
77
views
How do I get all data from an API when I don't know the max number of pages
I am pulling data using an API, Python, and the requests package. I want to pull all the data, but have only been able to pull 4,000 rows. How do I pull all of the data? The number of pages is not ...
2
votes
1
answer
790
views
Is it possible to apply different protovalidate validation rules to the same protobuf message
I've been looking at using protovalidate to power a complicated API validation use case that I have.
Here is the scenario I have (simplified). I have a single proto message, let's call it FooRequest:
...
2
votes
0
answers
132
views
Why do the std::ranges algorithms have overloads for taking iterator-sentinel pairs?
I'm currently designing an API for a new library, trying to model it after the std::ranges algorithms. I notice that in addition to taking ranges as parameters, these functions have overloads to allow ...
0
votes
2
answers
188
views
REST API Design for Deleting One Resource and Updating Another
I am building a fullstack application with Next.js where users can invite other users to their household.
Resources:
Households
Invitations
Users
Action:
Accept an invitation. This will entail two ...
0
votes
1
answer
48
views
REST URL Design considerations [closed]
I'm in charge of designing a routing system (along with the URL structure) for a relatively small app. The app itself should provide with the functional for adding "root" level entities as ...
1
vote
1
answer
310
views
Handling Multiple Actors in a Use Case in Clean Architecture and DDD
I am doing an API for a blog site using Clean Architecture and DDD. I find myself doing a use case to get all comments for a requested article. The thing is that anonymous users can see the comments ...
0
votes
1
answer
30
views
What is the idiomatic way to accept arguments to a function that may be mutually exclusive?
I'm building a small library that exposes a function:
await printLib({optionsObj})
Currently, the options parameter is an object with different (optional) properties.
A?: <boolean>
B?: <...
0
votes
2
answers
229
views
Is an API deprecation warning considered an unbreakable contract? [closed]
I have an API that is about to move between MAJOR versions—from v1.x.y to v2.0.0. It is following semver (though I don't think that really matters).
In version 1.x.y, I have several public constants ...
1
vote
0
answers
31
views
GraphQL query permissions with federated schema from different GraphQL microservices
I'm reading about schema stitching/federation and came across the example in the link:
extend type Reservation @key(fields: "id") {
id: ID! @external
userId: ID! @external
user: User @...
0
votes
0
answers
141
views
In a microservice architecture, where to define and how to propagate enum definitions
We don't know where to implement a certain enum and how to propagate it throught our services, that need it. We need this enum "SampleType" in two of our microservices (for now). Our ...