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

fury-adapter-oas3-parser

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fury-adapter-oas3-parser - npm Package Compare versions

Comparing version 0.7.0 to 0.7.2

7

CHANGELOG.md
# Fury OAS3 Parser Changelog
## 0.7.2 (2019-04-01)
### Bug Fixes
- Added validation of media types, previously we would throw an error while
handling invalid media types.
## 0.7.0 (2019-03-26)

@@ -4,0 +11,0 @@

25

lib/parser/oas/parseMediaTypeObject.js
const R = require('ramda');
const mediaTyper = require('media-typer');
const pipeParseResult = require('../../pipeParseResult');
const { isExtension, hasKey, getValue } = require('../../predicates');
const {
isExtension, hasKey, getKey, getValue,
} = require('../../predicates');
const {
createWarning,

@@ -47,2 +49,11 @@ createUnsupportedMemberWarning,

const isValidMediaType = (mediaType) => {
try {
mediaTyper.parse(mediaType.toValue());
} catch (error) {
return false;
}
return true;
};
/**

@@ -63,2 +74,10 @@ * Parse Media Type Object

const createInvalidMediaTypeWarning = mediaType => createWarning(namespace,
`'${name}' media type '${mediaType.toValue()}' is invalid`, mediaType);
const validateMediaType = R.unless(
R.compose(isValidMediaType, getKey),
R.compose(createInvalidMediaTypeWarning, getKey)
);
const createExamplesNotJSONWarning = createWarning(namespace,

@@ -104,2 +123,4 @@ `'${name}' 'examples' is only supported for JSON media types`);

const parseMediaType = pipeParseResult(namespace,
validateMediaType,
getValue,
parseObject(context, name, parseMember),

@@ -152,5 +173,5 @@ (mediaTypeObject) => {

return parseMediaType(element.value);
return parseMediaType(element);
}
module.exports = R.curry(parseMediaTypeObject);

4

package.json
{
"name": "fury-adapter-oas3-parser",
"version": "0.7.0",
"version": "0.7.2",
"description": "Open API Specification 3 API Elements Parser",

@@ -39,3 +39,3 @@ "author": "Apiary.io <support@apiary.io>",

},
"gitHead": "853dfac567e80f4c57b6058eabcc231d282753a5"
"gitHead": "3b66bdecfc9232e008843a7c78b51fdf13e7cc72"
}
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