Linux: Where to put the swap file
Solution 1:
AFAIK there is no location defined in the File System Hierarchy Standard.
Because /var is for often-changed files, I would say it is okay to place it here. But remember that if you use a flat-file swap instead of a partition, consider to use a fast file system for /var.
Solution 2:
The conventional way is to have a partition dedicated to swap. If you use a file it's at your own discretion, but Malte's suggestion of the file system being important is a good one.