Creating Self-Referencing Schema in TypeScript

Hi, I'm trying to create a Schema Definition to decode Openapi-Specifications. For this I need to reference the Schema inside of itself.
Here is a simplified Version of what, I'm trying to accomplish.
export const JsonSchemaObject = S.Struct({
    $id: S.optional(S.String),
    not: S.optional(JsonSchemaObject),
})

Obviously, I get the error that JsonSchemaObject is used before it's declaration. Is there anyway around it?
Was this page helpful?