I have a collection /users/{userId}/tools
and I want to GET and POST to that collection. Can I have different representation of that object based on the method?
For example, for POST I want to send only
{"name": "Toolname", "material": "MaterialName"}
so I built a DTO with only that 2 fields.
And forGET I want to retrieve only the name
[{"name": "Toolname"}, {"name": "AnotherToolName"}, ...]
so I built a DTO with only the name.
Because it's the same URI, can I do that?