Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createUsersWithListInput() {}
@Get('/login')
@ApiOperation({
operationId: 'loginUser',
responses: {},
summary: 'Logs user into the system'
})
@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',
},
},
description: 'successful operation'
})
@ApiResponse(400, { description: 'Invalid ID supplied', content: {} })
@ApiResponse(404, { description: 'Pet not found', content: {} })
@ApiSecurityRequirement({ api_key: [] })
getPetById() { }
@Post('/:petId')
@ApiOperation({
operationId: 'updatePetWithForm',
responses: {},
summary: 'Updates a pet in the store with form data'
})
@ApiParameter({
description: 'ID of pet that needs to be updated',
in: 'path',
name: 'petId',
required: true,
schema: {
format: 'int64',
type: 'integer',
}
})
@ApiRequestBody({
content: {
'application/x-www-form-urlencoded': {
schema: {
properties: {
name: { type: 'string', description: 'Updated name of the pet' },
status: { type: 'string', description: 'Updated status of the pet' },
},
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' }
})
@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);
},
},
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'
+ '\nvalues will generated exceptions',
operationId: 'getOrderById',
responses: {},
summary: 'Find purchase order by ID'
})
@ApiParameter({
description: 'ID of pet that needs to be fetched',
in: 'path',
name: 'orderId',
required: true,
schema: {
format: 'int64',
maximum: 10.0,
minimum: 1.0,
type: 'integer',
}
})
@ApiResponse(200, {
content: {
'application/json': {
schema: { $ref: '#/components/schemas/Order' }
},
}
})
@ApiResponse(400, { description: 'Invalid ID supplied', content: {} })
@ApiResponse(404, { description: 'Pet not found', content: {} })
@ApiSecurityRequirement({
petstore_auth: ['write:pets', 'read:pets']
})
deletePet() { }
@Post('/:petId/uploadImage')
@ApiOperation({
operationId: 'uploadFile',
responses: {},
summary: 'uploads an image'
})
@ApiParameter({
description: 'ID of pet to update',
in: 'path',
name: 'petId',
required: true,
schema: {
format: 'int64',
type: 'integer',
}
})
@ApiRequestBody({
content: {
'multipart/form-data': {
schema: {
properties: {
additionalMetadata: {
description: 'Additional data to pass to server',
})
@ApiResponse(400, { description: 'Invalid status value', content: {} })
@ApiSecurityRequirement({
petstore_auth: ['write:pets', 'read:pets']
})
findPetsByStatus() { }
@Get('/findByTags')
@ApiOperation({
description: 'Muliple tags can be provided with comma separated strings. Use tag1,'
+ '\ntag2, tag3 for testing.',
operationId: 'findPetsByTags',
responses: {},
summary: 'Finds Pets by tags'
})
@ApiParameter({
description: 'Tags to filter by',
explode: true,
in: 'query',
name: 'tags',
required: true,
schema: {
items: { type: 'string' },
type: 'array',
},
style: 'form',
})
@ApiResponse(200, {
content: {
'application/json': {
schema: {
items: { $ref: '#/components/schemas/Pet' },
},
description: 'successful operation'
})
@ApiResponse(400, { description: 'Invalid ID supplied', content: {} })
@ApiResponse(404, { description: 'Order not found', content: {} })
getOrderById() { }
@Delete('/order/:orderId')
@ApiOperation({
description: 'For valid response try integer IDs with positive integer value. Negative'
+ '\nor non-integer values will generate API errors',
operationId: 'deleteOrder',
responses: {},
summary: 'Delete purchase order by ID'
})
@ApiParameter({
description: 'ID of the order that needs to be deleted',
in: 'path',
name: 'orderId',
required: true,
schema: {
format: 'int64',
minimum: 1.0,
type: 'integer',
}
})
@ApiResponse(400, { description: 'Invalid ID supplied', content: {} })
@ApiResponse(404, { description: 'Order not found', content: {} })
deleteOrder() { }
}
petstore_auth: ['write:pets', 'read:pets']
})
updatePetWithForm() { }
@Delete('/:petId')
@ApiOperation({
operationId: 'deletePet',
responses: {},
summary: 'Deletes a pet'
})
@ApiParameter({
in: 'header',
name: 'api_key',
schema: { type: 'string' }
})
@ApiParameter({
description: 'Pet id to delete',
in: 'path',
name: 'petId',
required: true,
schema: {
format: 'int64',
type: 'integer',
}
})
@ApiResponse(400, { description: 'Invalid ID supplied', content: {} })
@ApiResponse(404, { description: 'Pet not found', content: {} })
@ApiSecurityRequirement({
petstore_auth: ['write:pets', 'read:pets']
})
deletePet() { }
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',
name: 'status',
required: true,
schema: {
items: {
default: 'available',
enum: ['available', 'pending', 'sold'],
type: 'string'
},
type: 'array',
},
style: 'form'
})
@ApiResponse(200, {
required: true
}))
async create(ctx: Context): Promise {
const result = await this.service.create(ctx.request.body);
return new HttpResponseCreated(result);
}
@Get('/')
async findAll(): Promise {
const repository = await getRepository(this.entity);
const result = await repository.find();
return new HttpResponseCreated(result);
}
@Get('/:id')
@ApiParameter({
in: 'path',
name: 'id',
required: true,
schema: { type: 'integer' }
})
async findById(ctx: Context): Promise {
const result = await this.service.findById(ctx.request.params.id);
if (result) {
return new HttpResponseCreated(result);
}
return new HttpResponseNotFound();
}
@Patch('/:id')
@ApiParameter({
in: 'path',