Skip to content

Conversation

@pakrym
Copy link
Contributor

@pakrym pakrym commented Apr 14, 2020

Minor naming and serialization changes.
Additional CodeGenMember attributes:

Bug fix for FormRecognizer overloads.
Time type support.

@pakrym pakrym requested review from heaths and tg-msft and removed request for tg-msft April 14, 2020 17:34
<_SupportsCodeGeneration Condition="'$(IsClientLibrary)' == 'true'">true</_SupportsCodeGeneration>
<_DefaultInputName Condition="Exists('$(MSBuildProjectDirectory)/autorest.md')">$(MSBuildProjectDirectory)/autorest.md</_DefaultInputName>
<AutorestInput Condition="'$(AutorestInput)' == ''">$(_DefaultInputName)</AutorestInput>
<AutorestConfiguration Condition="'$(AutorestConfiguration)' == '' AND '$(AutorestInput)' != '$(_DefaultInputName)'">$(_DefaultInputName)</AutorestConfiguration>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need this feature. Autorest now supports including remote config into a local one.


namespace Azure.Search.Documents.Models
{
[CodeGenSuppress(nameof(SynonymMap), typeof(string), typeof(string))]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't suppress generated ctors any more if you have a custom one so this have to be done manually.

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

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

Sampling of Search and general changes LGTM, though a couple of questions.

{
public static HttpPipeline Build(TokenCredential credential, ClientOptions options)
{
return HttpPipelineBuilder.Build(options, new BearerTokenAuthenticationPolicy(credential, "https://management.azure.com//.default"));
Copy link
Member

Choose a reason for hiding this comment

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

Probably not a big deal since they usually get canonicalized, but did you mean for two "//" here toward the end of the URI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, actually @schaabs told me to do it :)

Copy link
Contributor

@schaabs schaabs Apr 14, 2020

Choose a reason for hiding this comment

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

It's not technically a URI it's a scope string, which has to be exact. Since the resource string registered with AAD, "https://management.azure.com/", ends in a "/" the default scope has the two "//", "https://management.azure.com//.default". It's unfortunate because it's inconsistent between services, and is dependent on how the resource was registered with AAD. For instance the resource for key vault is "https://vaults.azure.net" doesn't end in a "/" so its default scope, "https://vaults.azure.net/.default" does not have the double slashes.

public override bool Equals(object obj) => obj is AnalyzerName other && Equals(other);
/// <inheritdoc />
public bool Equals(AnalyzerName other) => string.Equals(_value, other._value, StringComparison.Ordinal);
public bool Equals(AnalyzerName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
Copy link
Member

Choose a reason for hiding this comment

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

Were the extensible enum struct guidelines updated? This is a change from them. It was intentional, but open for change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Guidelines don't define any comparison. There is a sample that uses Ordinal but it's not explicitly mandated. https://azure.github.io/azure-sdk/dotnet_implementation.html#dotnet-enums

Copy link
Member

Choose a reason for hiding this comment

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

I know - I wrote that after discussing the finer points with the team. :) We should be consistent across implementations. If we're going to accept case-insensitive parsing, we should do so at least by default across implementations.

Copy link
Member

Choose a reason for hiding this comment

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

@heaths @pakrym The service decides whether these things are case-insensitive or not, not the client. I don't think it's possible to have a generated implementation that works for the general case.

@maririos
Copy link
Member

Thanks Pavel!

Copy link
Member

@tg-msft tg-msft left a comment

Choose a reason for hiding this comment

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

Looks good.

Also, if anyone knows how to tell linguist to expand everything in the github PR view, that would be a nifty trick for these PRs where I want to just keep scrolling.

Comment on lines -26 to +33
array.Add(TokenInfo.DeserializeTokenInfo(item));
if (item.ValueKind == JsonValueKind.Null)
{
array.Add(null);
}
else
{
array.Add(TokenInfo.DeserializeTokenInfo(item));
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't have a problem with this - but any reason not to pass it into the DeserializeTokenInfo method and let it handle how it chooses to interpret null? If we're going to make it possible to customize Deserialize methods down the road (if we don't already), it might be nice to also customize how null gets handled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting idea I haven't considered doing it this way yet. Not sure I want to change it before we have use cases but I'll keep it mind.

@pakrym
Copy link
Contributor Author

pakrym commented Apr 14, 2020

Also, if anyone knows how to tell linguist to expand everything in the github PR view, that would be a nifty trick for these PRs where I want to just keep scrolling.

Using Refined Github extension you can alt+click on Load diff text and all would get expanded.

@pakrym pakrym merged commit 72e0029 into Azure:master Apr 14, 2020
@pakrym pakrym deleted the pakrym/update-generator-14 branch April 14, 2020 20:36
@heaths
Copy link
Member

heaths commented Apr 14, 2020

I have on my personal backlog to push a PR to github.vscode-pull-request-github to allow it to handle system URI monikers (Code supports this) and then write a simple browser extension to add an "Open in Code" button, similar to what AzDO has for VS. But if someone got to this first...cool.

@pakrym
Copy link
Contributor Author

pakrym commented Apr 14, 2020

If only VS code Github review didn't have 300 file count limit..

@heaths
Copy link
Member

heaths commented Apr 14, 2020

Is that only if reviewing the PR itself vs. checking out the branch? I thought the latter was possible for larger PRs (and provides more context).

@pakrym
Copy link
Contributor Author

pakrym commented Apr 14, 2020

Only for PR review feature. For checkout it uses git so that works fine.

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.

6 participants