New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

openapi-enforcer

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-enforcer - npm Package Compare versions

Comparing version 1.22.2 to 1.22.3

8

CHANGELOG.md

@@ -7,2 +7,10 @@ # Change Log

## 1.22.3
### Security
- **Update Dependencies**
Updated some dependencies to address security vulnerabilities.
## 1.22.2

@@ -9,0 +17,0 @@

2

package.json
{
"name": "openapi-enforcer",
"version": "1.22.2",
"version": "1.22.3",
"description": "Library for validating, parsing, and formatting data against open api schemas.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -356,2 +356,118 @@ const expect = require('chai').expect;

describe.skip('issue-156 validate non-primitives in request query string', () => {
let def
let param
beforeEach(async () => {
param = {
name: 'arrayenums',
in: 'query',
schema: {
type: 'array',
items: {
type: 'string',
enum: ['Foo', 'Bar', 'Baz']
}
}
}
def = {
openapi: '3.0.0',
info: { title: '', version: 'v1' },
paths: {
'/foo': {
get: {
parameters: [param],
responses: {
200: { description: 'ok' }
}
}
}
}
}
})
it('will allow query string in path using exploded form style', async () => {
Object.assign(param, { explode: true, style: 'form' })
const [openapi] = await Enforcer(def, { hideWarnings: true, fullResult: true })
const [ req, error ] = openapi.request({
method: 'GET',
path: '/foo?arrayenums=Foo&arrayenums=Bar'
})
expect(req.query.arrayenums).to.deep.equal(['Foo', 'Bar'])
})
it('will allow query string in path using form style', async () => {
Object.assign(param, { explode: false, style: 'form' })
const [openapi] = await Enforcer(def, { hideWarnings: true, fullResult: true })
const [ req, error ] = openapi.request({
method: 'GET',
path: '/foo?arrayenums=Foo,Bar'
})
expect(req.query.arrayenums).to.deep.equal(['Foo', 'Bar'])
})
it('will allow query string in path using exploded space delimited style', async () => {
Object.assign(param, { explode: true, style: 'spaceDelimited' })
const [openapi] = await Enforcer(def, { hideWarnings: true, fullResult: true })
const [ req, error ] = openapi.request({
method: 'GET',
path: '/foo?arrayenums=Foo&arrayenums=Bar'
})
expect(req.query.arrayenums).to.deep.equal(['Foo', 'Bar'])
})
it('will allow query string in path using space delimited style', async () => {
Object.assign(param, { explode: false, style: 'spaceDelimited' })
const [openapi] = await Enforcer(def, { hideWarnings: true, fullResult: true })
const [ req, error ] = openapi.request({
method: 'GET',
path: '/foo?arrayenums=Foo%20Bar'
})
expect(req.query.arrayenums).to.deep.equal(['Foo', 'Bar'])
})
it('will allow query string in path using exploded pipe delimited style', async () => {
Object.assign(param, { explode: true, style: 'pipeDelimited' })
const [openapi] = await Enforcer(def, { hideWarnings: true, fullResult: true })
const [ req, error ] = openapi.request({
method: 'GET',
path: '/foo?arrayenums=Foo&arrayenums=Bar'
})
expect(req.query.arrayenums).to.deep.equal(['Foo', 'Bar'])
})
it('will allow query string in path using pipe delimited style', async () => {
Object.assign(param, { explode: false, style: 'pipeDelimited' })
const [openapi] = await Enforcer(def, { hideWarnings: true, fullResult: true })
const [ req, error ] = openapi.request({
method: 'GET',
path: '/foo?arrayenums=Foo|Bar'
})
expect(req.query.arrayenums).to.deep.equal(['Foo', 'Bar'])
})
it('will allow an array of strings in query map', async () => {
const [openapi] = await Enforcer(def, { hideWarnings: true, fullResult: true })
const [ req, error ] = openapi.request({
method: 'GET',
path: '/foo',
query: {
arrayenums: ['Foo', 'Bar']
}
})
expect(error).to.equal(undefined)
})
it('will allow a string of style form', async () => {
const [ req, error ] = openapi.request({
method: 'GET',
path: '/foo',
query: {
arrayenums: ['Foo', 'Bar']
}
})
expect(error).to.equal(undefined)
})
})
});
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