Git Product home page Git Product logo

postman-doc-generator's Introduction

Postman documentation generator

Postman documentation generator is a tool for generating models from the structures in source files and adding them to postman collection schema.

Download and install

go get github.com/madappgang/postman-doc-generator

Usage

For example, if we have a struct type called User,

type User struct {
    // Unique identifier of the user
    ID           string    `json:"id"`
    // Email of the user
    Email        string    `json:"email"`
    HashPassword string    `json:"-"`
    // Status of the user account
    IsActive     bool      `json:"is_active"`
    // Time of user creation
    CreatedAt    time.Time `json:"created_at"`
}

run the command below in the same directory

postman-doc-generator -struct=User

it will create the model using Markdown syntax


### User

Parameter | Type | Description
--------- | ---- | -----------
id | string | Unique identifier of the user
email | string | Email of the user
is_active | bool | Status of the user account
created_at | Time | Time of user creation

and put it into the file postman_collection.json.

Typically this process would be run using go generate, like this:

//go:generate postman-doc-generator -struct=User

With no arguments, it processes the package in the current directory. Otherwise, the flag -source accepts the name of directory with Go source files that belong to a single Go package.

The -struct flag accepts a comma-separated list of structs for generating multiple structs at once.

The -output flag accepts a path to the postman schema file. By default, it is postman_collection.json.

License

Copyright (c) MadAppGang. All rights reserved.

Licensed under the MIT License.

postman-doc-generator's People

Contributors

axelsheva avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.