Good day,I have some APIs that do operations over the resource 'User', and the following ones are needed:
Discussion posts and replies are publicly visible
Sure. The path is available as parameters in the API. You would just have to map the path to your respective logic.
So, if I havePATCH usersPATCH users/disablePATCH users/enablePATCH users/addresses/{id}PATCH users/phone-numbers/{id}And so on...I'll need to have a bunch of IFs, or maybe a decision table-ish structure, inside a single Web API object to do the routing.This is kinda limitating and frustrating as the endpoint cannot have a "/" for inner resources declaration and the path doesn't help with that.If there's a main resource with a lot of inner resources, the object will very packed.Well, it is what it is.Thanks for the answer, Stefan.
I implement this in a way that the API calls a dispatching expression which uses match() to call individual expressions based on the path. Forward the http object to the next expression for flexibility.