fastify / ajv-compiler

Build and manage the AJV instances for the fastify framework
Other
18 stars 9 forks source link

Ajv serializer #45

Closed Eomm closed 1 year ago

Eomm commented 2 years ago

Opening this draft to get feedback. Right now this feature works, it needs more testing (CI fails due to the coverage).

The notable code is on the index and serializer-compiler files, the validator is just a copy-paste

AJV-JTD can be used to serialize the JSON payloads: https://ajv.js.org/guide/getting-started.html#parsing-and-serializing-json

I'm not sure if it is good to include this feature in this package, or we should create a new package that:

What do you think?

Closes https://github.com/fastify/fastify/issues/3441

jsumners commented 2 years ago

I don't see any issue with this.

dalisoft commented 2 years ago

@Eomm Any performance comparison would be helpful At least here for users could see how performance differs than fast-json-stringify

Eomm commented 1 year ago

Must add small benchmarks