-
Notifications
You must be signed in to change notification settings - Fork 739
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
Code changes to generate resources/subresources #1769
Code changes to generate resources/subresources #1769
Conversation
Can one of the admins verify this patch? |
Adding @devigned |
LGTM! |
@if (CompositeTypeRba.ShouldAccessorGenerated(Model, property.Name)) | ||
{ | ||
@:@WrapComment("# ", string.Format("@return {0}{1}", property.ModelType.GetYardDocumentation(), CompositeTypeRb.GetPropertyDocumentationString(property))) | ||
// @:@(property.IsReadOnly ? "attr_reader" : "attr_accessor") :@property.Name |
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.
should this be removed?
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.
Done
return false; | ||
} | ||
|
||
public static bool ShouldAccessorGenerated(CompositeType model, string propertyName) |
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.
should method name be "ShouldAccessorBeGenerated" or "NeedsAccessor?"? Can you add some comments on what the method does?
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.
Done
@@ -73,8 +72,11 @@ public CodeGeneratorRba() | |||
continue; | |||
} | |||
|
|||
var modelTemplate = new ModelTemplate { Model = model }; | |||
await Write(modelTemplate, Path.Combine(GeneratorSettingsRb.Instance.modelsPath, CodeNamer.UnderscoreCase(model.Name) + ImplementationFileExtension)); | |||
var modelTemplate = new AzureModelTemplate { Model = model }; |
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.
Looking into AzureModelTemplate the only difference I saw with Model template is an if statement asking if an accessor should be generated and avoid generating it if the model is Resource or Subsresource, is this correct? If so, could we be making the distinction here and producing the template with the accessor (AzureModelTemplate) if the model matches a resource or subsresource, and produce a Model template in the rest of the cases?
or is there another way where we could avoid repeating the code between ModelTemplate and AzureModelTemplate and add a condition to ModelTemplate that can produce the difference?
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.
As discussed offline, since we have to create AzureModelTemplate anyway, it is good to keep the Azure specific model generation in one place than two. I am not convinced that we need to continue to use 2 file. No changes here
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.
I liked the idea that @veronicagg has but looks like you guys already discussed and reached to mutual conclusion
@@ -12,6 +16,10 @@ namespace AutoRest.Ruby.Azure.Model | |||
/// </summary> | |||
public class CompositeTypeRba : CompositeTypeRb | |||
{ | |||
public static readonly Regex nameRegEx = new Regex(@"^(RESOURCE|SUBRESOURCE)$", RegexOptions.IgnoreCase); |
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.
should this be called resourceOrSubresourceRegEx or something like that? I'm not sure nameRegEx describes the purpose of this regex
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.
Done
|
||
return string.Empty; | ||
} | ||
|
||
public static bool IsResourceModelsMatchStandardDefinition(CompositeType model) |
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.
name of the method looks a bit weird, should it be "IsResourceModelMatchingStandardDefinition" or "resourceModelMatchStandardDefinition?" ?
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.
Done
string modelName = model.Name.ToString(); | ||
if ( | ||
(modelName.Equals("SubResource", StringComparison.InvariantCultureIgnoreCase) && | ||
model.Properties.All(property => subResourceRegEx.IsMatch(property.Name.ToString()))) || |
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.
is there a way to query the properties of the actual class/model, instead of hardcoding the subResourceRegEx and resourceRegEx?
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.
Synched up offline. No changes here
var modelTemplate = new ModelTemplate { Model = model }; | ||
await Write(modelTemplate, Path.Combine(GeneratorSettingsRb.Instance.modelsPath, CodeNamer.UnderscoreCase(model.Name) + ImplementationFileExtension)); | ||
var modelTemplate = new AzureModelTemplate { Model = model }; | ||
if(!CompositeTypeRba.nameRegEx.IsMatch(model.Name.ToString()) || !CompositeTypeRba.IsResourceModelsMatchStandardDefinition(model)) |
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.
minor: a space after if
and before (
to keep the formatting consistent across codebase
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.
Done
@@ -12,6 +16,10 @@ namespace AutoRest.Ruby.Azure.Model | |||
/// </summary> | |||
public class CompositeTypeRba : CompositeTypeRb | |||
{ | |||
public static readonly Regex nameRegEx = new Regex(@"^(RESOURCE|SUBRESOURCE)$", RegexOptions.IgnoreCase); |
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.
Why do we need nameRegEx
public?
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.
Because it is used in other files also.
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.
Which file are you referring to? Is that file inherited from here?
@@ -42,15 +50,49 @@ public override string GetBaseTypeName() | |||
if (this.BaseModelType.Extensions.ContainsKey(AzureExtensions.ExternalExtension) || | |||
this.BaseModelType.Extensions.ContainsKey(AzureExtensions.AzureResourceExtension)) | |||
{ | |||
typeName = "MsRestAzure::" + typeName; | |||
if(!nameRegEx.IsMatch(typeName) || !IsResourceModelsMatchStandardDefinition(this)) |
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.
minor: a space after if and before ( to keep the formatting consistent across codebase
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.
Done
} | ||
|
||
return " < " + typeName; | ||
} | ||
else if (nameRegEx.IsMatch(this.Name.ToString())) |
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.
Isn't Name
a Fixable<string>
? Then why call ToString() instead of .Value?
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.
my bad... Changed it
} | ||
|
||
return " < " + typeName; | ||
} | ||
else if (nameRegEx.IsMatch(this.Name.ToString())) | ||
{ | ||
return " < " + "MsRestAzure::" + this.Name.ToString(); |
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.
similar to above comment.
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.
Done
public static bool IsResourceModelsMatchStandardDefinition(CompositeType model) | ||
{ | ||
string modelName = model.Name.ToString(); | ||
if ( |
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.
nit-pick: I wouldn't put too many Boolean expressions in if. I'd split it out.
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 does not seem to be that complex :-) But splitted it anyway
|
||
return string.Empty; | ||
} | ||
|
||
public static bool IsResourceModelsMatchStandardDefinition(CompositeType model) |
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 you really need this method public?
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.
Yes. Used in 2 different files
@@ -2,6 +2,8 @@ | |||
// Licensed under the MIT License. See License.txt in the project root for license information. | |||
|
|||
using System; | |||
using System.Linq; | |||
using System.Text.RegularExpressions; |
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.
minor: additional unused using I guess
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.
Done
@EmptyLine | ||
} | ||
|
||
@foreach (var property in Model.PropertyTemplateModels.Where( each => !each.IsPolymorphicDiscriminator)) |
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.
minor: extra space between (
and each
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.
Done
@@ -0,0 +1,69 @@ | |||
@using System |
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.
The entire file seems like exact copy of ModelTemplate
from Ruby
generator except line number 49. I'd definitely recommend not repeating as long as possible.
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.
Looked into other options. For now, since we are using cshtml files, we do not have anyother option. No changes here
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.
okay then
@@ -66,14 +66,14 @@ public CodeGeneratorRba() | |||
continue; | |||
} | |||
|
|||
if( codeModel.pageModels.Any( each => each.Name.EqualsIgnoreCase(model.Name ) ) ) | |||
if ( codeModel.pageModels.Any( each => each.Name.EqualsIgnoreCase(model.Name ) ) ) |
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.
sorry for the nit-pick here but I don't think this format is the standard we have followed at-least in this code base.
just one space after if
and (
. No spaces bertween (
& codeModel
or between (
& )
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.
Moreover, even you haven't followed the same across your changes as well, so looks like minor formatting error :)
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.
Done
public static readonly Regex nameRegEx = new Regex(@"^(RESOURCE|SUBRESOURCE)$", RegexOptions.IgnoreCase); | ||
private static readonly Regex subResourceRegEx = new Regex(@"^(ID)$", RegexOptions.IgnoreCase); | ||
private static readonly Regex resourceRegEx = new Regex(@"^(ID|NAME|TYPE|LOCATION|TAGS)$", RegexOptions.IgnoreCase); | ||
public static readonly Regex resourceOrSubResourceRegEx = new Regex(@"^(RESOURCE|SUBRESOURCE)$", RegexOptions.IgnoreCase); |
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.
Another minor: why are you formatting all = with vertical alignment? Again not a standard I've seen so for.
Example:
private readonly Fixable<string> _name = new Fixable<string>(); |
I don't want to be a blocker here but I like consistency so if you find too many minor comments please bear with me :)
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.
Changed it... Just a personal choice. But, will change it hereafter
{ | ||
// Skip, handled in the .pageModels section below. | ||
continue; | ||
} | ||
|
||
var modelTemplate = new AzureModelTemplate { Model = model }; | ||
if(!CompositeTypeRba.nameRegEx.IsMatch(model.Name.ToString()) || !CompositeTypeRba.IsResourceModelsMatchStandardDefinition(model)) | ||
if (!CompositeTypeRba.resourceOrSubResourceRegEx.IsMatch(model.Name.ToString()) || !CompositeTypeRba.IsResourceModelMatchingStandardDefinition(model)) |
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.
I am not 100% sure so do we really need ToString()
in model.Name.ToString()
?
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.
This was missed in my previous change. You do not need to convert it to string. Changed it.
/// <param name="model"></param> | ||
/// <param name="propertyName"></param> | ||
/// <returns></returns> | ||
public static bool NeedsAccessor(CompositeType model, string propertyName) | ||
{ | ||
string modelName = model.Name.ToString(); |
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.
I am not 100% sure so do we really need ToString() in model.Name.ToString()?
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.
I am 100% sure. Checked with the debugger also. You need it here.
@@ -73,8 +72,11 @@ public CodeGeneratorRba() | |||
continue; | |||
} | |||
|
|||
var modelTemplate = new ModelTemplate { Model = model }; | |||
await Write(modelTemplate, Path.Combine(GeneratorSettingsRb.Instance.modelsPath, CodeNamer.UnderscoreCase(model.Name) + ImplementationFileExtension)); | |||
var modelTemplate = new AzureModelTemplate { Model = model }; |
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.
I liked the idea that @veronicagg has but looks like you guys already discussed and reached to mutual conclusion
return true; | ||
} | ||
|
||
|
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.
Minor: extra line
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.
removed it
@@ -0,0 +1,69 @@ | |||
@using System |
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.
okay then
@sarangan12 Majority of the code changes looks great. I just left few nit-pick comments. I'd encourage you to fix them so that we stay consistent across code base in open source work for people to follow us. |
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.
Generally code looks good, just a minor comment and agreeing with the formatting comments made by @vishrutshah
} | ||
|
||
return string.Empty; | ||
} | ||
|
||
public static bool IsResourceModelsMatchStandardDefinition(CompositeType model) | ||
/// <summary> | ||
/// Checks if the provided definition of models 'Resource'/'SubResource' matches the standard definition. |
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.
you may want to clarify what standard is here, "as defined in MsRestAzure"
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.
should the description look something like this: "Checks if the provided definition of model, matches the definition of 'Resource'/'SubResource' as defined in MsRestAzure" ?
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.
added the clarification
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.
Thanks a lot @sarangan12 👍 . Changes LGTM!
@@ -66,14 +66,14 @@ public CodeGeneratorRba() | |||
continue; | |||
} | |||
|
|||
if ( codeModel.pageModels.Any( each => each.Name.EqualsIgnoreCase(model.Name ) ) ) | |||
if (codeModel.pageModels.Any( each => each.Name.EqualsIgnoreCase(model.Name))) |
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.
minor: extra space between (
and each
.
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.
minor typo I noticed pointed out in comment, rest looks good
/// Checks if the provided definition of models 'Resource'/'SubResource' matches the standard definition. | ||
/// For other models, it returns false. | ||
/// Checks if the provided definition of models 'Resource'/'SubResource' matches the standard definition, | ||
/// as defined in MsResAzure. For other models, it returns false. |
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.
typo 'MsRestAzure', t is missing in the comment
@azuresdkci retest this please |
@azuresdkci add to whitelist |
@azuresdkci retest this please |
* Ref resolving improvements (#1708) * composite external resolving revised * preprocessor (header resolving) * tmp YAML merging override to unblock arm-recoveryservicesbackup (#1713) [NOTE] - Admin merging because TravisCI has dishonored itself and should be shamed. * tmp composite swagger merge override to unblock arm-recoveryservicesbackup * skip test * Added code to change the data type of ItemType (#1711) * Extension proposal (#1638) [Admin merging - docs ] * fixed typo in autorest.json files * Fixed linefeeds, better c# simplifier * regenerated python (line endings) * regenerated ruby (line endings) * regenerated nodejs (line endings) * regenerated c# (line endings) * regenerated samples (line endings) * merged from master and regenerated * whitelist assemblies that should be signed * imported draft document * [Ruby] Making credentials nil by default (#1677) * Making credentials nil by default * Regenerated Samples * [Linter Rules] M1005, M1006, M1007 & M1009 (#1706) * Implement OperationNameValidation Rule for M1005, M1006, M1007 & M1009 * Update warning message * Adding swagger modeler validation tests * Correcting the clean swagger and improving the rules correctness * [linter Rules] Swagger rules M2005 - long running operation must have valid terminal status codes (#1707) * Long running operations must have valid success response codes. * Adding swagger modeler validation tests for invalid long running reponse codes * Adding nullable check on response codes before schema resolver * Adding positive test case for correctly modeled x-ms-long-running * Correct the merge conflicted resx file syntax * Add insights swagger spec test, add vm extensions to swagger and schema (#1512) * Add ServiceBus AzureResourceSchema acceptance test * Add insights swagger spec test * Add minLength and maxLength support to schema generator * Fixing logic to add missing schema resources * Working on discriminator stuff * Change schemas that only have an 'object' type definition to be empty * Add compute test with extension properties * Add additional enum values for extensionType discriminator * missing test files * Update SwaggerSpecHelper.cs unnecessary file change * Update SwaggerSpecHelper.cs unnecessary file change * [Linter Rules] M2008 for x-ms-mutability extension (#1712) * x-ms-mutability swagger linter rules * Removing <<<< characters * undo unblocking fix (#1718) * Improvements for Mono & Docker users (#1714) * Make Docker shell script executable * Remove unnecessary dependencies * Update documentation for AutoRest Mono/Docker usage * Better preprocessor and 3 bugfixes (#1717) * general $inc handling * more preproc magic * move up path params and do cleanup * fixed Stream.Null codegen * enum default escaping * added operationId and title as optional properties of the example schema (#1725) * Fix NullReferenceException (#1722) See #1721 for problem and solution. * minor code cleanup in swagger validation rule file (#1724) * Generator should not flatten out parameters if they are polymorphic (#1726) * Changes to markdown file generation in AzureResourceSchema generator. (#1715) The doc team requested the following changes so they can start consuming the generated markdown help files. - generate a separate file for each resource type - use namespace/type instead of just namespace - include optional properties in the template sample - move type into its own column - remove line-breaks from tables - re-word some of the boiler-plate text - don't bold text when listing a type's values * Relaxing naming rules to accomodate suffix words in names * [Go] Telemetry tiny detail (#1731) * Fix for credentials switch (#1728) * Fix for list and dict serialization (#1727) * [Java] AutoRest changes by runtime changes (#1703) * Fix some tests with beta5 snapshot runtime * Runtime change: mapperAdapter to serializerAdapter * Runtime change: CollectionFormat moved * Runtime changes: Use RestClient for generic clients * Fix paging test * Get rid of gradle and use maven * Use pluggable response builder * Finish up response builder factory * [Azure/autorest-clientruntime-for-java#119] rename ServiceCall#create() * [fixes Azure/autorest-clientruntime-for-java#125] remove all references to old callback classes * Revert to previous next method annotation * Support fragmented paging * [#1426] Tests for fragment paging * Update scripts and docs to use maven * Support custom logging interceptor * Remove composite swagger modeler fix * Remove android footprint * Reduce complexity on exception construction * Consistent naming for getters and setters * Remove duplicate RestClient imports * Fix maven test runner in gulpfile * Fix Enum name generation * Add JsonProperty everywhere * Regenerate samples * Fixed AutoRest.Python.Azure.Tests.AcceptanceTests.SampleTestForGeneratingPython (#1759) * Update AcceptanceTests.cs * Update SwaggerSpecHelper.cs * Remove Azure extensions configuration from __init__ in Python (#1745) * Remove nextLink check in Python * Remove Azure extensions from __init__ in Python * Regenerate Python tests * [Azure.Python] Update setup.py dependency on msrestazure * [Azure.Python] Regenerate Azure Python tests * Xml support (#1744) * Swagger schema adjustment * wip -1 * removed old xml gen * xml model * tests * real path * additional test * test server * wip 5 * xml wip * missing files * fixes * Tweaked enum serialization * generic deserialization * isWrapped serialization support * rfc date * niklas * new properties * fix response header creation * refactor and remove custom (de)serialization * naming * unnecessary whitespace change * fixed templates to be non-xml sensitive * regen * regen * fixed nullable dictionary xml deserialization and regened petstoreV2 * cleanup * xml serialization fix * fixed testcase * another special case for list serialization * Literate File Formats (#1743) * Drafting Literate docs * test data format * updated doc * more * literate Swagger * added literate-metadata * added literate-metadata * updated docs * Got rid of ReadOnly validation (#1749) * Fixed and improved UniqueResourcePaths linter rule (#1768) * fixed UniqueResourcePaths * addressed feedback * cleaner code gen (less unnecessary code) (#1771) * Make S.X.X a build-time dependency. * Fix #1738 (#1772) * cleaner code gen (less unnecessary code) * add disambiguation * fixed test * regex valitation for dictionary values (#1773) * Code changes to generate resources/subresources (#1769) Code changes to generate resources/subresources in ruby based on the standard definitions defined in MSRestAzure * Removing sanitization for redable output paths * Eliminate // in the Path output * Update SwaggerModelerCompareTests * Fix generation of ARM markdown help files. (#1765) Include API specific name property instead of the generic one (it provides better doc text than the generic "name of the resource" one). Merge AllOf/Properties into a flat list so that AllOf is included. Removed EnsureUniqueFileName as it's not needed. Fix unnecessary nesting output directories. Fixed a silly bug in InlineLink missing a '#' character. * Adding new property for readable log output * Linter Validation rules (#1751) * Adding Validation Rule to check the format for API Version * Fix the regular expression * Added validation to check the HTTP Verb * Added validation to check the properties of resources and their read only preoperties * Added validation is resource validation must have x-ms-azure-resource extension * Fixed the condition * Added Validation to check if the delete operation have empty body * Added validation to validate x-ms-client-name field * Fix the signature * Added validation to check the response of put/get/patch operations * Fixed the signature * Added validation to discourage usage of Guid * Added code to validate if operations API has been implemented * Added code to validate tracked resources * Added code to validate properties of tracked resources * Additional changes * Fix the Build Issue * Response to PR comments * Added Test cases * Added more test cases * Fixing test cases * Removed circular dependency test case * adjusted master's changes & used new razor tool
* Ref resolving improvements (#1708) * composite external resolving revised * preprocessor (header resolving) * tmp YAML merging override to unblock arm-recoveryservicesbackup (#1713) [NOTE] - Admin merging because TravisCI has dishonored itself and should be shamed. * tmp composite swagger merge override to unblock arm-recoveryservicesbackup * skip test * Added code to change the data type of ItemType (#1711) * Extension proposal (#1638) [Admin merging - docs ] * fixed typo in autorest.json files * Fixed linefeeds, better c# simplifier * regenerated python (line endings) * regenerated ruby (line endings) * regenerated nodejs (line endings) * regenerated c# (line endings) * regenerated samples (line endings) * merged from master and regenerated * whitelist assemblies that should be signed * imported draft document * [Ruby] Making credentials nil by default (#1677) * Making credentials nil by default * Regenerated Samples * [Linter Rules] M1005, M1006, M1007 & M1009 (#1706) * Implement OperationNameValidation Rule for M1005, M1006, M1007 & M1009 * Update warning message * Adding swagger modeler validation tests * Correcting the clean swagger and improving the rules correctness * [linter Rules] Swagger rules M2005 - long running operation must have valid terminal status codes (#1707) * Long running operations must have valid success response codes. * Adding swagger modeler validation tests for invalid long running reponse codes * Adding nullable check on response codes before schema resolver * Adding positive test case for correctly modeled x-ms-long-running * Correct the merge conflicted resx file syntax * Add insights swagger spec test, add vm extensions to swagger and schema (#1512) * Add ServiceBus AzureResourceSchema acceptance test * Add insights swagger spec test * Add minLength and maxLength support to schema generator * Fixing logic to add missing schema resources * Working on discriminator stuff * Change schemas that only have an 'object' type definition to be empty * Add compute test with extension properties * Add additional enum values for extensionType discriminator * missing test files * Update SwaggerSpecHelper.cs unnecessary file change * Update SwaggerSpecHelper.cs unnecessary file change * [Linter Rules] M2008 for x-ms-mutability extension (#1712) * x-ms-mutability swagger linter rules * Removing <<<< characters * undo unblocking fix (#1718) * Improvements for Mono & Docker users (#1714) * Make Docker shell script executable * Remove unnecessary dependencies * Update documentation for AutoRest Mono/Docker usage * Better preprocessor and 3 bugfixes (#1717) * general $inc handling * more preproc magic * move up path params and do cleanup * fixed Stream.Null codegen * enum default escaping * added operationId and title as optional properties of the example schema (#1725) * Fix NullReferenceException (#1722) See #1721 for problem and solution. * minor code cleanup in swagger validation rule file (#1724) * Generator should not flatten out parameters if they are polymorphic (#1726) * Changes to markdown file generation in AzureResourceSchema generator. (#1715) The doc team requested the following changes so they can start consuming the generated markdown help files. - generate a separate file for each resource type - use namespace/type instead of just namespace - include optional properties in the template sample - move type into its own column - remove line-breaks from tables - re-word some of the boiler-plate text - don't bold text when listing a type's values * Relaxing naming rules to accomodate suffix words in names * [Go] Telemetry tiny detail (#1731) * Fix for credentials switch (#1728) * Fix for list and dict serialization (#1727) * [Java] AutoRest changes by runtime changes (#1703) * Fix some tests with beta5 snapshot runtime * Runtime change: mapperAdapter to serializerAdapter * Runtime change: CollectionFormat moved * Runtime changes: Use RestClient for generic clients * Fix paging test * Get rid of gradle and use maven * Use pluggable response builder * Finish up response builder factory * [Azure/autorest-clientruntime-for-java#119] rename ServiceCall#create() * [fixes Azure/autorest-clientruntime-for-java#125] remove all references to old callback classes * Revert to previous next method annotation * Support fragmented paging * [#1426] Tests for fragment paging * Update scripts and docs to use maven * Support custom logging interceptor * Remove composite swagger modeler fix * Remove android footprint * Reduce complexity on exception construction * Consistent naming for getters and setters * Remove duplicate RestClient imports * Fix maven test runner in gulpfile * Fix Enum name generation * Add JsonProperty everywhere * Regenerate samples * Fixed AutoRest.Python.Azure.Tests.AcceptanceTests.SampleTestForGeneratingPython (#1759) * Update AcceptanceTests.cs * Update SwaggerSpecHelper.cs * Remove Azure extensions configuration from __init__ in Python (#1745) * Remove nextLink check in Python * Remove Azure extensions from __init__ in Python * Regenerate Python tests * [Azure.Python] Update setup.py dependency on msrestazure * [Azure.Python] Regenerate Azure Python tests * Xml support (#1744) * Swagger schema adjustment * wip -1 * removed old xml gen * xml model * tests * real path * additional test * test server * wip 5 * xml wip * missing files * fixes * Tweaked enum serialization * generic deserialization * isWrapped serialization support * rfc date * niklas * new properties * fix response header creation * refactor and remove custom (de)serialization * naming * unnecessary whitespace change * fixed templates to be non-xml sensitive * regen * regen * fixed nullable dictionary xml deserialization and regened petstoreV2 * cleanup * xml serialization fix * fixed testcase * another special case for list serialization * Literate File Formats (#1743) * Drafting Literate docs * test data format * updated doc * more * literate Swagger * added literate-metadata * added literate-metadata * updated docs * Got rid of ReadOnly validation (#1749) * Fixed and improved UniqueResourcePaths linter rule (#1768) * fixed UniqueResourcePaths * addressed feedback * cleaner code gen (less unnecessary code) (#1771) * Make S.X.X a build-time dependency. * Fix #1738 (#1772) * cleaner code gen (less unnecessary code) * add disambiguation * fixed test * regex valitation for dictionary values (#1773) * Code changes to generate resources/subresources (#1769) Code changes to generate resources/subresources in ruby based on the standard definitions defined in MSRestAzure * Removing sanitization for redable output paths * Eliminate // in the Path output * Update SwaggerModelerCompareTests * Fix generation of ARM markdown help files. (#1765) Include API specific name property instead of the generic one (it provides better doc text than the generic "name of the resource" one). Merge AllOf/Properties into a flat list so that AllOf is included. Removed EnsureUniqueFileName as it's not needed. Fix unnecessary nesting output directories. Fixed a silly bug in InlineLink missing a '#' character. * Adding new property for readable log output * Linter Validation rules (#1751) * Adding Validation Rule to check the format for API Version * Fix the regular expression * Added validation to check the HTTP Verb * Added validation to check the properties of resources and their read only preoperties * Added validation is resource validation must have x-ms-azure-resource extension * Fixed the condition * Added Validation to check if the delete operation have empty body * Added validation to validate x-ms-client-name field * Fix the signature * Added validation to check the response of put/get/patch operations * Fixed the signature * Added validation to discourage usage of Guid * Added code to validate if operations API has been implemented * Added code to validate tracked resources * Added code to validate properties of tracked resources * Additional changes * Fix the Build Issue * Response to PR comments * Added Test cases * Added more test cases * Fixing test cases * Removed circular dependency test case * Cache version strings after first generation. (#1784) * Cache version strings after first generation. Also, rewrite CodeNamerGo method to be more readable and have fewer allocations. * Responding to PR comments. * Adding missing package imports to template. * Reversing change that made two fields static. * Update readme to reflect requirements of repo build (#1719) * Update ms_rest and ms_rest_azure version for tests * Update minimum required runtime version message * Fix bug in parameter grouping in some languages (#1775) - The bug was that parameter group "transform" has to happen after the groups are processed. In CSharpAzure and CSharpFluent, it was happening too early and so the language specific capitalization rules wern't being applied. * Fix ruby rspec test to deserialize post long-running operation * fix cross referencing models in relative swagger specs (#1805) * Fixed constant parameter (#1796) * Make Python tests less nervous about Exception string content (#1781) * [Go] Added x-ms-parametrized-host support (#1803) * wip * fix dat razor * [Go] Adding support fo x-ms-parametrized-host * Fixed bug 1763 and added unit tests (#1800) * Fixed bug 1763 and added unit tests * Fixed failing test * Fixed comments * Checking files for proper ctor text * Addressed comment * Fixing format bug preventing Go gen. (#1795) * [Linter] Adding rule to warn about boolean type properties (#1783) * Adding rule to warn about boolean type properties * Adding test case for rule * [ReadMe] Change commands to fixed width font (#1774) * Hotfix after Java runtime beta5 release * java tests * regen * merged
@veronicagg @vishrutshah @salameer Please review.