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

implement expressive toString methods for model objects #609

Closed
herrwieger opened this issue Mar 4, 2016 · 6 comments
Closed

implement expressive toString methods for model objects #609

herrwieger opened this issue Mar 4, 2016 · 6 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. CodeGen Issues that relate to code generation
Milestone

Comments

@herrwieger
Copy link

Currently most of the classes in the models packages have no toString method. For logging its essential to get meaningful output from model objects via toString. Although its boring work, adding toString methods would make debugging way more fun and increase the usefulness of the sdk.

@jianghaolu jianghaolu assigned jianghaolu and unassigned jianghaolu Mar 30, 2016
@jianghaolu
Copy link
Contributor

Hi @herrwieger

Thanks for your advice. I will park this until the iteration slows down and I get some time to get back to this. After the same time, if you'd like to contribute or have an urgent need, please feel free to make your changes in our template for all models: https://github.com/Azure/autorest/blob/master/AutoRest/Generators/Java/Java/Templates/ModelTemplate.cshtml. Changes in that template will be propagated to all models in the SDK.

@martinsawicki
Copy link

perhaps this will be part of our JSON serialization work, so on the To Do list for now.

@martinsawicki martinsawicki added this to the Backlog milestone Jul 25, 2017
@martinsawicki
Copy link

@anuchandy just some food for thought perhaps related to the JSon serialization investigation

@praries880 praries880 added the Mgmt This issue is related to a management-plane library. label Nov 13, 2018
@praries880
Copy link
Contributor

@anuchandy Any updates on this issue?

@jianghaolu
Copy link
Contributor

Potential autorest v3 item.

@joshfree joshfree removed this from the Sprint : 1/28/2019 - 2/15/2019 milestone Oct 2, 2019
@joshfree joshfree added CodeGen Issues that relate to code generation and removed Mgmt This issue is related to a management-plane library. labels Feb 19, 2020
@joshfree joshfree added the Client This issue points to a problem in the data-plane of the library. label Jul 16, 2020
@joshfree joshfree added this to the Backlog milestone Jul 16, 2020
@jianghaolu
Copy link
Contributor

Due to the extensive amount of custom serialization we do in the pipeline, there's no simple toString() implementation available. A simple toString() implementation will be confusing as it will differ from what's sent to the service. I would suggest adding in your watch window JacksonAdapter.createDefaultSerializerAdapter().serialize(modelObject).

@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. CodeGen Issues that relate to code generation
Projects
None yet
Development

No branches or pull requests

6 participants