cauli
cauli copied to clipboard
Add a pretty-print function to the Inspector floret
There are some values of a request or a response that are poorly printed or not visible at all. The scope of this ticket is to add an infrastructure to be able to pretty-print data.
Proposal
- We define a pretty-print ViewController protocol, for example:
PrettyPrinter
- The
PrettyPrinter
defines astatic func viewController(for item: Any) -> UIViewController?
- A list of
PrettyPrinter
classes is defined - A default mimetype-to-prettyprinter-class mapping is defined
- If a row for a record is tapped
- If it is the request or response body, the mimetype mapping is used to find a PrettyPrinter-class
- If no PrettyPrinter is found, or the PrettyPrinter failed to create a ViewController for that item, the user can select from a list of all PrettyPrinter classes or can chose to share this item
This issue is only partially implemented.