- Notifications
You must be signed in to change notification settings - Fork0
Generate JSON schema endpoints for your LoopBack models
NotificationsYou must be signed in to change notification settings
chrisandrews7/loopback-jsonschema-generator
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Generates JSON schemas for yourLoopBack models
npm install loopback-jsonschema-generator
Add the following configuration tocomponent-config.js
inside your loopback project
{"loopback-jsonschema-generator": {},"..."}
- schema - JSON Schema specification
- url - Url to access each JSON schema endpoint, defaults to 'json-schema'
{"loopback-jsonschema-generator": {"schema":"http://json-schema.org/draft-04/schema","url":"json-schema" },"..."}
# products.json{"name":"Products","base":"PersistedModel","properties": {"name": {"type":"string","title":"Name","required":true } },"validations": [],"relations": {},"acls": [],"methods": {}}
http://yourapi.com/api/products/json-schema
{"$schema":"http://json-schema.org/draft-04/schema#","title":"Products","type":"object","properties": {"name": {"type":"string","title":"Name" } },"required": ["name" ]}
A property is added onto each model undermodel.jsonSchema
// Model filemodule.exports=function(Products){constjsonSchema=Products.jsonSchema;//...};
About
Generate JSON schema endpoints for your LoopBack models
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.