An open API service indexing awesome lists of open source software.

https://github.com/dnnfable/thoth.json.net.formatter

JsonMediaFormatter based on Thoth.Json.Net
https://github.com/dnnfable/thoth.json.net.formatter

Last synced: 7 months ago
JSON representation

JsonMediaFormatter based on Thoth.Json.Net

Awesome Lists containing this project

README

          

# Thoth.Json.Net.Formatter

[![Nuget](https://img.shields.io/nuget/v/Thoth.Json.Net.Formatter)](https://www.nuget.org/packages/Thoth.Json.Net.Formatter/)

`Thoth.Json.Net.Formatter` is a JsonMediaTypeFormatter which can be used with Asp.Net WebApi to handle requests from `Thoth.Fetch` and uses `Thoth.Json.Net` for encoding and decoding.

## Example for using the formatter within your service
```fsharp
type FableFormatterAttribute() =
inherit System.Attribute()
interface IControllerConfiguration with
member __.Initialize((controllerSettings : HttpControllerSettings), _) =
controllerSettings.Formatters.Clear()
controllerSettings.Formatters.Add <| Thoth.Json.Net.Formatter()

[]
type MyServiceController () =
inherit ApiController ()
```