schemasafe icon indicating copy to clipboard operation
schemasafe copied to clipboard

`lint` should allow any value as input

Open Stadly opened this issue 1 year ago • 0 comments

The lint funciton expects a variable of type Schema as input. As I understand it, if the input is already a Schema it is already a valid JSON Schema, and hence does not need any linting. I think the lint function should take an any or unknown as input. This way the function can be used to check wheter or not an arbitrary value is a valid JSON Schema and hence can be cast to Schema.

The way it is now, in order to check whether a value is a valid JSON Schema, I have to first cast it to Schema. It is better to this cast after running lint, when I know that it is safe.

Stadly avatar May 06 '24 11:05 Stadly