rescript-schema
rescript-schema copied to clipboard
Empty object not accepted by @schema
"rescript-schema": "9.3.0"
I tried to add an empty object for a type variable but it won't work when trying to create the schema automatically
@schema
type variableName = {}
Error: [{ "resource": "xxxx", "owner": "generated_diagnostic_collection_name#0", "severity": 8, "message": "Empty record literal {} should be type annotated or used in a record context.", "source": "ReScript", "startLineNumber": 1, "startColumn": 1, "endLineNumber": 1, "endColumn": 1 }]
I had to do this to make it work
let variableNameSchema = S.object((_): variableName => {})
Issue found in version v9 and v10