Viewing to_yojson and of_yojson implementation for types

Hi Team, is there any way to view the implementation of to_json and of_json implementation for a particular type generated by ppx_deriving_yojson and yojson

type person = {
  name : string;
  age : int;
}

[@@deriving yojson]

Now I wanted to see person_to_yojson and person_of_yojson implementation generated by ppx??

Add -dsource compiler flag, and run dune --verbose

1 Like

@Kakadu can you please tell me where to add this -dsource flag?

You don’t have to bother with -dsource and the log. Instead you can simply use dune show pp path/to/file.ml. It will display the preprocessed source.

3 Likes