-
Notifications
You must be signed in to change notification settings - Fork 252
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
do not skip_serializing of read only schemas #317
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this just because the read-only authoring couldn't necessarily be trusted? More so just curious. I think the change here looks safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is specific to the client side. I want to be able to do round-trip testing and I want to use the models from the server-side. One reason for read-only is so that the client doesn't send a bunch of the data back to the server. It is an optimization that isn't needed right now. Another design would be to generate a function that could clear the read only values, may be
.clear_read_only()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good optimization that I don't think we do in other language SDKs right now. I imagine the fear is that, for PATCH operations (could be implemented as a PUT as well), missing data handled incorrectly could result in data loss. @pakrym might have more insight into why we still send read-only data back, or if it's just an optimization we haven't yet done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we? We shouldn't be.
https://github.com/Azure/autorest.csharp/blob/feature/v3/test/TestProjects/ModelShapes/Generated/Models/MixedModelWithReadonlyProperty.Serialization.cs#L16-L55
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know we don't for .NET. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And, that said, if it hasn't been a detected problem yet this is probably a safe optimization. Ideally, if we did find a problem it should be a service-side fix since Azure has guidelines on patching resources.