Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

tastypie-jsonschema

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tastypie-jsonschema

JSONSchema mixin for tastypie resources

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
2
Created
Source

Tastypie JSONSchema

A Resource mixing that allows resources to generate json schema compliant schemas from the /schema endpoint.

var tastypie = require('tastypie');
var JSONSchema = require('tastypie-jsonschema');
var Resource = tastypie.Resource;
var Hapi = require('hapi')
var Api = tastypi.Api;
var api, server;

var SchemaResource = Resource.extend({
	mixin:[ JSONSchema ]
  , fields:{
     test:{ type:'char', nullable: true }
  }
});

v1 = new Api('api/v1');
v1.use('json', new SchemaResource());

server = new Hapi.Server();
server.connection({host:'localhost', labels:['api']});
server.register([v1], function(){
	server.start( console.log );
});

Keywords

tastypie

FAQs

Package last updated on 11 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts