Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const OpenApiBackend = require('openapi-backend').default;
- start();
- function start() {
- const api = new OpenApiBackend({
- definition: {
- openapi: '3.0.1',
- info: {
- title: 'test',
- version: '1.0.0'
- },
- paths: {
- '/users/{id}': {
- parameters: [{
- in: 'path',
- name: 'id',
- schema: {
- type: 'integer',
- },
- required: true,
- description: 'The user ID.'
- }],
- get: {
- operationId: 'getUsers',
- parameters: [{
- in: 'path',
- name: 'id',
- required: true,
- description: 'A comma-separated list of user IDs.',
- schema: {
- type: 'array',
- items: {type: 'integer'},
- minItems: 1
- },
- explode: false,
- style: 'simple'
- }],
- responses: {
- '200': {
- description: 'OK'
- }
- }
- }
- }
- }
- },
- ajvOpts: {
- allErrors: true,
- }
- });
- api.init();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement