Open Razer6 opened 8 years ago
Generally I don't recommend APIs that return two different things. But I think this should be possible - give it a try, if not it should be a feature request.
short answer: actual it isn't possible, and it isn't recommended longer answer: it should not be possible
why not? have in mind what this means … a logic would be implemented for this feature, ok but this logic must also be handled on the consumer and documentation side, cause it is common sense to expect one resource and changes, which removes common behaviour are breaking changes, means exactly: please make also feature request for:
Consider an API endpoint which returns a different entity depending on the current user. Is it possible to specify those different return entities in Grape DSL? Something like the following?