Socket
Socket
Sign inDemoInstall

bootprint-openapi

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootprint-openapi - npm Package Compare versions

Comparing version 0.17.0 to 0.17.1

4

CHANGELOG.md
# Release notes
<a name="current-release"></a>
# Version 0.17.1 (Sat, 17 Dec 2016 08:24:37 GMT)
* [fa9f407](https://github.com/bootprint/bootprint-openapi/commit/fa9f407) Render response examples as highlighted text, if it is not an Object. (#82) - Nils Knappmeier
# Version 0.17.0 (Fri, 01 Jul 2016 07:53:44 GMT)

@@ -5,0 +9,0 @@

@@ -0,1 +1,8 @@

var _ = require('lodash')
var highlight = require('highlight.js')
highlight.configure({
'useBR': true
})
module.exports = {

@@ -74,3 +81,33 @@ 'swagger--collection-format': function (value, paramName) {

}[code]
},
/**
* Render the value of an [Example object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#exampleObject)
*
* * If the mime-type is `application/json`, and the example is an object,
* it will be stringified
*
* * If the mime-type is `application/xml`, and the example is an object,
* the json should be converted to XML (which is not the case at the moment
* TODO, help wanted)
*
* @param {any} example the value of an [Example Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#exampleObject)
* @param {string} mimeType the mime-type of this example
*/
'swagger--example': function (example, mimeType, options, customize) {
if (_.isObject(example)) {
switch (mimeType) {
case 'application/json':
example = require('json-stable-stringify')(example, {space: 4})
break
case 'application/xml':
// TODO: This should actually convert the example to XML but I don't know how yet. "help wanted"
example = require('json-stable-stringify')(example, {space: 4})
break
}
}
var highlighted = highlight.highlightAuto(String(example)).value
var fixMarkup = highlight.fixMarkup(highlighted)
return new customize.engine.SafeString('<pre>' + fixMarkup + '</pre>')
}
}

4

package.json
{
"name": "bootprint-openapi",
"version": "0.17.0",
"version": "0.17.1",
"description": "Converts a openapi-definition into a static html page",

@@ -22,2 +22,4 @@ "main": "index.js",

"bootprint-json-schema": "<1.0.0",
"highlight.js": "^8.9.1",
"json-stable-stringify": "^1.0.1",
"lodash": "^3.9.3"

@@ -24,0 +26,0 @@ },

Sorry, the diff of this file is not supported yet

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