
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
github.com/NurlashKO/go-httpdoc
go-httpdoc
is a Golang package to generate API documentation from httptest
test cases.
It provides a simple http middleware which records http requests and responses from tests and generates documentation automatically in markdown format. See Sample Documentation. It also provides a way to validate values are equal to what you expect with annotation (e.g., you can add a description for headers, params or response fields). If you write proper tests, it will generate usable documentation (namely, it forces you to write good tests).
Not only JSON request and response but it also supports protocol buffer. See Sample ProtoBuf Documentation).
See usage and example in GoDoc.
NOTE: This package is experimental and may make backward-incompatible changes.
go-httpdoc requires Go 1.7 or later.
Use go get:
$ go get -u go.mercari.io/go-httpdoc
All usage are described in GoDoc.
To generate documentation, set the following env var:
$ export HTTPDOC=1
The original idea came from r7kamura/autodoc (rack middleware).
For struct inspection in validator, it uses tenntenn/gpath package.
FAQs
Unknown package
Did you know?
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.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.