@financialforcedev/orizuru-openapi

    2.0.3 • Public • Published

    Orizuru OpenAPI schema generator

    Build Status NSP Status

    Orizuru OpenAPI generator is a module that can generate an OpenAPI document from a map of service name to Avro schemas. Each schema represents an input event that is exposed as a POST path, within the OpenAPI definition.

    Currently OpenAPI version 2.0 documents are generated.

    Install

    $ npm install @financialforcedev/orizuru-openapi
    

    Usage

     
    const 
        openapiGenerator = require('@financialforcedev/orizuru-openapi').generator;
     
    schemaMap = {
      'question': require('./question')
    };
     
    app.get('/openapi/v2', openapiGenerator.generateV2({
        info: {
            version: '1.0.0',
            title: 'Test',
            description: 'My description'
        }, 
        host: 'localhost:3000', 
        basePath: '/api', 
        schemes: ['http']
    }, schemaMap));
     

    Response schema

    The Orizuru project is aimed at asynchronous use cases, so the response schema is always a simple id string.

     
    schema: {
        type: 'object',
        required: ['id'],
            properties: {
            id: {
                type: 'string'
            }
        }
    }
     

    API Docs

    Click to view JSDoc API documentation.

    Install

    npm i @financialforcedev/orizuru-openapi

    DownloadsWeekly Downloads

    5

    Version

    2.0.3

    License

    BSD-3-Clause

    Unpacked Size

    1.08 MB

    Total Files

    52

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar