If you can't get a normalized JSON from server (wich in my point of
view it's the correct way to do things), you can do this in JS. From
my point of view foreach must work always with arrays. The propertys
can have values or even be dependantObservables for view interaction,
so if you pretend to iterate propertys, you lose the main capability
of KO wich allows to manage your view from with viewstate's values.
Imagine for example you need to allow user an option to enable /
disable each animal... If you make foreach over object property's you
lose the option to put a property "Selected" in each animal... (Hope
be clear with the example).
About "Json generation it's not precise"... I don't agree with this...
JSON generation is a serialization of your information, if you can't
control the structure of your information, you can't do anything... So
maybe the solution it's to look another JSON serialization or process
your information to have a normalized message.
I make an example with your JSON data in Javascript, this example
iterate over the JSON information and create a normalized array with
"category" (property, dog, cat..) and "name".
http://jsfiddle.net/kCqKR/11/
As you can see, it's really simple, just know how your messages come,
read your data and do the structures you need for your viewmodel...
Hope helps you.
Leandro
PS: Sorry for my english!!! I hope not be rude with my forms.