Closed
Description
This is a follow-up task to #6.
- Synthesizing an Input parameter that's a type-safe variant of the "accept" header
- The synthesized accept enum should only contain supported content types that we actually generate Output cases for
This way, the server implementer, conforming their type to APIProtocol, will have a clear signal from the user about which content type they want.
Things to keep in mind:
- Client might not care
- Client might specify
*/*
- Client might specify
application/*
- Client might specify multiple, and use priorities (the
q
parameter)
The synthesized enum might not be concrete types, but some representation like:
enum Accept {
case any
case anySubtype(String)
enum SupportedContentTypes {
case json
case yaml
}
case concrete(SupportedContentTypes)
// The order here is significant, sorted from most to least desired, according to the rules in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept
case multiple([SupportedContentTypes]
}
This will require a proposal, as there are many options and it needs to be carefully considered.