Closed
Description
Description
Sometimes I want to flatten a JSON object into POPHPO.
For example Jackson provide following feature in annotation: @JsonProperty("filter.key1")
.
@JsonProperty
like annotation should handle nested values.
Example
Following JSON:
{
"key1": "value1"
"nested": {
"sub_key1": "sub_value1"
"sub_key2": "sub_value2"
}
}
And unmarshalled object:
class Obj
{
/**
* @JsonProperty('key1')
* @var string
*/
private @name;
/**
* @JsonProperty('nested.sub_key1')
* @var string
*/
private @other;
/**
* @JsonProperty('nested.sub_key2')
* @var string
*/
private @anotherAgain;
}