![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
json-schema-library
Advanced tools
Javascript tools to work with json-schema, data generation and validation
This package offers tools and utilities to work with json-schema, create and validate data. Unfortunately, most packages, editors or validators do not care to expose basic json-schema functionality. This repository lessens the pain building tools around json-schema. The tools currently support only a basic json-schema, but will hopefully expand over time.
Instead of small memory footprint or high performance, this package focuses on exposing utilities for browser and node environments. Furthermore, current validation and retrieval functions perform a lazy check, which is required for form evaluation in i.e. json editors.
npm i json-schema-library
.
This package is tested on node v6.9.1.
refer to the unit-tests for up to date examples of each function.
return the json 'schema' matching 'data' at 'pointer'. Should be modified to use a step/next-function, which is already within the logic (advance VS retrieve from root -> support both)
const targetSchema = getSchema(rootSchema, '#/path/to/target', rootData);
Currently may also return an error:
if (targetSchema instanceOf Error) {
throw targetSchema;
}
binds the schema to getSchema.
const schemaService = new SchemaService(rootSchema);
const targetSchema = schemaService.get('#/path/to/target', rootData);
return data which is valid to the given json-schema. Additionally, a data object may be given, which will be extended by any missing items or properties.
const baseData = getTemplate(
{ type: "object", properties: { target: { type: "string", default: "v" } } },
{ other: true }
); // returns { other: true, target: "v" }
returns a json schema which is valid against data.
const baseSchema = getTemplate({ target: "" });
// returns {type: "object", properties: { target: "string"}},
returns the schema if it validates the data, else returns false if the data is invalid
const baseSchema = isValid("", { type: "number" });
// returns false
returns the child schema found at the given key
const baseSchema = step(
"target",
{ type: "object", properties: { target: {type: "string"}} },
{ target: "value" }
); // returns {type: "string"}
calls the callback on each item (object, array and value), passing the current schema and its data
const schema = {
type: "array",
items: [
{ type: "number" },
{ type: "string" }
]
};
each([5, "nine"], schema, (schema, value, pointer) => {
// 1. schema = { type: "array", items: [...] }, data = [5, "nine"], pointer = #
// 2. schema = { type: "number" }, data = 5, pointer = #/0
// 3. schema = { type: "string" }, data = "nine", pointer = #/1
});
FAQs
Customizable and hackable json-validator and json-schema utilities for traversal, data generation and validation
We found that json-schema-library demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.