Giter Club home page Giter Club logo

Comments (7)

Uzlopak avatar Uzlopak commented on August 11, 2024 1

I would also revert the problematic PR and maybe add fluent-json-schema as dependency or as peerDependency

from env-schema.

climba03003 avatar climba03003 commented on August 11, 2024

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.

klaseca avatar klaseca commented on August 11, 2024

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.

climba03003 avatar climba03003 commented on August 11, 2024

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.

klaseca avatar klaseca commented on August 11, 2024

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.

mcollina avatar mcollina commented on August 11, 2024

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.

jessekrubin avatar jessekrubin commented on August 11, 2024

FWIW: Something similar is going on with types here when using with typebox

from env-schema.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.