design – What is the best way to validate a "set" semantic input JSON array parameter in a blog site, to ignore it silently, or report an error?

I develop a blog site, for each article, it has a list of tags, just like stackoverflow.

There is no doubt that on the server side I will expose an API like blog/edit client side, and the request parameter like:

class BlogEditParam{
    private List tags;
}

I must therefore definitively validate the tags on the server side, as if to check if the name of the tag exists or not, there is no doubt.

However, the tags field has "defined" semantics, there can be no duplication. for example, a publication cannot have a list of tags such as:
c++, java, c++

What should I do if there is a possible duplication of the input parameter? It seems to me that I have two strategies:

  1. ignore it silently. For the example I showed above, I remove all server-side duplication and accept this request (of course, the c++ and java the tag must pass the existing validation)
  2. report an error to the client when looking for such duplication

What is the best way in this blog application scenario?


I use Spring Boot as the server side framework. It uses jackson to deserialize the request body, I know I could write the input parameter like:

class BlogEditParam{
    private Set tags;
}

But in fact, it simply ignores duplication during deserialization, just like the first strategy I mentioned above.