js-lib icon indicating copy to clipboard operation
js-lib copied to clipboard

feat: add `isoDate` schema to zod and ajv

Open mrnagydavid opened this issue 5 months ago • 0 comments

Before anything: Ajv is one of the most badly documented tool relative to how much documentation is actually produced. It is badly worded, confusing.

In this PR, ChatGPT and I - in close collaboration - implement a parametrizable isoDate schema for Zod and Ajv.

It survives the Zod->Ajv transformation by carrying over the required parameters in the description field of the JSON Schema.


I suggest moving basic Ajv-related logic to js-lib, since with the current setup js-lib imports into nodejs-lib which is not a good direction - even though this is only in tests.

This is because zod and ajv are very closely coupled for us, i.e. we should not implement a zod feature that will be missing in Ajv - so I have to keep these tests closely together.

By moving getAjv() et al to js-lib, this circular dependency would be solved. We can leave AjvSchema in nodejs-lib, if we want

mrnagydavid avatar Sep 22 '25 15:09 mrnagydavid