{"id":31134202,"url":"https://github.com/livingdocsio/microschema","last_synced_at":"2025-10-10T11:06:41.157Z","repository":{"id":52576540,"uuid":"108613914","full_name":"livingdocsIO/microschema","owner":"livingdocsIO","description":" Small library without dependencies to create JSON Schemas.","archived":false,"fork":false,"pushed_at":"2025-10-03T22:19:32.000Z","size":138,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-10-09T20:04:42.246Z","etag":null,"topics":["json-schema","jsonschema","schema"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/livingdocsIO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-10-28T02:36:28.000Z","updated_at":"2025-10-03T22:19:36.000Z","dependencies_parsed_at":"2023-11-17T23:55:44.293Z","dependency_job_id":"f44ecdc4-60dc-4b9e-9e2f-21ac351f94ad","html_url":"https://github.com/livingdocsIO/microschema","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":0.4,"last_synced_commit":"ece9bd234fa0f6e0297c09c97c0fcf10667ba6c0"},"previous_names":["upfrontio/microschema"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/livingdocsIO/microschema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livingdocsIO%2Fmicroschema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livingdocsIO%2Fmicroschema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livingdocsIO%2Fmicroschema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livingdocsIO%2Fmicroschema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livingdocsIO","download_url":"https://codeload.github.com/livingdocsIO/microschema/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livingdocsIO%2Fmicroschema/sbom","scorecard":{"id":576715,"data":{"date":"2025-08-11","repo":{"name":"github.com/livingdocsIO/microschema","commit":"0c233963be6b18448c9e2d7545f999283b5985c8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":5,"reason":"7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":5,"reason":"Found 1/2 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T18:02:14.613Z","repository_id":52576540,"created_at":"2025-08-20T18:02:14.614Z","updated_at":"2025-08-20T18:02:14.614Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003722,"owners_count":26083610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-schema","jsonschema","schema"],"created_at":"2025-09-18T06:05:00.720Z","updated_at":"2025-10-10T11:06:41.152Z","avatar_url":"https://github.com/livingdocsIO.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# microschema\n\nSmall library without dependencies to create JSON Schemas in a concise way.\n\nExample:\n```js\nconst ms = require('microschema')\n\nms.strictObj({\n  identityId: 'string:required',\n  clientId: 'number',\n  redirectUri: 'string:uri',\n  scope: 'string',\n  ipAddress: ms.string({pattern: ''}),\n  children: ms.arrayOf(ms.strictObj({\n    scope: 'string'\n  }))\n})\n```\n\n\n## Strings\n\nUsing the `ms.string()` method:\n```js\nms.string()\noutput = {type: 'string'})\n```\n\n```js\nms.string({pattern: '[a-z]+'})\n\n// Passing a javascript RegExp is equivalent to the above\nms.string({pattern: /[a-z]+/})\n\noutput = {\n  type: 'string',\n  pattern: '[a-z]+'\n}\n```\n\nSpecifying a format:\n```js\nms.string({format: 'email'})\n\noutput = {\n  type: 'string',\n  format: 'email'\n}\n```\nNote: Check which formats are available with your JSON Schema\nimplementation before using this.\n\n\nSpecifying min and max length:\n```js\nms.string({minLength: 3, maxLength: 50})\n\noutput = {\n  type: 'string',\n  minLength: 3,\n  maxLength: 50\n}\n```\n\nSetting the required flag (only possible within an object):\n```js\nms.obj({\n  foo: ms.required.string()\n})\n\noutput = {\n  type: 'object',\n  required: ['foo'],\n  properties: {\n    foo: {\n      type: 'string'\n    }\n  }\n}\n```\n\nSimplified usage within objects:\n```js\nms.obj({\n  foo: 'string'\n})\n\noutput = {\n  type: 'object',\n  properties: {\n    foo: {\n      type: 'string'\n    }\n  }\n}\n```\n\n```js\nms.obj({\n  foo: 'string:required'\n})\n\noutput = {\n  type: 'object',\n  required: ['foo'],\n  properties: {\n    foo: {\n      type: 'string'\n    }\n  }\n}\n```\n\n## Numbers and Integers\n\nSimplified usage within objects:\n```js\nms.obj({\n  foo: 'string'\n})\n```\n\nUsing the `ms.number()` method:\n```js\nms.number()\noutput = {type: 'number'}\n```\n\n```js\nms.number({min: 0, max: 10})\n\noutput = {\n  type: 'number',\n  minimum: 0,\n  maximum: 10\n}\n```\n\nUsing the `ms.integer()` method:\n```js\nms.integer()\noutput = {type: 'integer'}\n```\n\nThe `integer()` methods also accepts `min` and `max` params the same as `number()` does.\n\n\n## Booleans\n\n```js\nms.boolean()\noutput = {type: 'boolean'})\n```\n\nSimplified usage within objects:\n```js\nms.obj({\n  foo: 'boolean:required'\n})\n\noutput = {\n  type: 'object',\n  required: ['foo'],\n  properties: {\n    foo: {\n      type: 'boolean'\n    }\n  }\n}\n```\n\n## Null\n\n```js\nms.null()\noutput = {type: 'null'})\n```\n\n## Objects\n\n```js\nms.obj()\noutput = {type: 'object'}\n```\n\nDon't allow additional properties with `strictObj()`:\n```js\nms.strictObj({\n  count: ms.integer()\n})\n\noutput = {\n  type: 'object',\n  additionalProperties: false,\n  properties: {\n    count: {type: 'integer'}\n  }\n}\n```\n\nAdd `title` and `description` annotations to the schema:\n```js\nms.obj({\n  displayName: 'string',\n}, {title: 'Title', description: 'Desc.'})\n\noutput = {\n  type: 'object',\n  title: 'Title',\n  description: 'Desc.',\n  properties: {\n    displayName: {type: 'string'}\n  }\n}\n```\n\nAdd `dependencies`:\n```js\nms.obj({\n  creditCard: 'string',\n  address: 'string'\n}, {dependencies: {creditCard: 'address'}})\n\noutput = {\n  type: 'object',\n  properties: {\n    creditCard: {type: 'string'},\n    address: {type: 'string'}\n  },\n  dependencies: {\n    creditCard: ['address']\n  }\n}\n```\n\nSet a `default` value in case the property is absent:\n```js\nms.obj({\n  creditCard: 'string',\n  address: 'string'\n}, {default: {}})\n\noutput = {\n  type: 'object',\n  default: {},\n  properties: {\n    count: {type: 'integer'}\n  }\n}\n```\n\n\n## Arrays\n\n```js\nms.arrayOf(ms.string())\n\noutput = {\n  type: 'array',\n  items: {type: 'string'}\n}\n```\n\nYou can use these additional modifiers:\n```js\nms.arrayOf(ms.string(), {minItems: 1, maxItems: 3, uniqueItems: true})\n\noutput = {\n  type: 'array',\n  items: {type: 'string'},\n  minItems: 1,\n  maxItems: 3,\n  uniqueItems: true\n}\n```\n\n## Enumerations\n\n```js\n// All values in an enumeration must be of the same type.\nms.enum('foo', 'bar')\n\noutput = {\n  type: 'string',\n  enum: ['foo', 'bar']\n}\n```\n\n## Constant Value\n\n```js\nms.const('foo')\n\n// The output is the same as ms.enum('foo') as there is no equivalent\n// to value in JSON schema.\noutput = {\n  type: 'string',\n  const: 'foo'\n}\n```\n\n## Combining Types\n\n```js\nms.types('string', 'number')\noutput = {\n  type: ['string', 'number']\n}\n\nms.types(ms.string({format: 'uri'}), ms.number({min: 0}))\noutput = {\n  type: ['string', 'number'],\n  format: 'uri',\n  minimum: 0\n}\n```\n\n## anyOf / oneOf / allOf\n\n```js\nms.anyOf('number', ms.obj({foo: 'string'}))\n\noutput = {\n  anyOf: [\n    {type: 'number'},\n    {\n      type: 'object',\n      properties: {\n        foo: {type: 'string'}\n      }\n    }\n  ]\n}\n```\nNote: you can also pass an array as the first argument\n\n\n## $id / $ref\n\n```js\nms.$id('#user').obj({\n  name: 'string',\n  friend: ms.$ref('#user')\n})\n\noutput = {\n  $id: '#user',\n  type: 'object',\n  properties: {\n    name: {type: 'string'}\n    friend: {$ref: '#user'}\n  }\n}\n```\n\n## definitions\n\n```js\nms.definitions({\n  user: ms.obj({name: 'string'})\n}).obj({\n  name: 'string',\n  friend: ms.$ref('#/definitions/user')\n})\n\noutput = {\n  definitions: {\n    user: {\n      type: 'object',\n      properties: {\n        name: {type: 'string'}\n      }\n    }\n  }\n  type: 'object',\n  properties: {\n    name: {type: 'string'}\n    friend: {$ref: '#/definitions/user'}\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivingdocsio%2Fmicroschema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivingdocsio%2Fmicroschema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivingdocsio%2Fmicroschema/lists"}