This repository contains JSONSchemas for the LoopBack framework.
ℹ️ These schemas target loopback version 3 which is not 100% compatible with most loopback applications currently in production. I chose to target the next version in the interest of being forward looking & because time is limited.
Roadmap in TODO.md
. 👈 This is where to contribute if you'd like to help!
Using an IDE that supports JSONSchemas (I recommend VS Code), point to a schema thus:
common/models/customer.json
{
"$schema" : "https://raw.githubusercontent.com/Sequoia/loopback-json-schemas/master/dist/loopback-model-definition.json"
}
Edit your jsconfig.json
in VS Code to map schemas to file paths in your project:
{
"fileMatch": "/common/models/*.json",
"url": "https://raw.githubusercontent.com/Sequoia/loopback-json-schemas/master/dist/loopback-model-definition.json"
},
{
This will automatically link schemas to paths so you don't have to use Method 1. Read more.
This will automatically link schemas to paths so you don't have to use Method 2.
- Clone repository & run
npm install
- Run
npm serve
to serve for local testing- You can create a separate project (e.g. in VS Code) and point to your local definitions from a json file thus:
{ "$schema" : "http://localhost:8090/shared-refs.json" }
- You can create a separate project (e.g. in VS Code) and point to your local definitions from a json file thus:
- When you're ready to push & submit a PR, run
npm run build
which- copies files from
src
todist
- replaces
http://localhost:8090
with the real base url for the schemas. This is currently github but will likely be schema store later.
- copies files from