Comments (7)
I would also revert the problematic PR and maybe add fluent-json-schema as dependency or as peerDependency
from env-schema.
cc @klaseca
I think I would revert all those changes. It cannot support all the third-party library. Especially, it cannot support fluent-json-schema
.
from env-schema.
Under the hood, valueOf
is called when passing a schema from fluent-json-schema
. How about we remove this code and explicitly call valueOf
when passing the schema? It seems to me that if env-schema
should work not only with fluent-json-schema
, then there should be no code specifically for this library
from env-schema.
How about we remove this code and explicitly call valueOf when passing the schema?
No, it should support out-of-the-box. Since, fastify
itself do the same.
cc @fastify/core WDYT?
Anyway, it would be a breaking change in either end. If no other fixes come up, the only choice is revert on current release.
from env-schema.
Perhaps the best solution in this situation would be to return the object
type for the schema. At the same time, leave the re-import of the JSONSchemaType
type from the ajv
package. In this case, we will return the previous fully working state and leave the option to declare a type-checked schema
from env-schema.
Fastify can support fluent-json-schema without the need of it being a dependency. Take a look how it's done there.
from env-schema.
FWIW: Something similar is going on with types here when using with typebox
from env-schema.
Related Issues (18)
- Add method for process env validation HOT 2
- Delete stale Greenkeeper branches HOT 4
- Can i use with dotenv-flow? HOT 3
- A demo application with env-schema for reference - should we mention anywhere here to help others? HOT 2
- config.data in the README file has to be config.ALLOWED_HOSTS? HOT 1
- Typing `separator` with an array instead of just string
- Type.RegExp fails at Ajv compilation HOT 3
- Does not return value on Interpolation of variables HOT 2
- Expand environment variables HOT 3
- Migrate to fluent-json-schema in tests and docs HOT 2
- Add the support to add formats HOT 3
- Coverage 100% HOT 2
- Cast boolean from env variable HOT 3
- feature: allow custom ajv instance HOT 4
- Use Ajv.errorsText instead of errors.map, otherwise you loose context HOT 1
- TS: Open up envSchemaData HOT 2
- `customOptions` is not typed, so TypeScript is giving errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from env-schema.