{"id":18874250,"url":"https://github.com/chrisandrews7/loopback-jsonschema-generator","last_synced_at":"2026-04-14T06:04:31.092Z","repository":{"id":57148662,"uuid":"75324367","full_name":"chrisandrews7/loopback-jsonschema-generator","owner":"chrisandrews7","description":"Generate JSON schema endpoints for your LoopBack models","archived":false,"fork":false,"pushed_at":"2018-05-11T18:07:54.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T01:07:54.570Z","etag":null,"topics":["json","json-schema","loopback","loopback-component","loopback-models","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/loopback-jsonschema-generator","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/chrisandrews7.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}},"created_at":"2016-12-01T19:16:24.000Z","updated_at":"2020-06-03T13:52:43.000Z","dependencies_parsed_at":"2022-08-31T23:50:30.748Z","dependency_job_id":null,"html_url":"https://github.com/chrisandrews7/loopback-jsonschema-generator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisandrews7%2Floopback-jsonschema-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisandrews7%2Floopback-jsonschema-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisandrews7%2Floopback-jsonschema-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisandrews7%2Floopback-jsonschema-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisandrews7","download_url":"https://codeload.github.com/chrisandrews7/loopback-jsonschema-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239825244,"owners_count":19703235,"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","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","json-schema","loopback","loopback-component","loopback-models","nodejs"],"created_at":"2024-11-08T05:38:39.527Z","updated_at":"2026-02-17T00:30:20.779Z","avatar_url":"https://github.com/chrisandrews7.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loopback JSON Schema Generator\n\n[![Build Status](https://travis-ci.org/chrisandrews7/loopback-jsonschema-generator.svg?branch=master)](https://travis-ci.org/chrisandrews7/loopback-jsonschema-generator) [![Coverage Status](https://coveralls.io/repos/github/chrisandrews7/loopback-jsonschema-generator/badge.svg?branch=master)](https://coveralls.io/github/chrisandrews7/loopback-jsonschema-generator?branch=master) [![npm version](https://img.shields.io/npm/v/loopback-jsonschema-generator.svg?style=flat)](https://www.npmjs.com/package/loopback-jsonschema-generator)\n\nGenerates JSON schemas for your [LoopBack](https://github.com/strongloop/loopback) models\n\n## Installing\n```\nnpm install loopback-jsonschema-generator\n```\n\n## Setup\n\n### Initialising\n\nAdd the following configuration to `component-config.js` inside your loopback project\n\n```json\n{\n  \"loopback-jsonschema-generator\": {},\n  \"...\"\n}\n```\n\n### Configuration options\n\n- **schema** - JSON Schema specification\n- **url** - Url to access each JSON schema endpoint, defaults to 'json-schema'\n\n```json\n{\n  \"loopback-jsonschema-generator\": {\n    \"schema\": \"http://json-schema.org/draft-04/schema\",\n    \"url\": \"json-schema\"\n  },\n  \"...\"\n}\n```\n\n## Using\n\n### Define a model inside loopback as normal\n\n```json\n# products.json\n{\n    \"name\": \"Products\",\n    \"base\": \"PersistedModel\",\n    \"properties\": {\n        \"name\": {\n          \"type\": \"string\",\n          \"title\": \"Name\",\n          \"required\": true\n        }\n    },\n    \"validations\": [],\n    \"relations\": {},\n    \"acls\": [],\n    \"methods\": {}\n}\n```\n\n### Access the generated JSON schema url\n\n`http://yourapi.com/api/products/json-schema`\n\n```json\n{\n    \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n    \"title\": \"Products\",\n    \"type\": \"object\",\n    \"properties\": {\n      \"name\": {\n        \"type\": \"string\",\n        \"title\": \"Name\"\n      }\n    },\n    \"required\": [\n      \"name\"\n    ]\n}\n```\n\n### Programmatic access to the json schema\n\nA property is added onto each model under `model.jsonSchema`\n\n```js\n// Model file\nmodule.exports = function(Products) {\n  const jsonSchema = Products.jsonSchema;\n  //...\n};\n```\n\n## References\n\nhttp://json-schema.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisandrews7%2Floopback-jsonschema-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisandrews7%2Floopback-jsonschema-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisandrews7%2Floopback-jsonschema-generator/lists"}