4 ms·
We're using JSONPath to annotate parts of JSON fields in PostgreSQL that need to be extracted/replaced for localization. Whilst I'd naturally prefer we didn't s
by andrewingram 2y ago
We're using JSONPath to annotate parts of JSON fields in PostgreSQL that need to be extracted/replaced for localization. Whilst I'd naturally prefer we didn't store display copy in these structures, it was a fun thing to implement.
Contrived example:
@localizedModel({
title: {},
quiz: { jsonPath: '$.[question,answerMd]' },
})
class MyQuiz {
title: string;
quiz: JSONObject;
}