jasonmitchell / hallo

MIT License
16 stars 4 forks source link

InvalidOperationException when HAL representation is missing #38

Closed j0nnyhughes closed 4 years ago

j0nnyhughes commented 4 years ago

When you request hal+json and there is no representation registered for the requested resource the formatter calls:

await WriteResponseBodyAsync(context);

The dotnet core implementation of this throws an invalid operation exception and instructs you to use the overload which accepts the encoding.

Added a test and changed to use suggested overload.