-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
WIP on new format changes #39817
WIP on new format changes #39817
Conversation
API change check APIView has identified API level changes in this PR and created following API reviews. |
sdk/core/System.Net.ClientModel/src/ModelReaderWriter/IJsonModel.cs
Outdated
Show resolved
Hide resolved
sdk/core/System.Net.ClientModel/src/ModelReaderWriter/IModel.cs
Outdated
Show resolved
Hide resolved
{ | ||
bool implementsJson = model is IJsonModel<T>; | ||
bool isValid = (format == ModelReaderWriterFormat.Json && implementsJson) || format == "W"; | ||
bool isValid = (format == "J" && implementsJson) || format == "W"; |
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.
Curious: would it be valid to do
bool isValid = (format == "J" && implementsJson) || format == "W"; | |
bool isValid = (format == ModelReaderWriterOptions.Json.Format && implementsJson) || format == ModelReaderWriterOptions.Json.Format; |
Asking for two reasons:
- To see if I'm understanding how this works correctly
- Because if we can, I think that'd be preferable to avoid "magic numbers" type errors
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.
We would need to duplicate the constants in all libraries since all libraries will have models which will need to compare against these values.
This is one of the "downsides" to removing the ModelReaderWriterFormat, but it removes ambiguity around the conceptual formats wire
and data
and the concrete data interchange formats json
, xml
, etc.
…zure#39478) * initial move to separate model reader writer in System.Net.ClientModel * update api * update doc settings for readme * address pr feedback * first cut at readme / changelog * fix perf issue in helper methods * add perf for srcgen * address feedback * update IModel to have a GetWireFormat * update api * update ci * remove GetOptions * WIP on new format changes (Azure#39817) * wip on new format changes * more tweaks to the API * impl tweaks * address feedback * update api * fix tests * address feedback * rename based on feedback (Azure#39885) * Remove wire (Azure#40021) * remove wire * Update sdk/core/Azure.Core/tests/common/Internal/ModelReaderWriterHelper.cs Co-authored-by: Anne Thompson <[email protected]> * revert nullability since azure core tests don't support this right now --------- Co-authored-by: Anne Thompson <[email protected]> * Rename package (Azure#40030) * rename package * comment out bad test * feedback * more feedback * update basic sample * remove next steps * update docs * address feedback * remove unused frozen code * address feedback * address additional feedback * update ci.yml * move file inside mrw folder * Add exception documentation * move helper file * update comment * readme feedback * follow static field convention * remove unecessary interlock * add azure sdk analyzers back * throw when cancelled * remove unused #if * remove azureicon * update readme * fix package icon * remove unnecessary conditions --------- Co-authored-by: Anne Thompson <[email protected]>
Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.