Giter Club home page Giter Club logo

loopback-json-schemas's Introduction

LoopBack JSON Schemas

This repository contains JSONSchemas for the LoopBack framework.

โš ๏ธ These schemas are a work in progress & do not capture every feature & setting. Consult docs for best results ๐Ÿ‘.

โ„น๏ธ 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 the schemas

Method 1. Point json files to schemas

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"
}

Method 2. Map schemas to file by file paths (VS Code)

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.

Method 3. Use the VS Code plugin

โš ๏ธ WIP! VS Code Plugin

This will automatically link schemas to paths so you don't have to use Method 2.

Developing

  • 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"
      }
      
  • When you're ready to push & submit a PR, run npm run build which
    1. copies files from src to dist
    2. replaces http://localhost:8090 with the real base url for the schemas. This is currently github but will likely be schema store later.

loopback-json-schemas's People

Contributors

gktim avatar sequoia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.