Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Delete('/:username')
@ApiOperation({
description: 'This can only be done by the logged in user.',
operationId: 'deleteUser',
responses: {},
summary: 'Delete user'
})
@ApiParameter({
description: 'The name that needs to be deleted',
in: 'path',
name: 'username',
required: true,
schema: { type: 'string' }
})
@ApiResponse(400, { description: 'Invalid username supplied', content: {} })
@ApiResponse(404, { description: 'User not found', content: {} })
deleteUser() {}
}
const yamlDocument = readFileSync(join(__dirname, './assets/openapi.yml'), 'utf8');
const expectedDocument = parse(yamlDocument);
const actualDocument = createOpenApiDocument(ApiController);
deepStrictEqual(actualDocument, expectedDocument);
});
description: 'name that need to be updated',
in: 'path',
name: 'username',
required: true,
schema: { type: 'string' }
})
@ApiRequestBody({
content: {
'*/*': {
schema: { $ref: '#/components/schemas/User' }
}
},
description: 'Updated user object',
required: true
})
@ApiResponse(400, { description: 'Invalid user supplied', content: {} })
@ApiResponse(404, { description: 'User not found', content: {} })
updateUser() {}
@Delete('/:username')
@ApiOperation({
description: 'This can only be done by the logged in user.',
operationId: 'deleteUser',
responses: {},
summary: 'Delete user'
})
@ApiParameter({
description: 'The name that needs to be deleted',
in: 'path',
name: 'username',
required: true,
schema: { type: 'string' }
summary: 'Update an existing pet',
})
@ApiRequestBody({
content: {
'application/json': {
schema: { $ref: '#/components/schemas/Pet' }
},
'application/xml': {
schema: { $ref: '#/components/schemas/Pet' }
},
},
description: 'Pet object that needs to be added to the store',
required: true
})
@ApiResponse(400, { description: 'Invalid ID supplied', content: {} })
@ApiResponse(404, { description: 'Pet not found', content: {} })
@ApiResponse(405, { description: 'Validation exception', content: {} })
@ApiSecurityRequirement({
petstore_auth: ['write:pets', 'read:pets']
})
updatePet() { }
@Post()
@ApiOperation({
operationId: 'addPet',
responses: {},
summary: 'Add a new pet to the store'
})
@ApiRequestBody({
content: {
'application/json': {
schema: { $ref: '#/components/schemas/Pet' }
})
@ApiParameter({
description: 'The user name for login',
in: 'query',
name: 'username',
required: true,
schema: { type: 'string' }
})
@ApiParameter({
description: 'The password for login in clear text',
in: 'query',
name: 'password',
required: true,
schema: { type: 'string' }
})
@ApiResponse(200, {
content: {
'application/json': {
schema: { type: 'string' }
},
'application/xml': {
schema: { type: 'string' }
},
},
description: 'successful operation',
headers: {
'X-Expires-After': {
description: 'date in UTC when token expires',
schema: {
format: 'date-time',
type: 'string',
}
@Delete('/:username')
@ApiOperation({
description: 'This can only be done by the logged in user.',
operationId: 'deleteUser',
responses: {},
summary: 'Delete user'
})
@ApiParameter({
description: 'The name that needs to be deleted',
in: 'path',
name: 'username',
required: true,
schema: { type: 'string' }
})
@ApiResponse(400, { description: 'Invalid username supplied', content: {} })
@ApiResponse(404, { description: 'User not found', content: {} })
deleteUser() {}
}
const yamlDocument = readFileSync(join(__dirname, './assets/openapi.yml'), 'utf8');
const expectedDocument = parse(yamlDocument);
const actualDocument = createOpenApiDocument(ApiController);
deepStrictEqual(actualDocument, expectedDocument);
});
in: 'path',
name: 'username',
required: true,
schema: { type: 'string' }
})
@ApiRequestBody({
content: {
'*/*': {
schema: { $ref: '#/components/schemas/User' }
}
},
description: 'Updated user object',
required: true
})
@ApiResponse(400, { description: 'Invalid user supplied', content: {} })
@ApiResponse(404, { description: 'User not found', content: {} })
updateUser() {}
@Delete('/:username')
@ApiOperation({
description: 'This can only be done by the logged in user.',
operationId: 'deleteUser',
responses: {},
summary: 'Delete user'
})
@ApiParameter({
description: 'The name that needs to be deleted',
in: 'path',
name: 'username',
required: true,
schema: { type: 'string' }
})
@Post('/order')
@ApiOperation({
operationId: 'placeOrder',
responses: {},
summary: 'Place an order for a pet'
})
@ApiRequestBody({
content: {
'*/*': {
schema: { $ref: '#/components/schemas/Order' }
}
},
description: 'order placed for purchasing the pet',
required: true
})
@ApiResponse(200, {
content: {
'application/json': {
schema: { $ref: '#/components/schemas/Order' }
},
'application/xml': {
schema: { $ref: '#/components/schemas/Order' }
},
},
description: 'successful operation'
})
@ApiResponse(400, { description: 'Invalid Order', content: {} })
placeOrder() { }
@Get('/order/:orderId')
@ApiOperation({
description: 'For valid response try integer IDs with value >= 1 and <= 10. Other'
responses: {},
summary: 'Add a new pet to the store'
})
@ApiRequestBody({
content: {
'application/json': {
schema: { $ref: '#/components/schemas/Pet' }
},
'application/xml': {
schema: { $ref: '#/components/schemas/Pet' }
},
},
description: 'Pet object that needs to be added to the store',
required: true,
})
@ApiResponse(405, { description: 'Invalid input', content: {} })
@ApiSecurityRequirement({
petstore_auth: ['write:pets', 'read:pets']
})
addPet() { }
@Get('/findByStatus')
@ApiOperation({
description: 'Multiple status values can be provided with comma separated strings',
operationId: 'findPetsByStatus',
responses: {},
summary: 'Finds Pets by status',
})
@ApiParameter({
description: 'Status values that need to be considered for filter',
explode: true,
in: 'query',
responses: {},
summary: 'Update an existing pet',
})
@ApiRequestBody({
content: {
'application/json': {
schema: { $ref: '#/components/schemas/Pet' }
},
'application/xml': {
schema: { $ref: '#/components/schemas/Pet' }
},
},
description: 'Pet object that needs to be added to the store',
required: true
})
@ApiResponse(400, { description: 'Invalid ID supplied', content: {} })
@ApiResponse(404, { description: 'Pet not found', content: {} })
@ApiResponse(405, { description: 'Validation exception', content: {} })
@ApiSecurityRequirement({
petstore_auth: ['write:pets', 'read:pets']
})
updatePet() { }
@Post()
@ApiOperation({
operationId: 'addPet',
responses: {},
summary: 'Add a new pet to the store'
})
@ApiRequestBody({
content: {
'application/json': {
description: 'Status values that need to be considered for filter',
explode: true,
in: 'query',
name: 'status',
required: true,
schema: {
items: {
default: 'available',
enum: ['available', 'pending', 'sold'],
type: 'string'
},
type: 'array',
},
style: 'form'
})
@ApiResponse(200, {
content: {
'application/json': {
schema: {
items: { $ref: '#/components/schemas/Pet' },
type: 'array',
}
},
'application/xml': {
schema: {
items: { $ref: '#/components/schemas/Pet' },
type: 'array',
}
},
},
description: 'successful operation',
})