-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the regression has not already been reported
Last working version
5.1.0
Stopped working in version
5.1.1
Node.js version
18.x
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.3
💥 Regression Report
Typings in Typescript now throw an error when using a fluent-json-schema generated schema as input for envSchema
Steps to Reproduce
In a Typescript file the next block of code reproduces the issue
import envSchema from 'env-schema'
import S from 'fluent-json-schema'
envSchema({
schema: S.object()
})Type 'ObjectSchema' is not assignable to type 'AnySchema | UncheckedJSONSchemaType<EnvSchemaData, false> | undefined'.
Type 'ObjectSchema' is not assignable to type '{ type: "object"; additionalProperties?: boolean | UncheckedJSONSchemaType<unknown, false> | undefined; unevaluatedProperties?: boolean | UncheckedJSONSchemaType<unknown, false> | undefined; ... 7 more ...; maxProperties?: number | undefined; } & { ...; } & { ...; } & { ...; }'.
Property 'type' is missing in type 'ObjectSchema' but required in type '{ type: "object"; additionalProperties?: boolean | UncheckedJSONSchemaType<unknown, false> | undefined; unevaluatedProperties?: boolean | UncheckedJSONSchemaType<unknown, false> | undefined; ... 7 more ...; maxProperties?: number | undefined; }'.ts(2322)
Nevertheless the following block of code does not throw an error
import envSchema from 'env-schema'
import S from 'fluent-json-schema'
envSchema({
schema: S.object().valueOf
})Expected Behavior
As ObjectSchema from fluent-json-schema was removed from typings in #137 it might be solved otherwise or maybe be documented to avoid future confusion
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers