0.2.14 • Published 8 years ago

grunt-jsonschema-amd-restclient-generator v0.2.14

Weekly downloads
2
License
-
Repository
github
Last release
8 years ago

grunt-jsonschema-amd-restclient-generator

Generate an AMD client for REST web services described by a JSON Schema.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-jsonschema-amd-restclient-generator --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-jsonschema-amd-restclient-generator');

The "jsonschema_amd_restclient_generator" task

Overview

In your project's Gruntfile, add a section named jsonschema_amd_restclient_generator to the data object passed into grunt.initConfig().

grunt.initConfig({
  jsonschema_amd_restclient_generator: {
    custom_options: {
      /* Task-specific options go here. */
    }
  }
});

Options

options.base_url

Type: String

The URI of the JSON Schema.

options.output_name

Type: String

The name of the final AMD library.

Usage Examples

Custom Options

This is an example of the use of the plugin to generate the AMD client for FAOSTAT APIs. The final reslt, FAOSTATClient.min.js, will be available in the dist folder.

'use strict';

module.exports = function (grunt) {

    /* Project configuration. */
    grunt.initConfig({

        /* Plugin configuration. */
        jsonschema_amd_restclient_generator: {
            custom_options: {
                options: {
                    base_url: 'http://localhost:8080/faostat-api/v1.0/',
                    output_name: 'test-client'
                }
            }
        }

    });

    /* Load NPM tasks. */
    grunt.loadNpmTasks('grunt-jsonschema-amd-restclient-generator');

    /* Register task. */
    grunt.registerTask('default', ['jsonschema_amd_restclient_generator']);

};
0.2.14

8 years ago

0.2.13

8 years ago

0.2.12

8 years ago

0.2.11

9 years ago

0.2.10

9 years ago

0.2.9

9 years ago

0.2.8

9 years ago

0.2.7-np

9 years ago

0.2.6

9 years ago

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.9

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago