fastify / env-schema

Validate your env variable using Ajv and dotenv
MIT License
212 stars 25 forks source link

Return previous schema type #143

Open klaseca opened 1 year ago

klaseca commented 1 year ago

Checklist

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

Fdawgs commented 1 year ago

@klaseca Any thoughts on review comments?

climba03003 commented 1 year ago

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.

klaseca commented 1 year ago

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-schema cannot 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

jsumners commented 6 months ago

attn: @fastify/typescript