-
Notifications
You must be signed in to change notification settings - Fork 442
Open
Description
The following schema:
{
title: "Foo",
properties: {
foo: { description: 'Foo is untyped, should allow anything' }
}
}
should become:
interface Foo {
foo: unknown; // or any, depending on options
}
But instead is rendered as:
interface Foo {
foo: { [k: string]: unknown }
}
This is because the fallback for a schema that has no other typescript type is UNNAMED_SCHEMA, and this is treated as an interface, not an unknown type like ANY.
My workaround for now is:
{
title: "Foo",
properties: {
foo: { type: 'any', description: 'Foo is untyped' }
}
}
but the 'any' type isn't valid JSON schema, so I'd prefer to avoid this and just leave type out.
Great tool BTW!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels