Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flat anonymous struct field #154

Merged
merged 7 commits into from
Mar 2, 2020
Merged

Flat anonymous struct field #154

merged 7 commits into from
Mar 2, 2020

Conversation

micln
Copy link
Contributor

@micln micln commented Feb 25, 2020

What this PR does:

  • flat anonymons fields
  • ignore field with tag hessian:"-"

#153

Special notes for your reviewer:

when find a anonymous field in scanning struct's fields, encoding/json will flat field immediately. but I put the field to queue and flat latter

Does this PR introduce a user-facing change?:

result of encode(object) has changed,
but the method decode is compatibility with previous version

@micln
Copy link
Contributor Author

micln commented Feb 25, 2020

need merge #150 first

@wongoo
Copy link
Contributor

wongoo commented Feb 26, 2020

I will review this PR after #150 being merged.

@fangyincheng
Copy link
Contributor

Pls resolve conflicts @micln

@micln
Copy link
Contributor Author

micln commented Feb 29, 2020

should we support embed pointer like

type Dog struct{
    *Aninal
}

The super class in java will not be null, so the protocal don't need handle it. That means we can't marshal the ptr to a nil (and new a instance to hold feilds).

So I think we don't need to support the embed pointer today.

@micln
Copy link
Contributor Author

micln commented Feb 29, 2020

@fangyincheng @wanghbxxxx @aliiohs pls review this agian, thanks

@wongoo
Copy link
Contributor

wongoo commented Mar 1, 2020

should we support embed pointer like

type Dog struct{
    *Aninal
}

The super class in java will not be null, so the protocal don't need handle it. That means we can't marshal the ptr to a nil (and new a instance to hold feilds).

So I think we don't need to support the embed pointer today.

agree

Copy link
Contributor

@wongoo wongoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@fangyincheng fangyincheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlexStocks
Copy link
Contributor

@micln pls update the readme. add some explanation about java&go inheritance, and the anonymous struct field.

Copy link
Member

@aliiohs aliiohs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wongoo
Copy link
Contributor

wongoo commented Mar 2, 2020

@micln pls push a new PR if need update readme or demo

@wongoo wongoo merged commit 6ae5479 into apache:master Mar 2, 2020
zhaoyunxing92 pushed a commit that referenced this pull request Sep 4, 2021
* fix issue 149 - embed struct

* remove serialUID

* mapping extends to all feilds

* flat

* readme

* update readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants