Is Custom Validator for an Array Type Possible in Vapor?

I am trying to write a custom validator for an array field that contains a nested but flat object (my type adopts Content protocol).

Unfortunately, during the debugging, my custom validator methods are not hit, and the request fails with a validation error. It claims that this field is missing.

Are there any issues with array field validation in general, or more likely with my own validation in particular?

Finally, I send the data from the browser as a form: Content-Type: application/x-www-form-urlencoded.

Form URL encoded arrays are always a mess because there's no agreed upon definition on how they should be sent (Vapor chooses a particular way, but other ecosystems might think different).

However it should work, can you show all your relevant code?

I am somewhat confused right now. I managed to submit the data as JSON from the web page, and it still failed.

However, when I tried to create a minimal reproduction of my code in a new repository — it worked with JSON as it was meant! It uses exactly the same validation logic in both. It must mean that I am doing something flaky somewhere else. I need to investigate more.

I feel like I am going insane. I re-enabled validation in the main project today, compiled again, and it just worked….

(Could this be related to me running the debug from inside the VS Code? I have observed very rarely when I restart the debugging that VS Code does not rebuild the binary and runs the old one instead.)