{"id":47448,"library":"easy-json-schema","title":"Easy JSON Schema","description":"A succinct json-schema language that converts JSON objects into JSON Schema definitions. Current stable version is 0.0.2-beta. Release cadence is low, with limited updates. Key differentiators: allows inline type definitions (\"string\", \"number\") and marks required fields with a leading asterisk (*). Simplifies manual JSON Schema creation by using a compact notation. Suitable for quickly generating schemas from sample data.","status":"maintenance","version":"0.0.2-beta","language":"javascript","source_language":"en","source_url":"https://github.com/suxiaoxin/easy-json-schema","tags":["javascript","json","to","schema","generator"],"install":[{"cmd":"npm install easy-json-schema","lang":"bash","label":"npm"},{"cmd":"yarn add easy-json-schema","lang":"bash","label":"yarn"},{"cmd":"pnpm add easy-json-schema","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package does not ship TypeScript types and is CJS-only. Use import or require accordingly.","wrong":"const ejs = require('easy-json-schema')","symbol":"default export (function)","correct":"import ejs from 'easy-json-schema'"},{"note":"Default export only; named import will fail.","wrong":"import { ejs } from 'easy-json-schema';","symbol":"ejs function","correct":"const ejs = require('easy-json-schema');"},{"note":"No type definitions available; use @ts-ignore or declare module.","wrong":"","symbol":"TypeScript usage","correct":"// @ts-ignore\nimport ejs from 'easy-json-schema';"}],"quickstart":{"code":"const ejs = require('easy-json-schema');\n\nconst input = {\n  \"id\": \"string\",\n  \"*name\": \"string\",\n  \"arr\": [{\n    \"site\": \"string\",\n    \"url\": \"string\"\n  }]\n};\n\nconst output = ejs(input);\nconsole.log(JSON.stringify(output, null, 2));","lang":"javascript","description":"Converts a compact JSON object into a JSON Schema using easy-json-schema."},"warnings":[{"fix":"Ensure custom type strings or type objects are valid JSON Schema types supported by the library (string, number, integer, boolean, array, object).","message":"Non-string type values (e.g., nested objects with type key) will be treated as full schema definitions, but the library does not validate that the 'type' field is a valid JSON Schema type.","severity":"gotcha","affected_versions":"*"},{"fix":"Avoid passing null or empty arrays as input; filter them beforehand.","message":"The library does not handle edge cases like null values, empty arrays, or unsupported data types gracefully; may throw or produce incorrect schema.","severity":"gotcha","affected_versions":"*"},{"fix":"Consider using a more actively maintained library like ajv or jsonschema for full JSON Schema support.","message":"Package is in beta and has not been updated since 2017. No support for JSON Schema Draft-07 or later features (e.g., $ref, if/then/else).","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.0.2':22 'allow':33 'asterisk':46 'beta':23 'cadenc':25 'compact':55 'convert':11 'creation':51 'current':18 'data':64 'definit':17,36 'differenti':32 'easi':1 'field':42 'generat':60,69 'inlin':34 'javascript':65 'json':2,7,12,15,49,66 'json-schema':6 'key':31 'languag':9 'lead':45 'limit':29 'low':27 'manual':48 'mark':40 'notat':56 'number':38 'object':13 'quick':59 'releas':24 'requir':41 'sampl':63 'schema':3,8,16,50,61,68 'simplifi':47 'stabl':19 'string':37 'succinct':5 'suitabl':57 'type':35 'updat':30 'use':53 'version':20","created_at":"2026-06-07T16:51:34.628599+00:00","updated_at":"2026-06-07T16:51:34.628599+00:00","problems":[{"fix":"Ensure input is a proper JSON object or array.","cause":"Passing null or undefined as the input to the ejs function.","error":"TypeError: Cannot convert undefined or null to object"},{"fix":"Provide at least one item example in the array, e.g., [{\"site\": \"string\"}].","cause":"Using an empty array [] as part of the input object for array items definition.","error":"Uncaught TypeError: Cannot read property 'type' of undefined"},{"fix":"Use the import syntax: import ejs from 'easy-json-schema'. For browser, bundle with a bundler like webpack or use a CDN.","cause":"Trying to use require in an ES module context or in the browser.","error":"ReferenceError: require is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/suxiaoxin/easy-json-schema#readme","github":"https://github.com/suxiaoxin/easy-json-schema","docs":null,"changelog":null,"pypi":null,"npm":"easy-json-schema","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}