Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Serializer] @SerializedName flattening nested attributes #32080

Copy link
Copy link
@piotrooo

Description

@piotrooo
Issue body actions

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;
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureHelp wantedIssues and PRs which are looking for volunteers to complete them.Issues and PRs which are looking for volunteers to complete them.Serializer

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.