Return previous schema type
Checklist
- [x] run
npm run testandnpm run benchmark - [x] tests and/or benchmarks are included
- [x] documentation is changed or added
- [x] commit message and code follows the Developer's Certification of Origin and the Code of conduct
Description:
As discussed in #138, env-schema should support fluent-json-schema library out-of-the-box (without explicitly calling valueOf method). Given this requirement, we cannot use a narrower type for schema (reasons why we cannot use code from fluent-json-schema are described in #137)
In future, if we remove this requirement, it will be possible to return a more strict type
@klaseca Any thoughts on review comments?
The PR is long enough to forget the detail on why it happen. The raise of this PR is that the current types is too strict to support only limited amount of library (only ajv). https://github.com/fastify/env-schema/issues/138
Even fluent-json-schema cannot be directly supported.
The PR is long enough to forget the detail on why it happen. The raise of this PR is that the current types is too strict to support only limited amount of library (only ajv). #138
Even
fluent-json-schemacannot be directly supported.
Not exactly. Not only ajv is supported. We have tests for typebox, and they work. Only problem is desire to pass fluent-json-schema schemas without explicitly calling valueOf
attn: @fastify/typescript