The short answer is you have to create a function because the "free" getter you receive via the public
mapping doesn't do this.
A better answer is to reconsider the need for the bulk data dump. I will usually suffice if you emit events each time something is inserted into this structure and that means software clients should already be informed about this information. Ergo, why ask for it again given that doing so is gas-intensive and not especially fast. A more complete description of this thinking: https://blog.b9lab.com/the-joy-of-minimalism-in-smart-contract-design-2303010c8b09
Suggestion. Naming conventions:
struct PostStruct {
bytes32 postTag;
string post;
address[] acceptedBy;
uint8[] voteCount;
}
mapping(address => posts) postStructs;
Custom function examples:
function getPostAddressCount(address post, uint row) public returns(uint count) {
return postStructs[post].address.length;
}
function getPostAcceptedBy(address post) public returns(address[] acceptedBy) {
return postStructs[post].acceptedBy;
}
Since the cost of the above function increases with scale to the point of being unworkable, it is a good idea to include a fixed-cost alternative:
function getPostAcceptedByByRow(address post, uint row) public returns(address acceptedBy) {
return postStructs[post].acceptedBy[row];
}
Hope it helps.