Closed drdamour closed 1 year ago
You are correct in your assumption and correct in a lack of samples which will need fixing in the future. For now I can point you to the tests
On Sun, 26 Dec 2021 at 18:54, drdamour @.***> wrote:
i'm intrigued by this idea as i think it'll help me return different representations for accept: application/hal+json vs application/vnd.mason+json for example, but i couldn't find much on it. hoping there's some stuff out there i'm missing
— Reply to this email directly, view it on GitHub https://github.com/CarterCommunity/Carter/issues/290, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAZVJRKB3LA5ALBWMNNJGDUS5QERANCNFSM5KZFWUQQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@jchannon did samples get added somewhere?
No, I think the tests are pretty clear
hm, not to be flippant, but based on what? have people successfully created em from the tests?
There's some usage in the tests here: https://github.com/CarterCommunity/Carter/blob/main/test/Carter.Tests/ContentNegotiation/ResponseNegotiatorTests.cs#L113-L160
Without a more specific request for what you'd like to know about it this would be impossible to give you something you're satisfied with.
Well you just create a class and implement the interface that has 2 methods. Here's an example:
It says this negotiator will be used when the accept header is foo/bar and then in the Handle method it's up to you how you write the response.
i'm intrigued by this idea as i think it'll help me return different representations for accept: application/hal+json vs application/vnd.mason+json for example, but i couldn't find much on it. hoping there's some stuff out there i'm missing