Here is an example. You are suggesting to not use open so instead just call it directly where you need it then?
module Decode = {
open! Json.Decode;
let getTags = x =>
Belt.List.map(
Js.String.split(",", x) |> Belt.List.fromArray,
Js.String.trim,
);
let convertRawToSnippet = value =>
Js.Dict.{
code: {
re: "",
js: "",
test: "",
},
id: "base" |> get(value) |> Belt.Option.getExn(_),
/* id: Belt.Option.getExn(get(value, "base")), */
title: "title" |> get(value) |> Belt.Option.getExn(_),
/* tags: getTags(get(value, "tags")), */
tags: "tags" |> get(value) |> Belt.Option.getExn(_) |> getTags,
description: "",
notes: [],
};
let fileMap = json => json |> field("fileMap", dict(dict(string)));
};
The last line would be let fileMap = json => json |> Json.Decode.field("fileMap", dict(dict(string)));
with no open call.