Skip to content

Commit

Permalink
request.query.settings should be object #125
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Dec 3, 2019
1 parent a456482 commit bc44495
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/middlewares/openapi.request.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,16 @@ export class RequestValidator {
if (parameter.content && parameter.content[TYPE_JSON]) {
parameterSchema = parameter.content[TYPE_JSON].schema;
parseJson.push({ name, reqField });
} else if (
// handle complex json types in schema
$in === 'query' &&
(parameterSchema.allOf ||
parameterSchema.oneOf ||
parameterSchema.anyOf ||
(parameterSchema.type === 'object' &&
parameterSchema.type !== 'array'))
) {
parseJson.push({ name, reqField });
}

if (!parameterSchema) {
Expand Down
2 changes: 1 addition & 1 deletion test/serialized.objects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createApp } from './common/app';

const packageJson = require('../package.json');

describe.only(packageJson.name, () => {
describe(packageJson.name, () => {
let app = null;

before(async () => {
Expand Down

0 comments on commit bc44495

Please sign in to comment.