Skip to content

Commit

Permalink
fix: broken example code regression issues
Browse files Browse the repository at this point in the history
  • Loading branch information
glennjones committed Jun 11, 2022
1 parent 7b2e92a commit 72ad64b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions examples/assets/routes-complex.js
Expand Up @@ -471,7 +471,7 @@ module.exports = [
}
},
tags: ['api', 'reduced', 'three'],
validate: Joi.object({
validate: {
payload: Joi.object({
a: Joi.number().required().description('the first number'),
b: Joi.number().required().description('the second number'),
Expand All @@ -489,7 +489,7 @@ module.exports = [
.valid('application/json', 'application/vnd.api+json')
.default('application/vnd.api+json')
}).unknown()
})
}
}
},
{
Expand Down
22 changes: 10 additions & 12 deletions examples/swagger-client.js
Expand Up @@ -52,11 +52,10 @@ const routes = [
}
},
validate: {
params: {
params: Joi.object({
a: Joi.number().required().description('the first number'),

b: Joi.number().required().description('the second number')
}
})
}
}
},
Expand All @@ -73,11 +72,10 @@ const routes = [
}
},
validate: {
params: {
params: Joi.object({
a: Joi.number().required().description('the first number'),

b: Joi.number().required().description('the second number')
}
})
}
}
},
Expand All @@ -89,11 +87,10 @@ const routes = [
description: 'Add',
tags: ['api'],
validate: {
params: {
params: Joi.object({
a: Joi.number().required().description('the first number'),

b: Joi.number().required().description('the second number')
}
})
}
}
}
Expand Down Expand Up @@ -155,9 +152,9 @@ ser()
console.error(error);
});

client
.execute({
operationId: 'add',
client.execute({
pathName: '/math/add/{a}/{b}',
method: 'put',
parameters: { a: 9, b: 9 }
})
.then((data) => {
Expand All @@ -166,6 +163,7 @@ ser()
.catch((error) => {
console.error(error);
});

});
})
.catch((err) => {
Expand Down
4 changes: 2 additions & 2 deletions examples/upload-file.js
Expand Up @@ -77,9 +77,9 @@ const routes = [
},
tags: ['api'],
validate: {
payload: {
payload: Joi.object({
file: Joi.any().meta({ swaggerType: 'file' }).description('json file')
}
})
},
payload: {
maxBytes: 1048576,
Expand Down

0 comments on commit 72ad64b

Please sign in to comment.