
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
api-blueprint-http-formatter
Advanced tools
Format pair of HTTP Request and Response to API Blueprint format
It accepts object with request
and response
keys in format used by Gavel and returns it back in API Blueprint format
var bf = require('./src/api-blueprint-http-formatter');
var post = {
"request": {
"method": "POST",
"uri": "/shopping-cart",
"headers": {
"User-Agent": "curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5",
"Host": "curltraceparser.apiary.io",
"Accept": "*/*",
"Content-Type": "application/json",
"Content-Length": "39"
},
"body": "{ \"product\":\"1AB23ORM\", \"quantity\": 2 }"
},
"response": {
"statusCode": "201",
"statusMessage": "Created",
"headers": {
"Content-Type": "application/json",
"Date": "Sun, 21 Jul 2009 14:51:09 GMT",
"X-Apiary-Ratelimit-Limit": "120",
"X-Apiary-Ratelimit-Remaining": "119",
"Content-Length": "50",
"Connection": "keep-alive"
},
"body": "{ \"status\": \"created\", \"url\": \"/shopping-cart/2\" }"
}
};
blueprint = bf.format(post);
console.log(blueprint);
# POST /shopping-cart
+ Request
+ Headers
User-Agent:curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5
Host:curltraceparser.apiary.io
Accept:*/*
Content-Type:application/json
Content-Length:39
+ Body
{ "product":"1AB23ORM", "quantity": 2 }
+ Response 201
+ Headers
Content-Type:application/json
Date:Sun, 21 Jul 2009 14:51:09 GMT
X-Apiary-Ratelimit-Limit:120
X-Apiary-Ratelimit-Remaining:119
Content-Length:50
Connection:keep-alive
+ Body
{ "status": "created", "url": "/shopping-cart/2" }
Use Protagoinst, Api Blueprint Node.js parser to parse or canonical Snowcrash parser to get Blueprint AST
format(pair)
- returns string with message pair in API blueprint format
FAQs
Format pair of HTTP Request and Response to API Blueprint format
The npm package api-blueprint-http-formatter receives a total of 9,908 weekly downloads. As such, api-blueprint-http-formatter popularity was classified as popular.
We found that api-blueprint-http-formatter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.