Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [validation]

Tags for questions related to validating data.

Filter by
Sorted by
Tagged with
1 vote
2 answers
180 views

I am building an ASP.NET Core 10.0 web-app using .NET's MVC model w/ Kestrel to serve it. The app will deploy on an Azure VM. It's a personal project, therefore, I decided to go with Cosmos DB as the ...
JAYD3V's user avatar
  • 119
5 votes
3 answers
433 views

I'm having a hard time of understanding at what point is multiple layers of validation protection necessary rather than a single point of failure and if the performance hit is a concern Lets say you ...
Observable Stone's user avatar
13 votes
13 answers
3k views

Suppose the code's inside some FullName class And suppose I want only capitalized name elements (let's ignore the fact that in some cultures, name elements may start with a lower-case letter) Should I ...
Sergey Zolotarev's user avatar
1 vote
4 answers
545 views

In order to make sure methods fail fast under invalid arguments, I usually do validation at the start of a method. If I'm verifying multiple predicates, this leads to a few lines of checkNotNull or ...
EarthTurtle's user avatar
1 vote
3 answers
347 views

I'm currently designing a multi-layered application and am trying to figure out the best practice for error handling within the Business Logic Layer (BLL). Should I handle errors directly within the ...
Marko Sami's user avatar
0 votes
3 answers
180 views

I have a task to develop a test framework - or a test suite, if it makes more sense - that aims to validate properties over a large set of XML files. Our codebase is basically like this: JSON input ...
Incognitex's user avatar
3 votes
4 answers
2k views

We're working on a new project (backend, API), following the "clean code" and "clean architecture" principles (described in Robert Martin's books), dividing our application into ...
LNK's user avatar
  • 139
0 votes
1 answer
157 views

I'm working on a library of C++ wrappers/bindings, for another, C-ish, API. The C'ish API has a "launch" function, which, among other things, takes a launch configuration structure (well, ...
einpoklum's user avatar
  • 2,808
1 vote
2 answers
280 views

I am creating an API proxy that acts as a bridge between our frontend application and an AWS opensearch server. This proxy has additional features such as retries and timeouts. One of the features I'm ...
lightning_missile's user avatar
0 votes
1 answer
95 views

I have a budget entity in my domain which can be closed by the user if the budget is open. This means if the budget opens today and closes in seven days, in between this time I can close it, not ...
Bernardo Benini Fantin's user avatar
10 votes
6 answers
6k views

Let's say, in a rather big application suite with multiple more or less integrated products, data is stored across multiple databases. Some of them are SQL-ish DB clusters, some are MongoDB clusters. ...
cis's user avatar
  • 255
2 votes
1 answer
672 views

My company, which specializes in logistics and transportation, delegated the majority of the backend microservices to our team. All of the microservices (which our team inherited from "past ...
lecarpetron dookmarion's user avatar
0 votes
0 answers
70 views

I created an abstract class to represent a vertex in a tree structure. Later, a requirement was introduced where certain types of vertices are not allowed as descendants of certain other vertices. So ...
Cave Johnson's user avatar
2 votes
1 answer
655 views

We're currently exploring CQRS in our future applications. To give a bit of a background, we use a simple CRUD-style service before something like this. Old Pattern: Controller Command/Service Model ...
Lawrence's user avatar
  • 135
1 vote
1 answer
242 views

I have a lot of classes that have numeric values that are configurable by the customer during runtime and should be clamped between a min and a maximum value. The value changes should also be logged. ...
Cédric Moers's user avatar
0 votes
1 answer
145 views

Scenario I have a system where a user can upload an Excel file which is validated and then used to provide data for the application. There are two distinct operations I need to handle with this file: ...
donquixote's user avatar
0 votes
1 answer
741 views

I use the Laravel framework. I've got controllers, like CustomerActivityController, and I've got a service layer with services like CustomerActivityService. Say I want to create a new customer ...
user2190492's user avatar
0 votes
1 answer
203 views

Suppose I have a web application that processes a request as follows. A user fills in a form and submits it. (e.g., to register as a new user for my application) The request is passed to the ...
Safron's user avatar
  • 113
2 votes
2 answers
4k views

I'm working with a basic REST API, through user interaction on the UI, the JSON object is built up, including Arrays and a POST is sent to an endpoint using this object as the request body. For ...
shicky's user avatar
  • 123
1 vote
1 answer
3k views

I am implementing a CQRS pattern in ASP.NET Core with MediatR, and I am wondering what the general consensus is for handling duplicate validation logic for queries/commands which operate on the same ...
Mark Lisoway's user avatar
0 votes
3 answers
2k views

I'm about to create a service providing a simple CRUD Json REST-API. The main requirement is that documents stored/received always conform to a schema provided as JSON schema. So here's the thing: ...
Jan Gassen's user avatar
0 votes
3 answers
1k views

I have a question about DDD. I wonder if I should add validation in a web api controller and duplicate it in a command handler? Is it good approach to validate a DTO and a command even if the ...
Aleksander Chelpski's user avatar
3 votes
2 answers
2k views

In his book "Implementing Domain-Driven Design" Vaughn Vernon suggests to reference aggregate roots only by ID. I see the following advantages of this approach: It is clear where the ...
deamon's user avatar
  • 886
4 votes
2 answers
2k views

I'm working to create a library in python that myself and a few colleagues will use. I'm struggling to conceptually understand how to best organize some code that feels like it doesn't cleanly fit ...
user avatar
2 votes
2 answers
92 views

Scenario : For some (comment) text field the server application is internally throwing errors when the field contains contains some specific characters. Where should the removal of characters be ...
jimjim's user avatar
  • 863
0 votes
1 answer
433 views

Here is a sample method: @ApplicationScoped public class MyClass{ public void getUser(@Min(1) int id){ //get User logic } } I'm in a CDI environment with @ValidateOnExecution(type = ...
cidra's user avatar
  • 363
0 votes
1 answer
297 views

Imagine an http request in a RESTful API that needs to request the database to perform validations before proceeding, but some of those database requests would need to execute again if the validation ...
underthevoid's user avatar
2 votes
1 answer
1k views

I have a value object to hold a user id number as a string. This number has a unique format throughout my domain. So, it's being validated inside the object during instantiation and an exception is ...
Pavi's user avatar
  • 131
3 votes
1 answer
2k views

Consider a scenario (in .Net Core world), where a microservice A collects data from external sources and sends this data asynchronously (RabbitMQ) to microservice B (the reporting system) where this ...
Andreas H.'s user avatar
0 votes
0 answers
75 views

We are building a backoffice web application where people are making changes to an array of nested objects. Because of totally non relevant business reasons there are things that users cannot change ...
atoth's user avatar
  • 539
11 votes
4 answers
8k views

Consider the following approach to validation of an API class (POJO or what have you, I mean a class which just acts as a container for some properties), we make all constructors private to the API ...
JustSomeGuy's user avatar
1 vote
2 answers
596 views

I tried to find some insight in how to handle the duplication of client-side and server-side validation in my app. If, for example, I have an User Entity like this on my back end: type User struct { ...
Daniel Lopes's user avatar
-1 votes
1 answer
139 views

I am working on a very LEGACY MVC App using C# which is built from 2009. They dont have any client side validation at all. In other words, they dont use Validation mechanism provided by MVC framework ...
NinjaCoder's user avatar
0 votes
0 answers
43 views

I am having an .Net Core Solution consisting of 3 Projects: The Site (Asp.Net Core MVC WebApp) The API (Asp.Net Core API) The "Common" library for shared functionality. The Common library ...
Mats's user avatar
  • 163
2 votes
3 answers
3k views

I've had a quick search and probably explaining the situation is why I can't find anythign useful to help me. It's best to describe the sitation with an example! Take a form where a user must input a ...
Crazy Dino's user avatar
4 votes
1 answer
5k views

I'm currently working on a web app using ASP.NET Core (C#) on the backend and Next.js (TypeScript) on the frontend. I have a lot of forms that need to be validated and I don't want to write validation ...
Konrad's user avatar
  • 1,569
0 votes
2 answers
2k views

I've got the following: Clientside C# application. Contains forms for CRUD operations. It uses an API for all data operations. Input is validated on the client, and obviously also on the server (API). ...
user2190492's user avatar
1 vote
1 answer
45 views

I am trying to find an optimal way to handle the following scenario: I have an application where there are a lot of file uploads on a certain endpoint, but the validation is rather strict as per the ...
Daniel Pop's user avatar
-1 votes
3 answers
661 views

My SmsRecipientDetails class constructor accepts String value as recipient phone number. I would like to accept number with spaces: assertDoesNotThrow(() -> new SmsRecipientDetails("123456789 &...
jnemecz's user avatar
  • 299
1 vote
2 answers
677 views

Scenario is simple, a password field with few validation rules. The states I came up with are default ( when the form loads or reset button is pressed) filled ( should this even be a state ?) valid ( ...
ama's user avatar
  • 21
1 vote
5 answers
3k views

What we usually have at work is an API that has a single consumer, usually a SPA web frontend, which is built by the guy sitting next to you. I completely see the need for authentication and ...
Uhmmer's user avatar
  • 85
0 votes
2 answers
301 views

I am designing an application that works with REST API requests for dealing with information stored in a database. The user will add, edit, delete information in this client and after SAVE the ...
jav's user avatar
  • 113
1 vote
1 answer
2k views

I am working on a project that uses Entity Framework Core. I have a class which represents an entity on which I'm trying to perform validation. Is it considered a bad practice to include a Validate ...
M.R.'s user avatar
  • 63
2 votes
1 answer
820 views

I want to know if the way that I handle form validations is a good way. What I actually do is a very detailed client side validation to validate each field and with custom error message for the UI ...
Christian LSANGOLA's user avatar
1 vote
3 answers
2k views

I have read this https://stackoverflow.com/questions/5818898/where-to-put-global-rules-validation-in-ddd and I have create my validator. But now I need to create a validator that must check the order ...
FedeC87p's user avatar
2 votes
3 answers
2k views

I am wondering how I would validate some actions in my domain when a parameter of an action needs to be validated, but that parameter's entity is actually in a different domain so I can't retrieve it. ...
S. ten Brinke's user avatar
1 vote
2 answers
535 views

TL;DR What are common practices to separate validation logic inside a rest API & thereby keep the code clean and straight forward? (code example) Context & Example Let's say I'm developing a ...
Michiel's user avatar
  • 173
0 votes
1 answer
1k views

Context Typical restful CRUD service, including PATCH method, whose API validates fields (eg the "name" field may not contain digits). However, data in the database (from backdoor ETL load) ...
Bohemian's user avatar
  • 2,076
2 votes
1 answer
282 views

I'm building a platform that has an entity named content. There's a clear boundary around what defines content except that it can have relationships with other content entities. Up until now, there's ...
Alec Sanger's user avatar
1 vote
2 answers
214 views

According to what I understand, Requirement validation involves going over the SRS to ensure the requirements are correct with respect to the user's needs. Could you help clarify verifiable ...
Afia R. S.'s user avatar

1
2 3 4 5 6