1.0.0 • Published 3 years ago

web-soft-api-viewer v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

web-soft-api-viewer

Installation

npm i web-soft-api-viewer
import Vue from "vue";
import apiViewer from "web-soft-api-viewer";
// global registration
Vue.component("api-viewer", apiViewer);

Usage

All you need to do is add modules prop to <api-viewer>!

<template>
  <api-viewer :modules="modulesData" />
</template>
export default {
  data() {
    return {
      modulesData: {
        moduleName: {
            methodName: {
            description: 'Описание метода',
            public: true, // Можно ли получить доступ без аутентификации.
            params: {
                type: 'object',
                description: 'Описание объекта params',
                required: [ 'prop1' ],
                properties: {
                prop1: {
                    description: 'Описание проп1',
                    type: 'string'
                },
                prop2: {
                    description: 'Описание проп2',
                    type: 'object',
                    required: [],
                    properties: {
                    prop2prop1: {
                        description: 'Описание проп2проп1',
                        type: 'string'
                    }
                    }
                },
                prop3: {
                    description: 'Описание проп3',
                    type: 'number'
                },
                prop4: {
                    description: 'Описание проп4',
                    type: 'array',
                    items: {
                    description: 'Описание элементов массива',
                    type: 'number|object|string'
                    }
                }
                }
            },
            result: {}, //Такой же как и парамс
            emit: {}, //Такой же как и парамс
            transport: 'http' //Необходимый транспорт, для тебя - ненужная инфа
            }
          }
        },
    };
  },
};

Example

cd examples
npm install
npm serve

API

modules: Object, required: Contains API documentation.