Registry / testing / json-schema-strictly-typed

json-schema-strictly-typed

JSON →
library0.0.14jsnpmunverified

A TypeScript library that provides a strictly-typed implementation of JSON Schema 7, disallowing nonsense combinations of fields. Current version 0.0.14, early-stage development with limited release cadence. Key differentiators: defines logical sub-types (e.g., JSSTIntegerWithBounds) for precise validation and includes optional faker field for strings. Alternatives like ajv focus on runtime validation, while this library emphasizes compile-time type safety with TypeScript.

npm install json-schema-strictly-typed
INSTALL
IMPORT
SIG · JSON-SCHEMA-STRICT
J
json-schema-strictly-typed
testingjavascriptv0.0.14
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JSSTInteger
import { JSSTInteger } from 'json-schema-strictly-typed'
const JSSTInteger = require('json-schema-strictly-typed').JSSTInteger
ESM-only package; named export.
JSSTTopLevelString
import { JSSTTopLevelString } from 'json-schema-strictly-typed'
import { TopLevelString } from 'json-schema-strictly-typed'
Top-level types have 'TopLevel' suffix, e.g., JSSTTopLevelString.
JSSTObject
import { JSSTObject } from 'json-schema-strictly-typed'
import { JSSTObject } from 'json-schema-strictly-typed'
Named export, not default.

Demonstrates basic type checking for integer, string with faker, and top-level object schemas.

import { JSSTInteger, JSSTString } from 'json-schema-strictly-typed'; // Validate an integer schema const integerSchema = { type: 'integer' }; JSSTInteger.is(integerSchema); // true // Validate a string schema with faker const stringSchema = { type: 'string', faker: 'name.findName' }; JSSTString.is(stringSchema); // true // Check a top-level schema import { JSSTTopLevelObject } from 'json-schema-strictly-typed'; const topSchema = { $id: 'https://example.com/schema', type: 'object', properties: { name: { type: 'string' } } }; console.log(JSSTTopLevelObject.is(topSchema)); // true
Debug
Known issues
breakingPackage is pre-1.0; API may change without major version bump.
fix
Pin to exact version and test upgrades.
affects: <1.0
deprecatedSome JSON Schema 7 features not yet implemented (e.g., if/then/else). Use alternative libraries for full spec.
fix
Monitor GitHub for updates or switch to ajv for runtime validation.
affects: >=0.0.1
gotchaTop-level types are prefixed with 'JSSTTopLevel', not 'TopLevel' alone.
fix
Use JSSTTopLevel* names like JSSTTopLevelString, JSSTTopLevelObject.
affects: >=0.0.1
gotchaEnum types are suffixed (e.g., JSSTIntegerEnum) not generic JSSTInteger with enum values.
fix
Use JSSTIntegerEnum for integer enums, JSSTStringEnum for string enums.
affects: >=0.0.1
Errors
Common errors & fixes
Module not found: Can't resolve 'json-schema-strictly-typed'
Package not installed or ESM-only environment without proper module resolution.
fix
Install package: npm install json-schema-strictly-typed. Ensure use of ES module imports.
Property 'is' does not exist on type 'typeof import...'
Using CommonJS require() incorrectly in a TypeScript project.
fix
Change to ES module import: import { JSSTInteger } from 'json-schema-strictly-typed'.
Cannot find name 'JSSTTopLevelObject'
Importing from wrong path or forgetting the 'TopLevel' prefix.
fix
Import as: import { JSSTTopLevelObject } from 'json-schema-strictly-typed'.
Upgrade
Version history
0.0.14latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
json-schema-strictly-typed — npm install json-schema-strictly-typed · libregistry