lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.03k stars 2.23k forks source link

Fix API validation response for team join message #15761

Closed fitztrev closed 1 month ago

fitztrev commented 1 month ago

If a team has "Manually review admission requests" enabled, the message field is required in the POST team join request.

http -A bearer -a lip_bobby post \
  http://localhost:8080/team/team-that-requires-a-message/join \
  message="too short"

{
    "error": {
        "message": [
            "Must be at least ArraySeq(30) characters long"
        ]
    }
}
-  Must be at least ArraySeq(30) characters long
+  Must be at least 30 characters long
kraktus commented 1 month ago

Not sure if this is an easy issue, the constraint is defined here https://github.com/lichess-org/lila/blob/5ed87699dad51ccf06e103f712fc304c009fed51/modules/team/src/main/TeamForm.scala#L33

and I see nothing obvious explaining the mis-formatting