Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@digitalroute/bagger

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitalroute/bagger

🎒 A joi-compatible tool for building swagger definitions

  • 2.4.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32
increased by3100%
Maintainers
4
Weekly downloads
 
Created
Source

🎒 Bagger

npm (scoped) npm CircleCI license

A joi-compatible tool for building Swagger (Open API 3) documents. It enables developers to use the same joi schemas for validation and documentation, ensuring that API documentation never becomes stale.

Features

  • 🔨 Builder pattern: Dead simple api to create complex Swagger documents.
  • joi compatibility: Enables developers to use the same schemas for validation and documentation.
  • 🔎 Intellisense: Really nice intellisense suggestions, and TypeScript definitions.
  • 🔒 Type safety: Bagger always produces 100% valid Swagger documents. If you use TypeScript the compiler will enforce correctness in most cases, and otherwise Bagger will validate during compilation.

Example

const bagger = require('@digitalroute/bagger');
const joi = require('@hapi/joi');

bagger.configure({
  title: 'Bagger API',
  version: 'v1',
  description: 'Provides resources for building swagger documents'
});

bagger
  .addRequest()
  .method('get')
  .path('/bags')
  .tag('bags')
  .tag('build')
  .responses([
    bagger
      .response(200)
      .description('Successfully fetched all bags')
      .content(
        'application/json',
        joi
          .array()
          .items(joi.string())
          .example(['handbag', 'backpack'])
      )
  ]);

const swaggerDefinition = bagger.compile();

Documentation

Keywords

FAQs

Package last updated on 09 Oct 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc