Damian S
Damian S

Reputation: 213

servicestack.text formatted indented json

Is it possible to get the servicestack.text to produce formatted/indented json?

I was wanting it to write the json to a text file. it would be nice if it was already formatted nicely.

Upvotes: 8

Views: 1076

Answers (2)

user2441511
user2441511

Reputation: 11116

Update from 2017, from this answer:

The new string.IndentJson() extension method available from v4.5.5 will let you pretty-print JSON otherwise you can install a Pretty JSONView extension for Chrome or Firefox to see pretty JSON or you can paste the JSON in jsonprettyprint.com

Upvotes: 1

Jeff Mitchell
Jeff Mitchell

Reputation: 1479

Checkout the .Dump() extension method. Should be what you're looking for.

Upvotes: 1

Related Questions