func RemoveItem(param ops.RemoveItemParams) middleware.Responder {
	key := param.ID

	if item, ok := items[key]; ok {
		id := item.ID
		title := item.Title
		delete(items, key)
		resp := models.RemoveResponse{ID: &id, Title: &title}
		return ops.NewRemoveItemOK().WithPayload(&resp)
	}

	// if item is not found
	errorObj := models.ErrorResponse("item not found")
	return ops.NewRemoveItemDefault(502).WithPayload(errorObj)
}
// RemoveItem removes an item from the list if exists
RemoveItem removes an item from the list if exists
// RemoveItem removes an item from the list if exists
func RemoveItem(param ops.RemoveItemParams) middleware.Responder {
	key := param.ID
	if item, ok := items[key]; ok {
		id := item.ID
		title := item.Title
		delete(items, key)
		resp := models.RemoveResponse{ID: &id, Title: &title}
		return ops.NewRemoveItemOK().WithPayload(&resp)
	}
	errorObj := models.ErrorResponse("item not found")
	return ops.NewRemoveItemDefault(502).WithPayload(errorObj)
}
func RemoveItem ( param ops . RemoveItemParams ) middleware . Responder { key := param . ID if item , ok := items [ key ] ; ok { id := item . ID title := item . Title delete ( items , key ) resp := models . RemoveResponse { ID : & id , Title : & title } return ops . NewRemoveItemOK ( ) . WithPayload ( & resp ) } errorObj := models . ErrorResponse ( " " ) return ops . NewRemoveItemDefault ( 502 ) . WithPayload ( errorObj ) }
RemoveItem removes an item from the list if exists
RemoveItem removes an item from the list if exists
// if item is not found