Open Velasko opened 6 months ago
How could a response restrict the http code ?
Having a type for each code could allow the type system to ensure that the responses are surely amongst the declared options.
Response could be a way to do it. However, a request usually has more than a single type of responses.
Could there be a Response<A, B, C> and the error code would be one of those types ? If so, how to make it order independent ? How to make it so the response could have N possible codes ?
My hunch says that Response!<A, B, C> could be what we need. This would probably return an enum with those types. Am wondering how it would work when the dev returned the value.
currently only 3 of the possible response codes are implemented