Modeling Exclusive API Parameters in Schema
Hi all, I am dealing with an external api, which allows for either
files[] or files_url[] but not both. Is there an easy way to model this in schema? My initial thought was a discriminating union, but the fields names are different, so I am a bit clueless currently. I guess I could extend from "Base Class" and use .transformOrFail.. or something like that but I wanted to quickly verify if someone has a better Idea. Another thing that I would like to implement is a maxItems/maxKeys for records but I am struggling to find a good starting point. Any hints are welcome. Thanks a lot in advance!