diff --git a/README.md b/README.md
index 6ddc263778..15bf5b9629 100644
--- a/README.md
+++ b/README.md
@@ -35,16 +35,16 @@ AutoRest can be run on macOS and *nix using [Mono](http://www.mono-project.com/d
Or [Docker](https://docs.docker.com/engine/installation):
# Download Swagger.json example
- curl -O https://raw.githubusercontent.com/Azure/autorest/master/Samples/petstore/petstore.json
+ `curl -O https://raw.githubusercontent.com/Azure/autorest/master/Samples/petstore/petstore.json`
# Download latest AutoRest Docker image
- docker pull azuresdk/autorest:latest
+ `docker pull azuresdk/autorest:latest`
# Run AutoRest using Docker, mounting the current folder (pwd) into /home inside the container
- docker run -it --rm -v $(pwd):/home azuresdk/autorest:latest autorest \
+ `docker run -it --rm -v $(pwd):/home azuresdk/autorest:latest autorest \
-CodeGenerator CSharp \
-Input /home/petstore.json \
- -OutputDirectory /home/CSharp_PetStore -Namespace PetStore
+ -OutputDirectory /home/CSharp_PetStore -Namespace PetStore`
## Building AutoRest
AutoRest is developed primarily in C# but generates code for multiple languages. See [this link](docs/developer/guide/building-code.md) to build and test AutoRest.
diff --git a/Samples/petstore/Go/client.go b/Samples/petstore/Go/client.go
index 5917c13144..0514c4a5bd 100644
--- a/Samples/petstore/Go/client.go
+++ b/Samples/petstore/Go/client.go
@@ -18,30 +18,30 @@ const (
// APIVersion is the version of the Petstore
APIVersion = "1.0.0"
- // DefaultBaseURI is the default URI used for the service Petstore
- DefaultBaseURI = "http://petstore.swagger.io/v2"
+ // DefaultBaseURI is the default URI used for the service Petstore
+ DefaultBaseURI = "http://petstore.swagger.io/v2"
)
// ManagementClient is the base client for Petstore.
type ManagementClient struct {
autorest.Client
- BaseURI string
+ BaseURI string
APIVersion string
}
// New creates an instance of the ManagementClient client.
func New()ManagementClient {
- return NewWithBaseURI(DefaultBaseURI, )
+ return NewWithBaseURI(DefaultBaseURI, )
}
-// NewWithBaseURI creates an instance of the ManagementClient client.
-func NewWithBaseURI(baseURI string, ) ManagementClient {
- return ManagementClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- APIVersion: APIVersion,
+ // NewWithBaseURI creates an instance of the ManagementClient client.
+ func NewWithBaseURI(baseURI string, ) ManagementClient {
+ return ManagementClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ }
}
-}
// AddPet adds a new pet to the store. You may receive an HTTP invalid input if
// your pet is invalid.
diff --git a/Samples/petstore/Go/version.go b/Samples/petstore/Go/version.go
index 47dce9eab9..0ba157aa65 100644
--- a/Samples/petstore/Go/version.go
+++ b/Samples/petstore/Go/version.go
@@ -2,25 +2,41 @@ package petstore
import (
+ "bytes"
"fmt"
+ "strings"
)
const (
major = "0"
minor = "0"
patch = "0"
- // Always begin a "tag" with a dash (as per http://semver.org)
- tag = "-beta"
- semVerFormat = "%s.%s.%s%s"
+ tag = ""
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
)
+// cached results of UserAgent and Version to prevent repeated operations.
+var (
+ userAgent string
+ version string
+)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "petstore", "1.0.0")
+ if userAgent == "" {
+ userAgent = fmt.Sprintf(userAgentFormat, Version(), "petstore", "1.0.0")
+ }
+ return userAgent
}
// Version returns the semantic version (see http://semver.org) of the client.
func Version() string {
- return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+ if version == "" {
+ versionBuilder := bytes.NewBufferString(fmt.Sprintf("%s.%s.%s", major, minor, patch))
+ if tag != "" {
+ versionBuilder.WriteRune('-')
+ versionBuilder.WriteString(strings.TrimPrefix(tag, "-"))
+ }
+ version = string(versionBuilder.Bytes())
+ }
+ return version
}
diff --git a/attic/gulpfile.js b/attic/gulpfile.js
index 6470d5df24..4520c99d65 100644
--- a/attic/gulpfile.js
+++ b/attic/gulpfile.js
@@ -140,6 +140,7 @@ var goMappings = {
'url':['../../dev/TestServer/swagger/url.json','urlgroup'],
'validation':['../../dev/TestServer/swagger/validation.json', 'validationgroup'],
'paging':['../../dev/TestServer/swagger/paging.json', 'paginggroup'],
+ 'more-custom-base-uri':['../../dev/TestServer/swagger/custom-baseUrl-more-options.json', 'morecustombaseurigroup'],
'azurereport':['../../dev/TestServer/swagger/azure-report.json', 'azurereport']
};
diff --git a/docs/developer/guide/building-code.md b/docs/developer/guide/building-code.md
index 2c621ff41a..eec0b66ff4 100644
--- a/docs/developer/guide/building-code.md
+++ b/docs/developer/guide/building-code.md
@@ -13,7 +13,7 @@ Expected time around 100 minutes to install.
- Windows 10 Anniversary - (has PackageManagement, developer mode and supports WSL.)
- JDK 8
- Android SDK
-- NodeJS
+- NodeJS (LTS Version: v6.9.4 or higher)
- Gulp
- Ruby 2.3
- Ruby Devkit
diff --git a/gulpfile.iced b/gulpfile.iced
index 1610c3f20a..97c70d5dcf 100644
--- a/gulpfile.iced
+++ b/gulpfile.iced
@@ -57,33 +57,39 @@ autorest = (args) ->
###############################################
task 'test', "runs all tests", ->
run 'test-cs',
+ 'test-go'
+ 'test-java'
'test-node'
- 'test-ruby'
'test-python'
- 'test-go'
+ 'test-ruby'
-###############################################
+###############################################
+task 'test-go', 'runs Go tests', -> # FAILS, but also on master branch...
+ exec "glide up", { cwd: './src/generator/AutoRest.Go.Tests/src/tests' }
+ exec "go fmt ./generated/...", { cwd: './src/generator/AutoRest.Go.Tests/src/tests' }
+ exec "go run ./runner.go", { cwd: './src/generator/AutoRest.Go.Tests/src/tests' }
+
+###############################################
+task 'test-java', 'runs Java tests', ->
+ exec "mvn test", { cwd: './src/generator/AutoRest.Java.Tests/' }
+ exec "mvn test", { cwd: './src/generator/AutoRest.Java.Azure.Tests/' }
+
+###############################################
task 'test-node', 'runs NodeJS tests', ->
- exec "npm test", { cwd: './src/generator/AutoRest.NodeJS.Tests/' }
+ #exec "npm test", { cwd: './src/generator/AutoRest.NodeJS.Tests/' }
exec "npm test", { cwd: './src/generator/AutoRest.NodeJS.Azure.Tests/' }
-###############################################
+###############################################
task 'test-python', 'runs Python tests', ->
exec "tox", { cwd: './src/generator/AutoRest.Python.Tests/' }
exec "tox", { cwd: './src/generator/AutoRest.Python.Azure.Tests/' }
-###############################################
+###############################################
task 'test-ruby', 'runs Ruby tests', ->
exec "ruby RspecTests/tests_runner.rb", { cwd: './src/generator/AutoRest.Ruby.Tests/' }
exec "ruby RspecTests/tests_runner.rb", { cwd: './src/generator/AutoRest.Ruby.Azure.Tests/' }
-###############################################
-task 'test-go', 'runs Go tests', ['regenerate-go'], -> # FAILS, but also on master branch...
- exec "glide up", { cwd: './src/generator/AutoRest.Go.Tests/src/tests' }
- exec "go fmt ./generated/...", { cwd: './src/generator/AutoRest.Go.Tests/src/tests' }
- exec "go run ./runner.go", { cwd: './src/generator/AutoRest.Go.Tests/src/tests' }
-
-###############################################
+###############################################
# LEGACY
# Instead: have bunch of configuration files sitting in a well-known spot, discover them, feed them to AutoRest, done.
diff --git a/pom.xml b/pom.xml
index 86e80d8123..4c8c088078 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,12 +70,12 @@
com.microsoft.rest
client-runtime
- 1.0.0-beta5-SNAPSHOT
+ 1.0.0-beta6-SNAPSHOT
com.microsoft.azure
azure-client-runtime
- 1.0.0-beta5-SNAPSHOT
+ 1.0.0-beta6-SNAPSHOT
commons-codec
diff --git a/src/core/AutoRest.Core/Properties/Resources.Designer.cs b/src/core/AutoRest.Core/Properties/Resources.Designer.cs
index 61f74bf3d4..fcb5827991 100644
--- a/src/core/AutoRest.Core/Properties/Resources.Designer.cs
+++ b/src/core/AutoRest.Core/Properties/Resources.Designer.cs
@@ -104,6 +104,15 @@ public static string BodyWithType {
}
}
+ ///
+ /// Looks up a localized string similar to Booleans are not descriptive and make them hard to use. Instead use string enums with allowed set of values defined: '{0}'..
+ ///
+ public static string BooleanPropertyNotRecommended {
+ get {
+ return ResourceManager.GetString("BooleanPropertyNotRecommended", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Errors found during Swagger document validation..
///
diff --git a/src/core/AutoRest.Core/Properties/Resources.resx b/src/core/AutoRest.Core/Properties/Resources.resx
index a8b608747e..b54dca221c 100644
--- a/src/core/AutoRest.Core/Properties/Resources.resx
+++ b/src/core/AutoRest.Core/Properties/Resources.resx
@@ -323,4 +323,7 @@
When property is modeled as "readOnly": true then x-ms-mutability extension can only have "read" value. When property is modeled as "readOnly": false then applying x-ms-mutability extension with only "read" value is not allowed. Extension contains invalid values: '{0}'.
+
+ Booleans are not descriptive and make them hard to use. Instead use string enums with allowed set of values defined: '{0}'.
+
\ No newline at end of file
diff --git a/src/core/AutoRest/Simplify/CSharpSimplifier.cs b/src/core/AutoRest/Simplify/CSharpSimplifier.cs
index cb78770b0e..699e3db9b4 100644
--- a/src/core/AutoRest/Simplify/CSharpSimplifier.cs
+++ b/src/core/AutoRest/Simplify/CSharpSimplifier.cs
@@ -16,7 +16,6 @@
using Newtonsoft.Json;
using AutoRest.Core.Utilities;
using System.Net;
-using System.Reflection;
namespace AutoRest.Simplify
{
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ApiManagement/2016-07-07/Microsoft.ApiManagement.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ApiManagement/2016-07-07/Microsoft.ApiManagement.json
index b0c77a3ac6..aa01936876 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ApiManagement/2016-07-07/Microsoft.ApiManagement.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ApiManagement/2016-07-07/Microsoft.ApiManagement.json
@@ -7,6 +7,18 @@
"service": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "The name of the Api Management service."
+ },
"type": {
"type": "string",
"enum": [
@@ -98,6 +110,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -109,6 +122,18 @@
"service_apis": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "API identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -144,6 +169,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"ApiContract"
@@ -153,6 +179,9 @@
"service_apis_operations": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -178,6 +207,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"OperationContract"
@@ -187,6 +217,9 @@
"service_authorizationServers": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -212,6 +245,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"OAuth2AuthorizationServerContract"
@@ -221,6 +255,9 @@
"service_certificates": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -243,6 +280,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -251,6 +289,18 @@
"service_groups": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Group identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -263,12 +313,6 @@
"2016-07-07"
]
},
- "name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 300,
- "description": "Group name."
- },
"description": {
"type": "string",
"description": "Group description."
@@ -289,15 +333,27 @@
}
},
"required": [
+ "name",
"type",
- "apiVersion",
- "name"
+ "apiVersion"
],
"description": "Microsoft.ApiManagement/service/groups"
},
"service_groups_users": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "User identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -312,6 +368,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -320,6 +377,9 @@
"service_loggers": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -363,6 +423,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"credentials"
@@ -372,6 +433,9 @@
"service_openidConnectProviders": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -384,11 +448,6 @@
"2016-07-07"
]
},
- "name": {
- "type": "string",
- "maxLength": 50,
- "description": "User-friendly OpenID Connect Provider name."
- },
"description": {
"type": "string",
"description": "User-friendly description of OpenID Connect Provider."
@@ -407,9 +466,9 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
- "name",
"metadataEndpoint",
"clientId"
],
@@ -418,6 +477,18 @@
"service_products": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Product identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -455,6 +526,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"ProductContract"
@@ -464,6 +536,18 @@
"service_products_apis": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "API identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -478,6 +562,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -486,6 +571,18 @@
"service_products_groups": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Group identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -500,6 +597,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -508,6 +606,9 @@
"service_properties": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -520,12 +621,6 @@
"2016-07-07"
]
},
- "name": {
- "type": "string",
- "minLength": 1,
- "maxLength": 256,
- "description": "Unique name of Property."
- },
"value": {
"type": "string",
"minLength": 1,
@@ -559,9 +654,9 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
- "name",
"value"
],
"description": "Microsoft.ApiManagement/service/properties"
@@ -569,6 +664,9 @@
"service_subscriptions": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -589,10 +687,6 @@
"type": "string",
"description": "Product (product id path) for which subscription is being created in form /products/{productid}"
},
- "name": {
- "type": "string",
- "description": "Subscription name."
- },
"primaryKey": {
"type": "string",
"minLength": 1,
@@ -626,17 +720,29 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"userId",
- "productId",
- "name"
+ "productId"
],
"description": "Microsoft.ApiManagement/service/subscriptions"
},
"service_users": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "User identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -690,6 +796,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"email",
@@ -1559,6 +1666,18 @@
"service_apis_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "API identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -1594,6 +1713,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"ApiContract"
@@ -1603,6 +1723,9 @@
"service_apis_operations_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1628,6 +1751,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"OperationContract"
@@ -1637,6 +1761,9 @@
"service_authorizationServers_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1662,6 +1789,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"OAuth2AuthorizationServerContract"
@@ -1671,6 +1799,9 @@
"service_certificates_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1693,6 +1824,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -1701,6 +1833,18 @@
"service_groups_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Group identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -1713,10 +1857,6 @@
"2016-07-07"
]
},
- "name": {
- "type": "string",
- "description": "Group name."
- },
"description": {
"type": "string",
"description": "Group description."
@@ -1737,15 +1877,27 @@
}
},
"required": [
+ "name",
"type",
- "apiVersion",
- "name"
+ "apiVersion"
],
"description": "Microsoft.ApiManagement/service/groups"
},
"service_groups_users_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "User identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -1760,6 +1912,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -1768,6 +1921,9 @@
"service_loggers_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1811,6 +1967,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"credentials"
@@ -1820,6 +1977,9 @@
"service_openidConnectProviders_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1832,10 +1992,6 @@
"2016-07-07"
]
},
- "name": {
- "type": "string",
- "description": "User-friendly OpenID Connect Provider name."
- },
"description": {
"type": "string",
"description": "User-friendly description of OpenID Connect Provider."
@@ -1854,9 +2010,9 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
- "name",
"metadataEndpoint",
"clientId"
],
@@ -1865,6 +2021,18 @@
"service_products_apis_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "API identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -1879,6 +2047,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -1887,6 +2056,18 @@
"service_products_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Product identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -1924,6 +2105,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"ProductContract"
@@ -1933,6 +2115,18 @@
"service_products_groups_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Group identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -1947,6 +2141,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -1955,6 +2150,9 @@
"service_properties_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1967,10 +2165,6 @@
"2016-07-07"
]
},
- "name": {
- "type": "string",
- "description": "Unique name of Property."
- },
"value": {
"type": "string",
"description": "The Value of the Property."
@@ -2002,9 +2196,9 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
- "name",
"value"
],
"description": "Microsoft.ApiManagement/service/properties"
@@ -2012,6 +2206,9 @@
"service_subscriptions_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -2032,10 +2229,6 @@
"type": "string",
"description": "Product (product id path) for which subscription is being created in form /products/{productid}"
},
- "name": {
- "type": "string",
- "description": "Subscription name."
- },
"primaryKey": {
"type": "string",
"description": "Primary subscription key. If not specified during request key will be generated automatically."
@@ -2065,17 +2258,29 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"userId",
- "productId",
- "name"
+ "productId"
],
"description": "Microsoft.ApiManagement/service/subscriptions"
},
"service_users_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[^*#&+:<>?]+$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "User identifier. Must be unique in the current API Management service instance."
+ },
"type": {
"type": "string",
"enum": [
@@ -2125,6 +2330,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"email",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ApiManagement/2016-07-07b/Microsoft.ApiManagement.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ApiManagement/2016-07-07b/Microsoft.ApiManagement.json
index 3ad405bc9e..8656790fce 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ApiManagement/2016-07-07b/Microsoft.ApiManagement.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ApiManagement/2016-07-07b/Microsoft.ApiManagement.json
@@ -7,6 +7,18 @@
"service": {
"type": "object",
"properties": {
+ "name": {
+ "oneOf": [
+ {
+ "type": "string",
+ "pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "The name of the Api Management service."
+ },
"type": {
"type": "string",
"enum": [
@@ -61,6 +73,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Batch/2015-12-01/Microsoft.Batch.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Batch/2015-12-01/Microsoft.Batch.json
index 919093e851..9e7c76e130 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Batch/2015-12-01/Microsoft.Batch.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Batch/2015-12-01/Microsoft.Batch.json
@@ -7,6 +7,9 @@
"batchAccounts": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -60,6 +63,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -69,6 +73,9 @@
"batchAccounts_applications": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -108,6 +115,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -116,6 +124,9 @@
"batchAccounts_applications_versions": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -130,6 +141,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -170,6 +182,9 @@
"batchAccounts_applications_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -209,6 +224,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -217,6 +233,9 @@
"batchAccounts_applications_versions_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -231,6 +250,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CDN/2015-06-01/Microsoft.Cdn.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CDN/2015-06-01/Microsoft.Cdn.json
index 8f5ba0b846..c820d7d05c 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CDN/2015-06-01/Microsoft.Cdn.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CDN/2015-06-01/Microsoft.Cdn.json
@@ -7,6 +7,9 @@
"profiles": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -59,6 +62,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -69,6 +73,9 @@
"profiles_endpoints": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -124,6 +131,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -134,6 +142,9 @@
"profiles_endpoints_customDomains": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -158,6 +169,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -167,6 +179,9 @@
"profiles_endpoints_origins": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -191,6 +206,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -419,6 +435,9 @@
"profiles_endpoints_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -474,6 +493,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -484,6 +504,9 @@
"profiles_endpoints_customDomains_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -508,6 +531,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -517,6 +541,9 @@
"profiles_endpoints_origins_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -541,6 +568,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CDN/2016-04-02/Microsoft.Cdn.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CDN/2016-04-02/Microsoft.Cdn.json
index 5c9d5c86e3..36db2f53a4 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CDN/2016-04-02/Microsoft.Cdn.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CDN/2016-04-02/Microsoft.Cdn.json
@@ -7,6 +7,9 @@
"profiles": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -60,6 +63,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -70,6 +74,9 @@
"profiles_endpoints": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -125,6 +132,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -135,6 +143,9 @@
"profiles_endpoints_customDomains": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -159,6 +170,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -168,6 +180,9 @@
"profiles_endpoints_origins": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -192,6 +207,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -401,6 +417,9 @@
"profiles_endpoints_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -456,6 +475,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -466,6 +486,9 @@
"profiles_endpoints_customDomains_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -490,6 +513,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -499,6 +523,9 @@
"profiles_endpoints_origins_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -523,6 +550,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CognitiveServices/2016-02-01-preview/Microsoft.CognitiveServices.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CognitiveServices/2016-02-01-preview/Microsoft.CognitiveServices.json
index 36ebc62b3b..8219dc3fa2 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CognitiveServices/2016-02-01-preview/Microsoft.CognitiveServices.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/CognitiveServices/2016-02-01-preview/Microsoft.CognitiveServices.json
@@ -7,6 +7,9 @@
"accounts": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -69,18 +72,11 @@
"description": "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters."
},
"properties": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Must exist in the request. Must not be null."
}
},
"required": [
+ "name",
"type",
"apiVersion",
"sku",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Compute/2015-06-15/Microsoft.Compute.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Compute/2015-06-15/Microsoft.Compute.json
index e39b90a1dd..1ee3427eb0 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Compute/2015-06-15/Microsoft.Compute.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Compute/2015-06-15/Microsoft.Compute.json
@@ -7,6 +7,9 @@
"availabilitySets": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -49,6 +52,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -59,6 +63,9 @@
"virtualMachines": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -122,6 +129,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -132,6 +140,9 @@
"virtualMachines_extensions": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -174,6 +185,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -184,6 +196,9 @@
"virtualMachineScaleSets": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -237,6 +252,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1263,25 +1279,9 @@
"description": "Gets or sets whether the extension handler should be automatically upgraded across minor versions."
},
"settings": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Gets or sets Json formatted public settings for the extension."
},
"protectedSettings": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Gets or sets Json formatted protected settings for the extension."
},
"provisioningState": {
@@ -1385,6 +1385,9 @@
"virtualMachines_extensions_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1427,6 +1430,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1505,25 +1509,9 @@
"description": "Gets or sets whether the extension handler should be automatically upgraded across minor versions."
},
"settings": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Gets or sets Json formatted public settings for the extension."
},
"protectedSettings": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Gets or sets Json formatted protected settings for the extension."
}
},
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Compute/2016-03-30/Microsoft.Compute.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Compute/2016-03-30/Microsoft.Compute.json
index 9961a4efd5..f48c882e04 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Compute/2016-03-30/Microsoft.Compute.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Compute/2016-03-30/Microsoft.Compute.json
@@ -7,6 +7,9 @@
"availabilitySets": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -49,6 +52,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -59,6 +63,9 @@
"virtualMachines": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -122,6 +129,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -132,6 +140,9 @@
"virtualMachines_extensions": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -174,6 +185,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -184,6 +196,9 @@
"virtualMachineScaleSets": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -237,6 +252,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1261,25 +1277,9 @@
"description": "whether the extension handler should be automatically upgraded across minor versions."
},
"settings": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Json formatted public settings for the extension."
},
"protectedSettings": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Json formatted protected settings for the extension."
},
"instanceView": {
@@ -1375,6 +1375,9 @@
"virtualMachines_extensions_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1417,6 +1420,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1495,25 +1499,9 @@
"description": "whether the extension handler should be automatically upgraded across minor versions."
},
"settings": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Json formatted public settings for the extension."
},
"protectedSettings": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Json formatted protected settings for the extension."
}
},
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ContainerService/2016-03-30/Microsoft.ContainerService.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ContainerService/2016-03-30/Microsoft.ContainerService.json
index 04a814cdfb..5bf0475152 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ContainerService/2016-03-30/Microsoft.ContainerService.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ContainerService/2016-03-30/Microsoft.ContainerService.json
@@ -7,6 +7,9 @@
"containerServices": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -49,6 +52,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DNS/2015-05-04-preview/Microsoft.Network.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DNS/2015-05-04-preview/Microsoft.Network.json
index c06f5906a6..445cd2b1cf 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DNS/2015-05-04-preview/Microsoft.Network.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DNS/2015-05-04-preview/Microsoft.Network.json
@@ -7,6 +7,9 @@
"dnszones": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -88,6 +91,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -98,6 +102,9 @@
"dnszones_A": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -145,6 +152,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -155,6 +163,9 @@
"dnszones_AAAA": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -202,6 +213,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -212,6 +224,9 @@
"dnszones_CNAME": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -259,6 +274,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -269,6 +285,9 @@
"dnszones_MX": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -316,6 +335,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -326,6 +346,9 @@
"dnszones_NS": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -373,6 +396,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -383,6 +407,9 @@
"dnszones_PTR": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -430,6 +457,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -440,6 +468,9 @@
"dnszones_SOA": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -487,6 +518,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -497,6 +529,9 @@
"dnszones_SRV": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -544,6 +579,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -554,6 +590,9 @@
"dnszones_TXT": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -601,6 +640,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -643,6 +683,9 @@
"dnszones_A_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -690,6 +733,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -700,6 +744,9 @@
"dnszones_AAAA_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -747,6 +794,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -757,6 +805,9 @@
"dnszones_CNAME_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -804,6 +855,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -814,6 +866,9 @@
"dnszones_MX_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -861,6 +916,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -871,6 +927,9 @@
"dnszones_NS_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -918,6 +977,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -928,6 +988,9 @@
"dnszones_PTR_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -975,6 +1038,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -985,6 +1049,9 @@
"dnszones_SOA_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1032,6 +1099,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1042,6 +1110,9 @@
"dnszones_SRV_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1089,6 +1160,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1099,6 +1171,9 @@
"dnszones_TXT_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1146,6 +1221,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DNS/2016-04-01/Microsoft.Network.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DNS/2016-04-01/Microsoft.Network.json
index d4147174b7..3ee92f83ca 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DNS/2016-04-01/Microsoft.Network.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DNS/2016-04-01/Microsoft.Network.json
@@ -7,6 +7,9 @@
"dnszones": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -88,6 +91,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -98,6 +102,9 @@
"dnszones_A": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -114,10 +121,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -139,6 +142,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -148,6 +152,9 @@
"dnszones_AAAA": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -164,10 +171,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -189,6 +192,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -198,6 +202,9 @@
"dnszones_CNAME": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -214,10 +221,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -239,6 +242,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -248,6 +252,9 @@
"dnszones_MX": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -264,10 +271,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -289,6 +292,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -298,6 +302,9 @@
"dnszones_NS": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -314,10 +321,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -339,6 +342,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -348,6 +352,9 @@
"dnszones_PTR": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -364,10 +371,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -389,6 +392,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -398,6 +402,9 @@
"dnszones_SOA": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -414,10 +421,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -439,6 +442,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -448,6 +452,9 @@
"dnszones_SRV": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -464,10 +471,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -489,6 +492,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -498,6 +502,9 @@
"dnszones_TXT": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -514,10 +521,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -539,6 +542,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -580,6 +584,9 @@
"dnszones_A_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -596,10 +603,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -621,6 +624,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -630,6 +634,9 @@
"dnszones_AAAA_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -646,10 +653,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -671,6 +674,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -680,6 +684,9 @@
"dnszones_CNAME_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -696,10 +703,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -721,6 +724,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -730,6 +734,9 @@
"dnszones_MX_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -746,10 +753,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -771,6 +774,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -780,6 +784,9 @@
"dnszones_NS_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -796,10 +803,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -821,6 +824,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -830,6 +834,9 @@
"dnszones_PTR_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -846,10 +853,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -871,6 +874,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -880,6 +884,9 @@
"dnszones_SOA_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -896,10 +903,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -921,6 +924,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -930,6 +934,9 @@
"dnszones_SRV_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -946,10 +953,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -971,6 +974,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -980,6 +984,9 @@
"dnszones_TXT_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -996,10 +1003,6 @@
"type": "string",
"description": "Gets or sets the ID of the resource."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource."
- },
"etag": {
"type": "string",
"description": "Gets or sets the ETag of the RecordSet."
@@ -1021,6 +1024,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DataLakeAnalytics/2015-10-01-preview/Microsoft.DataLakeAnalytics.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DataLakeAnalytics/2015-10-01-preview/Microsoft.DataLakeAnalytics.json
index c6fc02151e..77226cb638 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DataLakeAnalytics/2015-10-01-preview/Microsoft.DataLakeAnalytics.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DataLakeAnalytics/2015-10-01-preview/Microsoft.DataLakeAnalytics.json
@@ -7,6 +7,9 @@
"accounts": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -23,10 +26,6 @@
"type": "string",
"description": "Gets or sets the account regional location."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the account name."
- },
"tags": {
"oneOf": [
{
@@ -67,6 +66,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -76,6 +76,9 @@
"accounts_DataLakeStoreAccounts": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -101,6 +104,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -110,6 +114,9 @@
"accounts_StorageAccounts": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -135,6 +142,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -146,6 +154,9 @@
"accounts_DataLakeStoreAccounts_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -171,6 +182,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -180,6 +192,9 @@
"accounts_StorageAccounts_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -205,6 +220,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DataLakeStore/2015-10-01-preview/Microsoft.DataLakeStore.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DataLakeStore/2015-10-01-preview/Microsoft.DataLakeStore.json
index 41f0734ae9..886ef1fb66 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DataLakeStore/2015-10-01-preview/Microsoft.DataLakeStore.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/DataLakeStore/2015-10-01-preview/Microsoft.DataLakeStore.json
@@ -7,6 +7,9 @@
"accounts": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -23,10 +26,6 @@
"type": "string",
"description": "Gets or sets the account regional location."
},
- "name": {
- "type": "string",
- "description": "Gets or sets the account name."
- },
"tags": {
"oneOf": [
{
@@ -64,6 +63,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -73,6 +73,9 @@
"accounts_firewallRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -85,10 +88,6 @@
"2015-10-01-preview"
]
},
- "name": {
- "type": "string",
- "description": "Gets or sets the firewall rule's name."
- },
"id": {
"type": "string",
"description": "Gets or sets the firewall rule's subscription ID."
@@ -110,6 +109,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -121,6 +121,9 @@
"accounts_firewallRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -133,10 +136,6 @@
"2015-10-01-preview"
]
},
- "name": {
- "type": "string",
- "description": "Gets or sets the firewall rule's name."
- },
"id": {
"type": "string",
"description": "Gets or sets the firewall rule's subscription ID."
@@ -158,6 +157,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Logic/2015-02-01-preview/Microsoft.Logic.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Logic/2015-02-01-preview/Microsoft.Logic.json
index 968687ef29..edd3ac0cfb 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Logic/2015-02-01-preview/Microsoft.Logic.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Logic/2015-02-01-preview/Microsoft.Logic.json
@@ -7,6 +7,9 @@
"workflows": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -23,10 +26,6 @@
"type": "string",
"description": "Gets or sets the resource id."
},
- "name": {
- "type": "string",
- "description": "Gets the resource name."
- },
"location": {
"type": "string",
"description": "Gets or sets the resource location."
@@ -68,6 +67,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -77,6 +77,9 @@
"workflows_accessKeys": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -106,6 +109,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -161,14 +165,6 @@
"description": "Gets or sets the content hash."
},
"metadata": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Gets or sets the metadata."
}
}
@@ -251,25 +247,9 @@
"description": "Gets or sets the type."
},
"value": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Gets or sets the value."
},
"metadata": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Gets or sets the metadata."
}
}
@@ -318,14 +298,6 @@
"description": "Gets or sets the link to definition."
},
"definition": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Gets or sets the definition."
},
"parametersLink": {
@@ -358,6 +330,9 @@
"workflows_accessKeys_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -387,6 +362,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Logic/2016-06-01/Microsoft.Logic.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Logic/2016-06-01/Microsoft.Logic.json
index ed7fe99113..11e738b633 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Logic/2016-06-01/Microsoft.Logic.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Logic/2016-06-01/Microsoft.Logic.json
@@ -7,6 +7,9 @@
"workflows": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -23,10 +26,6 @@
"type": "string",
"description": "The resource id."
},
- "name": {
- "type": "string",
- "description": "Gets the resource name."
- },
"location": {
"type": "string",
"description": "The resource location."
@@ -58,6 +57,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -129,25 +129,9 @@
"description": "The type."
},
"value": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "The value."
},
"metadata": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "The metadata."
},
"description": {
@@ -201,14 +185,6 @@
"description": "The integration account."
},
"definition": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "The definition."
},
"parameters": {
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/MachineLearning/2016-05-01-preview/Microsoft.MachineLearning.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/MachineLearning/2016-05-01-preview/Microsoft.MachineLearning.json
index 8acd9f16de..7d61f27adb 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/MachineLearning/2016-05-01-preview/Microsoft.MachineLearning.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/MachineLearning/2016-05-01-preview/Microsoft.MachineLearning.json
@@ -7,6 +7,9 @@
"webServices": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -19,10 +22,6 @@
"2016-05-01-preview"
]
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"location": {
"type": "string",
"description": "Resource Location"
@@ -54,6 +53,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -219,9 +219,7 @@
"oneOf": [
{
"type": "array",
- "items": {
- "type": "object"
- }
+ "items": {}
},
{
"$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
@@ -311,9 +309,7 @@
"type": "array",
"items": {
"type": "array",
- "items": {
- "type": "object"
- }
+ "items": {}
}
}
},
@@ -327,9 +323,7 @@
"oneOf": [
{
"type": "object",
- "additionalProperties": {
- "type": "object"
- }
+ "additionalProperties": {}
},
{
"$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
@@ -727,164 +721,194 @@
},
"WebServiceProperties": {
"type": "object",
- "properties": {
- "title": {
- "type": "string",
- "description": "The title of the Azure ML web service."
- },
- "description": {
- "type": "string",
- "description": "The description of the Azure ML web service."
- },
- "keys": {
- "oneOf": [
- {
- "$ref": "#/definitions/WebServiceKeys"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "The set of access keys for the web service. If not specified at creation time (PUT), they will be generated automatically by the resource provider."
- },
- "readOnly": {
- "oneOf": [
- {
- "type": "boolean"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "If true, the web service can no longer be updated / patched, only removed. Otherwise, the service resource supports changes."
- },
- "exposeSampleData": {
- "oneOf": [
- {
- "type": "boolean"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "Flag that controls whether to expose sample data or not in the web service's swagger definition."
- },
- "realtimeConfiguration": {
- "oneOf": [
- {
- "$ref": "#/definitions/RealtimeConfiguration"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "Configuration for the service's realtime endpoint."
- },
- "diagnostics": {
- "oneOf": [
- {
- "$ref": "#/definitions/DiagnosticsConfiguration"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "Settings controlling the diagnostics traces collection for the web service."
- },
- "storageAccount": {
- "oneOf": [
- {
- "$ref": "#/definitions/StorageAccount"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "The storage account associated with the service. This is used to store both datasets and diagnostic traces. This information is required at creation time (PUT) and only the key is updateable after that. The account credentials are hidden on a GET web service call."
- },
- "machineLearningWorkspace": {
- "oneOf": [
- {
- "$ref": "#/definitions/MachineLearningWorkspace"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "This is only populated at creation time (PUT) for web services originating from an AzureML Studio experiment."
- },
- "commitmentPlan": {
- "oneOf": [
- {
- "$ref": "#/definitions/CommitmentPlan"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "The commitment plan associated with this web service. This is required to be specified at creation time (PUT) and is not updateable afterwards."
- },
- "input": {
- "oneOf": [
- {
- "$ref": "#/definitions/ServiceInputOutputSpecification"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "Swagger schema for the service's input(s), as applicable."
- },
- "output": {
- "oneOf": [
- {
- "$ref": "#/definitions/ServiceInputOutputSpecification"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "Swagger schema for the service's output(s), as applicable."
- },
- "exampleRequest": {
- "oneOf": [
- {
- "$ref": "#/definitions/ExampleRequest"
+ "allOf": [
+ {
+ "properties": {
+ "packageType": {
+ "oneOf": [
+ {
+ "type": "string",
+ "enum": [
+ "Graph"
+ ]
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ]
},
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
- "description": "Sample request data for each of the service's inputs, as applicable."
- },
- "assets": {
- "oneOf": [
- {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/AssetItem"
- }
+ "title": {
+ "type": "string",
+ "description": "The title of the Azure ML web service."
},
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ "description": {
+ "type": "string",
+ "description": "The description of the Azure ML web service."
+ },
+ "keys": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/WebServiceKeys"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "The set of access keys for the web service. If not specified at creation time (PUT), they will be generated automatically by the resource provider."
+ },
+ "readOnly": {
+ "oneOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "If true, the web service can no longer be updated / patched, only removed. Otherwise, the service resource supports changes."
+ },
+ "exposeSampleData": {
+ "oneOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Flag that controls whether to expose sample data or not in the web service's swagger definition."
+ },
+ "realtimeConfiguration": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/RealtimeConfiguration"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Configuration for the service's realtime endpoint."
+ },
+ "diagnostics": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/DiagnosticsConfiguration"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Settings controlling the diagnostics traces collection for the web service."
+ },
+ "storageAccount": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/StorageAccount"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "The storage account associated with the service. This is used to store both datasets and diagnostic traces. This information is required at creation time (PUT) and only the key is updateable after that. The account credentials are hidden on a GET web service call."
+ },
+ "machineLearningWorkspace": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/MachineLearningWorkspace"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "This is only populated at creation time (PUT) for web services originating from an AzureML Studio experiment."
+ },
+ "commitmentPlan": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/CommitmentPlan"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "The commitment plan associated with this web service. This is required to be specified at creation time (PUT) and is not updateable afterwards."
+ },
+ "input": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/ServiceInputOutputSpecification"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Swagger schema for the service's input(s), as applicable."
+ },
+ "output": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/ServiceInputOutputSpecification"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Swagger schema for the service's output(s), as applicable."
+ },
+ "exampleRequest": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/ExampleRequest"
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Sample request data for each of the service's inputs, as applicable."
+ },
+ "assets": {
+ "oneOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/AssetItem"
+ }
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "Set of assets associated with the web service."
+ },
+ "parameters": {
+ "oneOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ }
+ ],
+ "description": "The set of global parameters values defined for the web service, given as a global parameter name to default value map. If no default value is specified, the parameter is considered to be required."
}
- ],
- "description": "Set of assets associated with the web service."
+ }
},
- "parameters": {
- "oneOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
+ {
+ "anyOf": [
{
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
+ "$ref": "#/definitions/WebServicePropertiesForGraph"
}
- ],
- "description": "The set of global parameters values defined for the web service, given as a global parameter name to default value map. If no default value is specified, the parameter is considered to be required."
- },
+ ]
+ }
+ ],
+ "description": "The set of properties specific to the Azure ML web service resource."
+ },
+ "WebServicePropertiesForGraph": {
+ "type": "object",
+ "properties": {
"package": {
"oneOf": [
{
@@ -895,22 +919,9 @@
}
],
"description": "The definition of the graph package making up this web service."
- },
- "packageType": {
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "Graph"
- ]
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ]
}
},
- "description": "The set of properties specific to the Azure ML web service resource."
+ "description": "Properties specific to a Graph based web service."
}
}
}
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2015-05-01-preview/Microsoft.Network.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2015-05-01-preview/Microsoft.Network.json
index 44f1d48cad..68b3daa4c3 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2015-05-01-preview/Microsoft.Network.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2015-05-01-preview/Microsoft.Network.json
@@ -7,6 +7,9 @@
"applicationGateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -53,6 +56,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -63,6 +67,9 @@
"connections": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -109,6 +116,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -119,6 +127,9 @@
"expressRouteCircuits_authorizations": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -145,16 +156,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -164,6 +172,9 @@
"expressRouteCircuits_peerings": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -190,16 +201,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -209,6 +217,9 @@
"loadBalancers": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -255,6 +266,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -265,6 +277,9 @@
"localNetworkGateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -311,6 +326,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -321,6 +337,9 @@
"networkInterfaces": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -367,6 +386,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -377,6 +397,9 @@
"networkSecurityGroups": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -433,6 +456,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -443,6 +467,9 @@
"networkSecurityGroups_securityRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -469,16 +496,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -488,6 +512,9 @@
"routeTables": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -544,6 +571,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -554,6 +582,9 @@
"routeTables_routes": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -580,16 +611,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -599,6 +627,9 @@
"virtualnetworkgateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -645,6 +676,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -655,6 +687,9 @@
"virtualnetworks": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -711,6 +746,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -721,6 +757,9 @@
"virtualnetworks_subnets": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -747,16 +786,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -2851,6 +2887,9 @@
"networkSecurityGroups_securityRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -2877,16 +2916,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -3186,6 +3222,9 @@
"routeTables_routes_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3212,16 +3251,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -3816,6 +3852,9 @@
"virtualnetworks_subnets_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3842,16 +3881,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2015-06-15/Microsoft.Network.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2015-06-15/Microsoft.Network.json
index 7d75d533c4..de29eff6ad 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2015-06-15/Microsoft.Network.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2015-06-15/Microsoft.Network.json
@@ -7,6 +7,9 @@
"applicationGateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -57,6 +60,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -66,6 +70,9 @@
"connections": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -116,6 +123,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -125,6 +133,9 @@
"expressRouteCircuits_authorizations": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -151,16 +162,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -170,6 +178,9 @@
"expressRouteCircuits_peerings": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -196,16 +207,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -215,6 +223,9 @@
"loadBalancers": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -265,6 +276,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -274,6 +286,9 @@
"localNetworkGateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -324,6 +339,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -333,6 +349,9 @@
"networkInterfaces": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -383,6 +402,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -392,6 +412,9 @@
"networkSecurityGroups": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -452,6 +475,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -461,6 +485,9 @@
"networkSecurityGroups_securityRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -487,16 +514,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -506,6 +530,9 @@
"publicIPAddresses": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -556,6 +583,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -565,6 +593,9 @@
"routeTables": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -625,6 +656,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -634,6 +666,9 @@
"routeTables_routes": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -660,16 +695,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -679,6 +711,9 @@
"virtualnetworkgateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -729,6 +764,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -738,6 +774,9 @@
"virtualnetworks": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -798,6 +837,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -807,6 +847,9 @@
"virtualnetworks_subnets": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -833,16 +876,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -3451,6 +3491,9 @@
"networkSecurityGroups_securityRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3477,16 +3520,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -3951,6 +3991,9 @@
"routeTables_routes_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3977,16 +4020,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -4676,6 +4716,9 @@
"virtualnetworks_subnets_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -4702,16 +4745,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2016-03-30/Microsoft.Network.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2016-03-30/Microsoft.Network.json
index 1998db8083..6742a2a723 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2016-03-30/Microsoft.Network.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2016-03-30/Microsoft.Network.json
@@ -7,6 +7,9 @@
"applicationGateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -57,6 +60,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -66,6 +70,9 @@
"connections": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -116,6 +123,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -125,6 +133,9 @@
"expressRouteCircuits": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -199,6 +210,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -208,6 +220,9 @@
"expressRouteCircuits_authorizations": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -234,16 +249,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -253,6 +265,9 @@
"expressRouteCircuits_peerings": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -279,16 +294,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -298,6 +310,9 @@
"loadBalancers": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -348,6 +363,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -357,6 +373,9 @@
"localNetworkGateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -407,6 +426,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -416,6 +436,9 @@
"networkInterfaces": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -466,6 +489,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -475,6 +499,9 @@
"networkSecurityGroups": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -535,6 +562,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -544,6 +572,9 @@
"networkSecurityGroups_securityRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -570,16 +601,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -589,6 +617,9 @@
"publicIPAddresses": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -639,6 +670,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -648,6 +680,9 @@
"routeTables": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -708,6 +743,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -717,6 +753,9 @@
"routeTables_routes": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -743,16 +782,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -762,6 +798,9 @@
"virtualnetworkgateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -812,6 +851,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -821,6 +861,9 @@
"virtualnetworks": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -881,6 +924,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -890,6 +934,9 @@
"virtualnetworks_subnets": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -916,16 +963,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -2485,6 +2529,9 @@
"expressRouteCircuits_authorizations_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -2511,16 +2558,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -2530,6 +2574,9 @@
"expressRouteCircuits_peerings_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -2556,16 +2603,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -3889,6 +3933,9 @@
"networkSecurityGroups_securityRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3915,16 +3962,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -4404,6 +4448,9 @@
"routeTables_routes_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -4430,16 +4477,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -5129,6 +5173,9 @@
"virtualnetworks_subnets_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -5155,16 +5202,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2016-09-01/Microsoft.Network.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2016-09-01/Microsoft.Network.json
index 9e159b6249..2bca7c858b 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2016-09-01/Microsoft.Network.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Network/2016-09-01/Microsoft.Network.json
@@ -7,6 +7,9 @@
"applicationGateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -57,6 +60,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -66,6 +70,9 @@
"connections": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -116,6 +123,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -125,6 +133,9 @@
"expressRouteCircuits": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -199,6 +210,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -208,6 +220,9 @@
"expressRouteCircuits_authorizations": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -234,16 +249,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -253,6 +265,9 @@
"expressRouteCircuits_peerings": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -279,16 +294,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -298,6 +310,9 @@
"loadBalancers": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -348,6 +363,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -357,6 +373,9 @@
"localNetworkGateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -407,6 +426,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -416,6 +436,9 @@
"networkInterfaces": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -466,6 +489,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -475,6 +499,9 @@
"networkSecurityGroups": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -535,6 +562,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -544,6 +572,9 @@
"networkSecurityGroups_securityRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -570,16 +601,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -589,6 +617,9 @@
"publicIPAddresses": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -639,6 +670,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -648,6 +680,9 @@
"routeTables": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -708,6 +743,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -717,6 +753,9 @@
"routeTables_routes": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -743,16 +782,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -762,6 +798,9 @@
"virtualNetworkGateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -812,6 +851,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -821,6 +861,9 @@
"virtualNetworks": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -884,6 +927,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -893,6 +937,9 @@
"virtualNetworks_subnets": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -919,16 +966,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -938,6 +982,9 @@
"virtualNetworks_virtualNetworkPeerings": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -964,16 +1011,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -2661,6 +2705,9 @@
"expressRouteCircuits_authorizations_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -2687,16 +2734,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -2706,6 +2750,9 @@
"expressRouteCircuits_peerings_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -2732,16 +2779,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -3871,6 +3915,9 @@
"networkSecurityGroups_securityRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3897,16 +3944,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -4386,6 +4430,9 @@
"routeTables_routes_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -4412,16 +4459,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -5242,6 +5286,9 @@
"virtualNetworks_subnets_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -5268,16 +5315,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -5287,6 +5331,9 @@
"virtualNetworks_virtualNetworkPeerings_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -5313,16 +5360,13 @@
}
]
},
- "name": {
- "type": "string",
- "description": "Gets or sets the name of the resource that is unique within a resource group. This name can be used to access the resource"
- },
"etag": {
"type": "string",
"description": "A unique read-only string that changes whenever the resource is updated"
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/NotificationHubs/2016-03-01/Microsoft.NotificationHubs.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/NotificationHubs/2016-03-01/Microsoft.NotificationHubs.json
index be93d27a1e..6742c9985e 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/NotificationHubs/2016-03-01/Microsoft.NotificationHubs.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/NotificationHubs/2016-03-01/Microsoft.NotificationHubs.json
@@ -7,6 +7,9 @@
"namespaces": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -74,6 +77,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -84,6 +88,9 @@
"namespaces_AuthorizationRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -138,6 +145,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -148,6 +156,9 @@
"namespaces_notificationHubs": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -212,6 +223,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -222,6 +234,9 @@
"namespaces_notificationHubs_AuthorizationRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -276,6 +291,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -539,6 +555,9 @@
"namespaces_AuthorizationRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -593,6 +612,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -603,6 +623,9 @@
"namespaces_notificationHubs_AuthorizationRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -657,6 +680,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -667,6 +691,9 @@
"namespaces_notificationHubs_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -731,6 +758,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/PowerBIEmbedded/2016-01-29/Microsoft.PowerBI.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/PowerBIEmbedded/2016-01-29/Microsoft.PowerBI.json
index b7b4c9e0c3..0952f82d2f 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/PowerBIEmbedded/2016-01-29/Microsoft.PowerBI.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/PowerBIEmbedded/2016-01-29/Microsoft.PowerBI.json
@@ -7,6 +7,9 @@
"workspaceCollections": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -48,6 +51,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/RecoveryServices/2016-06-01/Microsoft.RecoveryServices.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/RecoveryServices/2016-06-01/Microsoft.RecoveryServices.json
index 1d98a862a4..5c865a9b5f 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/RecoveryServices/2016-06-01/Microsoft.RecoveryServices.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/RecoveryServices/2016-06-01/Microsoft.RecoveryServices.json
@@ -7,6 +7,10 @@
"vaults": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the recovery services vault."
+ },
"type": {
"type": "string",
"enum": [
@@ -59,6 +63,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -92,7 +97,6 @@
"description": "Identifies the unique system identifier for each Azure resource."
},
"VaultProperties": {
- "type": "object",
"description": "Properties of the vault."
}
}
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Redis/2016-04-01/Microsoft.Cache.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Redis/2016-04-01/Microsoft.Cache.json
index f74a7f3f77..74a59b8713 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Redis/2016-04-01/Microsoft.Cache.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Redis/2016-04-01/Microsoft.Cache.json
@@ -7,6 +7,9 @@
"Redis": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -50,6 +53,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Resources/Locks/2016-09-01/Microsoft.Authorization.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Resources/Locks/2016-09-01/Microsoft.Authorization.json
index 1efb549abc..6542f564dd 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Resources/Locks/2016-09-01/Microsoft.Authorization.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Resources/Locks/2016-09-01/Microsoft.Authorization.json
@@ -7,6 +7,9 @@
"locks": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -29,13 +32,10 @@
}
],
"description": "The properties of the lock."
- },
- "name": {
- "type": "string",
- "description": "The name of the lock."
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Resources/Resources/2016-09-01/Microsoft.Resources.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Resources/Resources/2016-09-01/Microsoft.Resources.json
index 625d86f2b8..db29f51fbf 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Resources/Resources/2016-09-01/Microsoft.Resources.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Resources/Resources/2016-09-01/Microsoft.Resources.json
@@ -7,6 +7,9 @@
"deployments": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -32,6 +35,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -53,14 +57,6 @@
"type": "object",
"properties": {
"template": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "The template content. It can be a JObject or a well formed JSON string. Use only one of Template or TemplateLink."
},
"templateLink": {
@@ -75,14 +71,6 @@
"description": "The template URI. Use only one of Template or TemplateLink."
},
"parameters": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Deployment parameters. It can be a JObject or a well formed JSON string. Use only one of Parameters or ParametersLink."
},
"parametersLink": {
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Scheduler/2016-03-01/Microsoft.Scheduler.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Scheduler/2016-03-01/Microsoft.Scheduler.json
index 7b4a0ca54d..b9277dfd1b 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Scheduler/2016-03-01/Microsoft.Scheduler.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Scheduler/2016-03-01/Microsoft.Scheduler.json
@@ -7,6 +7,9 @@
"jobCollections": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -19,10 +22,6 @@
"2016-03-01"
]
},
- "name": {
- "type": "string",
- "description": "Gets or sets the job collection resource name."
- },
"location": {
"type": "string",
"description": "Gets or sets the storage account location."
@@ -64,6 +63,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -73,6 +73,9 @@
"jobCollections_jobs": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -98,6 +101,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -330,6 +334,9 @@
"jobCollections_jobs_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -355,6 +362,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Search/2015-02-28/Microsoft.Search.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Search/2015-02-28/Microsoft.Search.json
index d8d58857f0..a827357790 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Search/2015-02-28/Microsoft.Search.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Search/2015-02-28/Microsoft.Search.json
@@ -7,6 +7,9 @@
"searchServices": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -50,6 +53,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ServerManagement/2016-07-01-preview/Microsoft.ServerManagement.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ServerManagement/2016-07-01-preview/Microsoft.ServerManagement.json
index 6aa9fe6937..038a510bcf 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ServerManagement/2016-07-01-preview/Microsoft.ServerManagement.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ServerManagement/2016-07-01-preview/Microsoft.ServerManagement.json
@@ -7,6 +7,9 @@
"gateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -24,14 +27,6 @@
"description": "location of the resource"
},
"tags": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "resource tags"
},
"properties": {
@@ -47,6 +42,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -56,6 +52,9 @@
"nodes": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -73,14 +72,6 @@
"description": "location of the resource?"
},
"tags": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "resource tags"
},
"properties": {
@@ -106,6 +97,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -115,6 +107,9 @@
"nodes_sessions": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -140,6 +135,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -149,6 +145,9 @@
"nodes_sessions_features_pssessions": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -163,6 +162,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion"
],
@@ -217,6 +217,9 @@
"nodes_sessions_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -242,6 +245,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ServiceBus/2015-08-01/Microsoft.ServiceBus.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ServiceBus/2015-08-01/Microsoft.ServiceBus.json
index 36be307546..35c2b673dd 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ServiceBus/2015-08-01/Microsoft.ServiceBus.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/ServiceBus/2015-08-01/Microsoft.ServiceBus.json
@@ -7,6 +7,9 @@
"namespaces": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -75,6 +78,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -85,6 +89,9 @@
"namespaces_AuthorizationRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -101,10 +108,6 @@
"type": "string",
"description": "data center location."
},
- "name": {
- "type": "string",
- "description": "Name of the AuthorizationRule."
- },
"properties": {
"oneOf": [
{
@@ -117,6 +120,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -126,6 +130,9 @@
"namespaces_queues": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -138,10 +145,6 @@
"2015-08-01"
]
},
- "name": {
- "type": "string",
- "description": "Queue name."
- },
"location": {
"type": "string",
"description": "location of the resource."
@@ -168,6 +171,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -178,6 +182,9 @@
"namespaces_queues_authorizationRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -194,10 +201,6 @@
"type": "string",
"description": "data center location."
},
- "name": {
- "type": "string",
- "description": "Name of the AuthorizationRule."
- },
"properties": {
"oneOf": [
{
@@ -210,6 +213,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -219,6 +223,9 @@
"namespaces_topics": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -231,10 +238,6 @@
"2015-08-01"
]
},
- "name": {
- "type": "string",
- "description": "Topic name."
- },
"location": {
"type": "string",
"description": "Location of the resource."
@@ -264,6 +267,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -274,6 +278,9 @@
"namespaces_topics_authorizationRules": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -290,10 +297,6 @@
"type": "string",
"description": "data center location."
},
- "name": {
- "type": "string",
- "description": "Name of the AuthorizationRule."
- },
"properties": {
"oneOf": [
{
@@ -306,6 +309,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -315,6 +319,9 @@
"namespaces_topics_subscriptions": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -343,6 +350,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -488,6 +496,9 @@
"namespaces_AuthorizationRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -504,10 +515,6 @@
"type": "string",
"description": "data center location."
},
- "name": {
- "type": "string",
- "description": "Name of the AuthorizationRule."
- },
"properties": {
"oneOf": [
{
@@ -520,6 +527,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -529,6 +537,9 @@
"namespaces_queues_authorizationRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -545,10 +556,6 @@
"type": "string",
"description": "data center location."
},
- "name": {
- "type": "string",
- "description": "Name of the AuthorizationRule."
- },
"properties": {
"oneOf": [
{
@@ -561,6 +568,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -570,6 +578,9 @@
"namespaces_queues_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -582,10 +593,6 @@
"2015-08-01"
]
},
- "name": {
- "type": "string",
- "description": "Queue name."
- },
"location": {
"type": "string",
"description": "location of the resource."
@@ -612,6 +619,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -622,6 +630,9 @@
"namespaces_topics_authorizationRules_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -638,10 +649,6 @@
"type": "string",
"description": "data center location."
},
- "name": {
- "type": "string",
- "description": "Name of the AuthorizationRule."
- },
"properties": {
"oneOf": [
{
@@ -654,6 +661,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -663,6 +671,9 @@
"namespaces_topics_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -675,10 +686,6 @@
"2015-08-01"
]
},
- "name": {
- "type": "string",
- "description": "Topic name."
- },
"location": {
"type": "string",
"description": "Location of the resource."
@@ -708,6 +715,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -718,6 +726,9 @@
"namespaces_topics_subscriptions_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -746,6 +757,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2015-05-01-preview/Microsoft.Storage.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2015-05-01-preview/Microsoft.Storage.json
index 317190ea7a..ce30c81517 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2015-05-01-preview/Microsoft.Storage.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2015-05-01-preview/Microsoft.Storage.json
@@ -7,6 +7,9 @@
"storageAccounts": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -49,6 +52,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2015-06-15/Microsoft.Storage.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2015-06-15/Microsoft.Storage.json
index cac87b99d6..90663709a6 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2015-06-15/Microsoft.Storage.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2015-06-15/Microsoft.Storage.json
@@ -7,6 +7,9 @@
"storageAccounts": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -49,6 +52,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2016-01-01/Microsoft.Storage.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2016-01-01/Microsoft.Storage.json
index 9c330986a3..cf597c93d1 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2016-01-01/Microsoft.Storage.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Storage/2016-01-01/Microsoft.Storage.json
@@ -7,6 +7,9 @@
"storageAccounts": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -75,6 +78,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"sku",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/TrafficManager/2015-11-01/Microsoft.Network.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/TrafficManager/2015-11-01/Microsoft.Network.json
index e4ccd105ae..21d0954fdd 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/TrafficManager/2015-11-01/Microsoft.Network.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/TrafficManager/2015-11-01/Microsoft.Network.json
@@ -7,6 +7,9 @@
"trafficmanagerprofiles": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -49,6 +52,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.CertificateRegistration.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.CertificateRegistration.json
index 3225e61305..73532497cc 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.CertificateRegistration.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.CertificateRegistration.json
@@ -7,6 +7,9 @@
"certificateOrders": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -23,10 +26,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -71,6 +70,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -81,6 +81,9 @@
"certificateOrders_certificates": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -97,10 +100,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -135,6 +134,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -506,6 +506,9 @@
"certificateOrders_certificates_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -522,10 +525,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -560,6 +559,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.DomainRegistration.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.DomainRegistration.json
index 9b3959f559..82c44f158a 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.DomainRegistration.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.DomainRegistration.json
@@ -7,6 +7,9 @@
"domains": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -23,10 +26,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -61,6 +60,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.Web.json b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.Web.json
index e29fc540bd..f8292f4c40 100644
--- a/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.Web.json
+++ b/src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected/Web/2015-08-01/Microsoft.Web.json
@@ -7,6 +7,9 @@
"certificates": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -23,10 +26,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -61,6 +60,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -71,6 +71,9 @@
"csrs": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -87,10 +90,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -125,6 +124,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -135,6 +135,9 @@
"hostingEnvironments": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -151,10 +154,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -199,6 +198,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -209,6 +209,9 @@
"hostingEnvironments_workerPools": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -225,10 +228,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -273,6 +272,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -283,6 +283,9 @@
"managedHostingEnvironments": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -299,10 +302,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -337,6 +336,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -347,6 +347,9 @@
"serverfarms": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -363,10 +366,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -411,6 +410,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -421,6 +421,9 @@
"serverfarms_virtualNetworkConnections_gateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -437,10 +440,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -475,6 +474,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -485,6 +485,9 @@
"serverfarms_virtualNetworkConnections_routes": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -501,10 +504,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -539,6 +538,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -549,6 +549,9 @@
"sites": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -565,10 +568,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -628,6 +627,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -638,6 +638,9 @@
"sites_deployments": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -654,10 +657,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -692,6 +691,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -702,6 +702,9 @@
"sites_hostNameBindings": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -718,10 +721,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -756,6 +755,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -766,6 +766,9 @@
"sites_hybridconnection": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -782,10 +785,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -820,6 +819,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -830,6 +830,9 @@
"sites_instances_deployments": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -846,10 +849,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -884,6 +883,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -894,6 +894,9 @@
"sites_premieraddons": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -936,14 +939,6 @@
"description": "Azure resource manager plan"
},
"properties": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Resource specific properties"
},
"sku": {
@@ -959,6 +954,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -968,6 +964,9 @@
"sites_slots": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -984,10 +983,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -1044,6 +1039,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1054,6 +1050,9 @@
"sites_slots_deployments": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1070,10 +1069,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -1108,6 +1103,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1118,6 +1114,9 @@
"sites_slots_hostNameBindings": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1134,10 +1133,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -1172,6 +1167,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1182,6 +1178,9 @@
"sites_slots_hybridconnection": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1198,10 +1197,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -1236,6 +1231,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1246,6 +1242,9 @@
"sites_slots_instances_deployments": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1262,10 +1261,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -1300,6 +1295,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1310,6 +1306,9 @@
"sites_slots_premieraddons": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1352,14 +1351,6 @@
"description": "Azure resource manager plan"
},
"properties": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Resource specific properties"
},
"sku": {
@@ -1375,6 +1366,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -1384,6 +1376,9 @@
"sites_slots_virtualNetworkConnections": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1400,10 +1395,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -1448,6 +1439,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1458,6 +1450,9 @@
"sites_slots_virtualNetworkConnections_gateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1474,10 +1469,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -1512,6 +1503,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1522,6 +1514,9 @@
"sites_virtualNetworkConnections": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1538,10 +1533,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -1586,6 +1577,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -1596,6 +1588,9 @@
"sites_virtualNetworkConnections_gateways": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -1612,10 +1607,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -1650,6 +1641,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -2476,6 +2468,9 @@
"hostingEnvironments_workerPools_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -2492,10 +2487,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -2540,6 +2531,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -3512,6 +3504,9 @@
"sites_deployments_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3528,10 +3523,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -3566,6 +3557,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -3576,6 +3568,9 @@
"sites_hostNameBindings_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3592,10 +3587,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -3630,6 +3621,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -3640,6 +3632,9 @@
"sites_hybridconnection_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3656,10 +3651,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -3694,6 +3685,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -3704,6 +3696,9 @@
"sites_premieraddons_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3746,14 +3741,6 @@
"description": "Azure resource manager plan"
},
"properties": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Resource specific properties"
},
"sku": {
@@ -3769,6 +3756,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -3778,6 +3766,9 @@
"sites_slots_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3794,10 +3785,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -3851,6 +3838,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -3861,6 +3849,9 @@
"sites_slots_deployments_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3877,10 +3868,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -3915,6 +3902,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -3925,6 +3913,9 @@
"sites_slots_hostNameBindings_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -3941,10 +3932,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -3979,6 +3966,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -3989,6 +3977,9 @@
"sites_slots_hybridconnection_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -4005,10 +3996,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -4043,6 +4030,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -4053,6 +4041,9 @@
"sites_slots_premieraddons_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -4095,14 +4086,6 @@
"description": "Azure resource manager plan"
},
"properties": {
- "oneOf": [
- {
- "type": "object"
- },
- {
- "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression"
- }
- ],
"description": "Resource specific properties"
},
"sku": {
@@ -4118,6 +4101,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"properties"
@@ -4127,6 +4111,9 @@
"sites_slots_virtualNetworkConnections_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -4143,10 +4130,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -4191,6 +4174,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -4201,6 +4185,9 @@
"sites_slots_virtualNetworkConnections_gateways_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -4217,10 +4204,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -4255,6 +4238,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -4265,6 +4249,9 @@
"sites_virtualNetworkConnections_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -4281,10 +4268,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -4329,6 +4312,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
@@ -4339,6 +4323,9 @@
"sites_virtualNetworkConnections_gateways_childResource": {
"type": "object",
"properties": {
+ "name": {
+ "type": "string"
+ },
"type": {
"type": "string",
"enum": [
@@ -4355,10 +4342,6 @@
"type": "string",
"description": "Resource Id"
},
- "name": {
- "type": "string",
- "description": "Resource Name"
- },
"kind": {
"type": "string",
"description": "Kind of resource"
@@ -4393,6 +4376,7 @@
}
},
"required": [
+ "name",
"type",
"apiVersion",
"location",
diff --git a/src/generator/AutoRest.CSharp.Azure.Fluent/TransformerCsaf.cs b/src/generator/AutoRest.CSharp.Azure.Fluent/TransformerCsaf.cs
index 1cee553fd9..c0301487f9 100644
--- a/src/generator/AutoRest.CSharp.Azure.Fluent/TransformerCsaf.cs
+++ b/src/generator/AutoRest.CSharp.Azure.Fluent/TransformerCsaf.cs
@@ -19,12 +19,12 @@ CodeModelCsaf ITransformer.TransformCodeModel(CodeModel cs)
var codeModel = cs as CodeModelCsaf;
Settings.Instance.AddCredentials = true;
- // Do parameter transformations
- TransformParameters(codeModel);
-
// todo: these should be turned into individual transformers
AzureExtensions.NormalizeAzureClientModel(codeModel);
+ // Do parameter transformations
+ TransformParameters(codeModel);
+
// Fluent Specific stuff.
NormalizeResourceTypes(codeModel);
NormalizeTopLevelTypes(codeModel);
diff --git a/src/generator/AutoRest.CSharp.Azure/TransformerCsa.cs b/src/generator/AutoRest.CSharp.Azure/TransformerCsa.cs
index 7cde0c8dce..0f21331590 100644
--- a/src/generator/AutoRest.CSharp.Azure/TransformerCsa.cs
+++ b/src/generator/AutoRest.CSharp.Azure/TransformerCsa.cs
@@ -41,12 +41,12 @@ CodeModelCsa ITransformer.TransformCodeModel(CodeModel cs)
// add the Credentials
// PopulateAdditionalProperties(codeModel);
- // Do parameter transformations
- TransformParameters(codeModel);
-
// todo: these should be turned into individual transformers
AzureExtensions.NormalizeAzureClientModel(codeModel);
+ // Do parameter transformations
+ TransformParameters(codeModel);
+
NormalizePaginatedMethods(codeModel);
NormalizeODataMethods(codeModel);
diff --git a/src/generator/AutoRest.CSharp.Unit.Tests/Bug1763.cs b/src/generator/AutoRest.CSharp.Unit.Tests/Bug1763.cs
new file mode 100644
index 0000000000..f222d772ae
--- /dev/null
+++ b/src/generator/AutoRest.CSharp.Unit.Tests/Bug1763.cs
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using System.Text.RegularExpressions;
+using Microsoft.CodeAnalysis;
+using Xunit;
+using Xunit.Abstractions;
+
+namespace AutoRest.CSharp.Unit.Tests
+{
+ public class Bug1763 : BugTest
+ {
+ public Bug1763(ITestOutputHelper output) : base(output)
+ {
+ }
+
+ ///
+ /// https://github.com/Azure/autorest/issues/1763
+ /// Verifies autorest succesfully generates code for models with properties starting with '_'
+ ///
+ [Fact]
+ public async Task VerifyUnderscoredClassMembers()
+ {
+ using (var fileSystem = GenerateCodeForTestFromSpec())
+ {
+ var result = await Compile(fileSystem);
+
+ // Expected Files
+ Assert.True(fileSystem.FileExists(@"GeneratedCode\Models\Pet.cs"));
+
+ // filter the warnings
+ var warnings = result.Messages.Where(
+ each => each.Severity == DiagnosticSeverity.Warning
+ && !SuppressWarnings.Contains(each.Id)).ToArray();
+
+ // filter the errors
+ var errors = result.Messages.Where(each => each.Severity == DiagnosticSeverity.Error).ToArray();
+
+ Write(warnings, fileSystem);
+ Write(errors, fileSystem);
+
+ // Don't proceed unless we have zero warnings.
+ Assert.Empty(warnings);
+ // Don't proceed unless we have zero Errors.
+ Assert.Empty(errors);
+
+ // Should also succeed.
+ Assert.True(result.Succeeded);
+
+ // try to load the assembly
+ var asm = Assembly.Load(result.Output.GetBuffer());
+ Assert.NotNull(asm);
+ var petModel = asm.ExportedTypes.First(type => type.FullName == "Test.Models.Pet" );
+ var idMember = petModel.GetMembers().First(member => member.Name == "_id" );
+ Assert.NotNull(idMember);
+
+ // now read from the file to ensure we use this. to access the members
+ var codeText = fileSystem.ReadFileAsText(@"GeneratedCode\Models\Pet.cs");
+ // get hold of the ctor
+ var regex = new Regex(Regex.Escape("public Pet(int _id, string name = default(string))") + @"[^}]+");
+ var match = regex.Match(codeText);
+ Assert.NotNull(match);
+ // verify the ctor has proper assignments
+ Assert.True(match.Groups[0].Value.Contains("this._id = _id"));
+ Assert.True(match.Groups[0].Value.Contains("this.Name = name"));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/generator/AutoRest.CSharp.Unit.Tests/Resource/Bug1763/Bug1763.yaml b/src/generator/AutoRest.CSharp.Unit.Tests/Resource/Bug1763/Bug1763.yaml
new file mode 100644
index 0000000000..67e241b1f4
--- /dev/null
+++ b/src/generator/AutoRest.CSharp.Unit.Tests/Resource/Bug1763/Bug1763.yaml
@@ -0,0 +1,31 @@
+---
+swagger: '2.0'
+info:
+ title: TestAPI
+ description: test api
+ version: 0.0.0
+paths:
+ "/SimpleAPI/Pets":
+ put:
+ operationId: test_PutPet
+ description: Put pet with name
+ parameters:
+ - in: body
+ name: pet
+ description: pet to put
+ required: true
+ schema:
+ "$ref": "#/definitions/Pet"
+ responses:
+ '200':
+ description: Pet added to system
+definitions:
+ Pet:
+ description: simple pet to add
+ required:
+ - _id
+ properties:
+ _id:
+ type: integer
+ name:
+ type: string
\ No newline at end of file
diff --git a/src/generator/AutoRest.CSharp/Templates/Rest/Common/ModelTemplate.cshtml b/src/generator/AutoRest.CSharp/Templates/Rest/Common/ModelTemplate.cshtml
index 8f29c3e9cc..e09d990acb 100644
--- a/src/generator/AutoRest.CSharp/Templates/Rest/Common/ModelTemplate.cshtml
+++ b/src/generator/AutoRest.CSharp/Templates/Rest/Common/ModelTemplate.cshtml
@@ -55,7 +55,7 @@ namespace @(Settings.Namespace).@(Settings.ModelsName)
&& p.IsRequired
&& ((CompositeType)p.ModelType).ContainsConstantProperties))
{
- @:@(property.Name) = new @(property.ModelTypeName)();
+ @:this.@(property.Name) = new @(property.ModelTypeName)();
}
}
@@ -88,7 +88,7 @@ namespace @(Settings.Namespace).@(Settings.ModelsName)
&& p.IsRequired
&& ((CompositeType)p.ModelType).ContainsConstantProperties))
{
- @:@(property.Name) = new @(property.ModelTypeName)();
+ @:this.@(property.Name) = new @(property.ModelTypeName)();
}
foreach (var property in Model.Properties.Where(p => !p.IsConstant))
@@ -100,7 +100,7 @@ namespace @(Settings.Namespace).@(Settings.ModelsName)
}
else
{
- @:@(property.Name) = @propName;
+ @:this.@(property.Name) = @propName;
}
}
@@ -208,7 +208,7 @@ namespace @(Settings.Namespace).@(Settings.ModelsName)
foreach (PropertyCs property in Model.Properties.Where(p => p.IsRequired && !p.IsReadOnly && !p.IsConstant && p.IsNullable() ))
{
anythingToValidate = true;
- @:if (@property.Name == null)
+ @:if (this.@property.Name == null)
@:{
@:throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "@property.Name");
@:}
diff --git a/src/generator/AutoRest.Go.Tests/src/tests/acceptancetests/custombaseurlgrouptest/custom-baseurl_test.go b/src/generator/AutoRest.Go.Tests/src/tests/acceptancetests/custombaseurlgrouptest/custom-baseurl_test.go
index 653d857174..91106cc5a8 100644
--- a/src/generator/AutoRest.Go.Tests/src/tests/acceptancetests/custombaseurlgrouptest/custom-baseurl_test.go
+++ b/src/generator/AutoRest.Go.Tests/src/tests/acceptancetests/custombaseurlgrouptest/custom-baseurl_test.go
@@ -5,7 +5,6 @@ import (
chk "gopkg.in/check.v1"
- "tests/acceptancetests/utils"
. "tests/generated/custom-baseurl"
)
@@ -18,12 +17,20 @@ var _ = chk.Suite(&CustomBaseURLGroupSuite{})
var custombaseuriClient = getCustomBaseURIClient()
func getCustomBaseURIClient() PathsClient {
- c := NewPathsClient("local")
- c.BaseURI = utils.GetBaseURI()
- return c
+ c := NewWithoutDefaults("host:3000")
+ return PathsClient{ManagementClient: c}
}
-func (s *CustomBaseURLGroupSuite) TestGetEmpty(c *chk.C) {
- _, err := custombaseuriClient.GetEmpty()
+func (s *CustomBaseURLGroupSuite) TestCustomBaseUriPositive(c *chk.C) {
+ _, err := custombaseuriClient.GetEmpty("local")
c.Assert(err, chk.IsNil)
}
+
+func (s *CustomBaseURLGroupSuite) TestCustomBaseUriNegative(c *chk.C) {
+ _, err := custombaseuriClient.GetEmpty("badhost:3000")
+ c.Assert(err, chk.NotNil)
+
+ custombaseuriClient.RetryAttempts = 0
+ _, err = custombaseuriClient.GetEmpty("bad")
+ c.Assert(err, chk.NotNil)
+}
diff --git a/src/generator/AutoRest.Go.Tests/src/tests/acceptancetests/morecustombaseurigrouptest/more-custom-base-uri_test.go b/src/generator/AutoRest.Go.Tests/src/tests/acceptancetests/morecustombaseurigrouptest/more-custom-base-uri_test.go
new file mode 100644
index 0000000000..372bdbef96
--- /dev/null
+++ b/src/generator/AutoRest.Go.Tests/src/tests/acceptancetests/morecustombaseurigrouptest/more-custom-base-uri_test.go
@@ -0,0 +1,27 @@
+package morecustombaseurigrouptest
+
+import (
+ "testing"
+
+ chk "gopkg.in/check.v1"
+
+ . "tests/generated/more-custom-base-uri"
+)
+
+func Test(t *testing.T) { chk.TestingT(t) }
+
+type MoreCustomBaseURIGroupSuite struct{}
+
+var _ = chk.Suite(&MoreCustomBaseURIGroupSuite{})
+
+var custombaseuriClient = getMoreCustomBaseURIClient()
+
+func getMoreCustomBaseURIClient() PathsClient {
+ c := NewWithoutDefaults("test12", "host:3000")
+ return PathsClient{ManagementClient: c}
+}
+
+func (s *MoreCustomBaseURIGroupSuite) TestCustomBaseUriMoreOptions(c *chk.C) {
+ _, err := custombaseuriClient.GetEmpty("http://lo", "cal", "key1", "v1")
+ c.Assert(err, chk.IsNil)
+}
diff --git a/src/generator/AutoRest.Go.Tests/src/tests/runner.go b/src/generator/AutoRest.Go.Tests/src/tests/runner.go
index ee92b83f43..04731ee1e7 100644
--- a/src/generator/AutoRest.Go.Tests/src/tests/runner.go
+++ b/src/generator/AutoRest.Go.Tests/src/tests/runner.go
@@ -66,7 +66,9 @@ func runTests(allPass *bool) {
"custombaseurlgroup",
"filegroup",
// "formdatagroup",
- "paginggroup"}
+ "paginggroup",
+ "morecustombaseurigroup",
+ }
for _, suite := range testSuites {
fmt.Printf("Run test (go test ./acceptancetests/%vtest -v) ...\n", suite)
diff --git a/src/generator/AutoRest.Go/CodeNamerGo.cs b/src/generator/AutoRest.Go/CodeNamerGo.cs
index 6392646879..0a90dcfd36 100644
--- a/src/generator/AutoRest.Go/CodeNamerGo.cs
+++ b/src/generator/AutoRest.Go/CodeNamerGo.cs
@@ -11,6 +11,8 @@
using AutoRest.Core.Utilities.Collections;
using AutoRest.Core.Model;
using AutoRest.Go.Model;
+using System.Text;
+using System.Text.RegularExpressions;
namespace AutoRest.Go
{
@@ -29,7 +31,7 @@ public class CodeNamerGo : CodeNamer
public virtual IEnumerable StandardImports => new string[] { "github.com/Azure/go-autorest/autorest/azure", "net/http" };
public virtual IEnumerable PageableImports => new string[] { "net/http", "github.com/Azure/go-autorest/autorest/to" };
-
+
public virtual IEnumerable ValidationImport => new string[] { "github.com/Azure/go-autorest/autorest/validation" };
// CommonInitialisms are those "words" within a name that Golint expects to be uppercase.
@@ -82,10 +84,14 @@ public class CodeNamerGo : CodeNamer
"ManagementClient",
"NewWithBaseURI",
"New",
+ "NewWithoutDefaults",
};
public IReadOnlyDictionary StatusCodeToGoString;
+
+ private static readonly Regex semVerPattern = new Regex(@"^(?\d+)\.(?\d+)\.(?\d+)(?:-(?\S+))?$", RegexOptions.Compiled);
+
///
/// Initializes a new instance of CodeNamerGo.
///
@@ -412,20 +418,12 @@ public void ReserveNamespace(string ns)
// camelCase or PascalCase.
private string EnsureNameCase(string name)
{
- List words = new List();
- new List(name.ToWords())
- .ForEach(s =>
- {
- if (CommonInitialisms.Contains(s))
- {
- words.Add(s.ToUpper());
- }
- else
- {
- words.Add(s);
- }
- });
- return String.Join(String.Empty, words.ToArray());
+ var builder = new StringBuilder();
+ foreach (var s in name.ToWords())
+ {
+ builder.Append(CommonInitialisms.Contains(s) ? s.ToUpper() : s);
+ }
+ return builder.ToString();
}
public static string[] SDKVersionFromPackageVersion(string v)
@@ -434,12 +432,19 @@ public static string[] SDKVersionFromPackageVersion(string v)
{
throw new ArgumentNullException("package version");
}
- string[] version = v.Split('.');
- if (version.Length != 3)
+
+ var ver = semVerPattern.Match(v);
+
+ if (ver.Success)
{
- throw new InvalidOperationException("version string should have major, minor and patch versions.");
+ var tagVal = ver.Groups["tag"].Success ? ver.Groups["tag"].Value : "";
+ return new[] { ver.Groups["major"].Value, ver.Groups["minor"].Value, ver.Groups["patch"].Value, tagVal };
+
}
- return version;
+ throw new ArgumentException(
+ paramName: nameof(v),
+ message: "Version strings should be either of the format \"..\" or \"..-\". Where major, minor, and patch are decimal numbers and tag does not include whitespace.");
+
}
public override string EscapeDefaultValue(string defaultValue, IModelType type)
diff --git a/src/generator/AutoRest.Go/Model/CodeModelGo.cs b/src/generator/AutoRest.Go/Model/CodeModelGo.cs
index ef81fe719e..3489bf984a 100644
--- a/src/generator/AutoRest.Go/Model/CodeModelGo.cs
+++ b/src/generator/AutoRest.Go/Model/CodeModelGo.cs
@@ -6,6 +6,7 @@
using AutoRest.Core;
using AutoRest.Core.Model;
using AutoRest.Core.Utilities;
+using AutoRest.Extensions;
namespace AutoRest.Go.Model
{
@@ -48,6 +49,8 @@ public string GetDocumentation()
public string BaseClient => "ManagementClient";
+ public bool IsCustomBaseUri => Extensions.ContainsKey(SwaggerExtensions.ParameterizedHostExtension);
+
public IEnumerable ClientImports
{
get
@@ -103,7 +106,7 @@ public string GlobalParameters
var declarations = new List();
foreach (var p in Properties)
{
- if (!p.SerializedName.FixedValue.IsApiVersion())
+ if (!p.SerializedName.FixedValue.IsApiVersion() && p.DefaultValue.FixedValue.IsNullOrEmpty())
{
declarations.Add(
string.Format(
@@ -122,7 +125,7 @@ public string HelperGlobalParameters
var invocationParams = new List();
foreach (var p in Properties)
{
- if (!p.SerializedName.Value.IsApiVersion())
+ if (!p.SerializedName.Value.IsApiVersion() && p.DefaultValue.FixedValue.IsNullOrEmpty())
{
invocationParams.Add(p.Name.Value.ToSentence());
}
@@ -130,6 +133,92 @@ public string HelperGlobalParameters
return string.Join(", ", invocationParams);
}
}
+ public string GlobalDefaultParameters
+ {
+ get
+ {
+ var declarations = new List();
+ foreach (var p in Properties)
+ {
+ if (!p.SerializedName.FixedValue.IsApiVersion() && !p.DefaultValue.FixedValue.IsNullOrEmpty())
+ {
+ declarations.Add(
+ string.Format(
+ (p.IsRequired || p.ModelType.CanBeEmpty() ? "{0} {1}" : "{0} *{1}"),
+ p.Name.Value.ToSentence(), p.ModelType.Name.Value.ToSentence()));
+ }
+ }
+ return string.Join(", ", declarations);
+ }
+ }
+
+ public string HelperGlobalDefaultParameters
+ {
+ get
+ {
+ var invocationParams = new List();
+ foreach (var p in Properties)
+ {
+ if (!p.SerializedName.Value.IsApiVersion() && !p.DefaultValue.FixedValue.IsNullOrEmpty())
+ {
+ invocationParams.Add("Default" + p.Name.Value);
+ }
+ }
+ return string.Join(", ", invocationParams);
+ }
+ }
+
+ public string ConstGlobalDefaultParameters
+ {
+ get
+ {
+ var constDeclaration = new List();
+ foreach (var p in Properties)
+ {
+ if (!p.SerializedName.Value.IsApiVersion() && !p.DefaultValue.FixedValue.IsNullOrEmpty())
+ {
+ constDeclaration.Add(string.Format("// Default{0} is the default value for {1}\nDefault{0} = {2}",
+ p.Name.Value,
+ p.Name.Value.ToPhrase(),
+ p.DefaultValue.Value));
+ }
+ }
+ return string.Join("\n", constDeclaration);
+ }
+ }
+
+
+ public string AllGlobalParameters
+ {
+ get
+ {
+ if (GlobalParameters.IsNullOrEmpty())
+ {
+ return GlobalDefaultParameters;
+ }
+ if (GlobalDefaultParameters.IsNullOrEmpty())
+ {
+ return GlobalParameters;
+ }
+ return string.Join(", ", new string[] {GlobalParameters, GlobalDefaultParameters});
+ }
+ }
+
+ public string HelperAllGlobalParameters
+ {
+ get
+ {
+ if (HelperGlobalParameters.IsNullOrEmpty())
+ {
+ return HelperGlobalDefaultParameters;
+ }
+ if (HelperGlobalDefaultParameters.IsNullOrEmpty())
+ {
+ return HelperGlobalParameters;
+ }
+ return string.Join(", ", new string[] {HelperGlobalParameters, HelperGlobalDefaultParameters});
+ }
+ }
public IEnumerable ClientMethods
{
diff --git a/src/generator/AutoRest.Go/Model/MethodGo.cs b/src/generator/AutoRest.Go/Model/MethodGo.cs
index b8874de48f..7941852c25 100644
--- a/src/generator/AutoRest.Go/Model/MethodGo.cs
+++ b/src/generator/AutoRest.Go/Model/MethodGo.cs
@@ -4,6 +4,7 @@
using AutoRest.Go.Properties;
using AutoRest.Core.Utilities;
using AutoRest.Core.Model;
+using AutoRest.Extensions;
using AutoRest.Extensions.Azure;
using AutoRest.Extensions.Azure.Model;
using Newtonsoft.Json;
@@ -26,6 +27,9 @@ public class MethodGo : Method
public bool NextAlreadyDefined { get; private set; }
+ public bool IsCustomBaseUri
+ => CodeModel.Extensions.ContainsKey(SwaggerExtensions.ParameterizedHostExtension);
+
public MethodGo()
{
NextAlreadyDefined = true;
@@ -140,6 +144,10 @@ public IEnumerable LocalParameters
public IEnumerable OptionalHeaderParameters => ParametersGo.HeaderParameters(false);
+ public IEnumerable URLParameters => ParametersGo.URLParameters();
+
+ public string URLMap => URLParameters.BuildParameterMap("urlParameters");
+
public IEnumerable PathParameters => ParametersGo.PathParameters();
public string PathMap => PathParameters.BuildParameterMap("pathParameters");
@@ -184,7 +192,14 @@ public List PrepareDecorators
}
decorators.Add(HTTPMethodDecorator);
- decorators.Add("autorest.WithBaseURL(client.BaseURI)");
+ if (!this.IsCustomBaseUri)
+ {
+ decorators.Add(string.Format("autorest.WithBaseURL(client.BaseURI)"));
+ }
+ else
+ {
+ decorators.Add(string.Format("autorest.WithCustomBaseURL(\"{0}\", urlParameters)", CodeModel.BaseUrl));
+ }
decorators.Add(string.Format(PathParameters.Any()
? "autorest.WithPathParameters(\"{0}\",pathParameters)"
diff --git a/src/generator/AutoRest.Go/Model/MethodGroupGo.cs b/src/generator/AutoRest.Go/Model/MethodGroupGo.cs
index b51d848efd..fba11e58aa 100644
--- a/src/generator/AutoRest.Go/Model/MethodGroupGo.cs
+++ b/src/generator/AutoRest.Go/Model/MethodGroupGo.cs
@@ -7,6 +7,7 @@
using AutoRest.Core.Model;
using AutoRest.Core.Utilities;
using AutoRest.Go;
+using AutoRest.Extensions;
namespace AutoRest.Go.Model
{
@@ -17,8 +18,14 @@ public class MethodGroupGo : MethodGroup
public string PackageName { get; private set; }
public string BaseClient { get; private set; }
+ public bool IsCustomBaseUri
+ => CodeModel.Extensions.ContainsKey(SwaggerExtensions.ParameterizedHostExtension);
+
public string GlobalParameters;
public string HelperGlobalParameters;
+ public string GlobalDefaultParameters;
+ public string HelperGlobalDefaultParameters;
+ public string ConstGlobalDefaultParameters;
public IEnumerable Imports { get; private set; }
public MethodGroupGo(string name): base(name)
@@ -58,6 +65,9 @@ internal void Transform(CodeModelGo cmg)
BaseClient = cmg.BaseClient;
GlobalParameters = cmg.GlobalParameters;
HelperGlobalParameters = cmg.HelperGlobalParameters;
+ GlobalDefaultParameters = cmg.GlobalDefaultParameters;
+ HelperGlobalDefaultParameters = cmg.HelperGlobalDefaultParameters;
+ ConstGlobalDefaultParameters = cmg.ConstGlobalDefaultParameters;
diff --git a/src/generator/AutoRest.Go/Model/ParameterGo.cs b/src/generator/AutoRest.Go/Model/ParameterGo.cs
index d68ed604a2..66c6687192 100644
--- a/src/generator/AutoRest.Go/Model/ParameterGo.cs
+++ b/src/generator/AutoRest.Go/Model/ParameterGo.cs
@@ -83,7 +83,7 @@ public string ValueForMap()
return "client." + ApiVersionName;
}
var value = IsClientProperty
- ? "client." + CodeNamerGo.Instance.PascalCase(Name.Value)
+ ? "client." + CodeNamerGo.Instance.GetPropertyName(Name.Value)
: Name.Value;
var format = IsRequired || ModelType.CanBeEmpty()
@@ -186,9 +186,30 @@ public static IEnumerable HeaderParameters(this IEnumerable URLParameters(this IEnumerable parameters)
+ {
+ var urlParams = new List();
+ foreach (ParameterGo p in parameters.ByLocation(ParameterLocation.Path))
+ {
+ if (p.Method.CodeModel.BaseUrl.Contains(p.SerializedName))
+ {
+ urlParams.Add(p);
+ }
+ }
+ return urlParams;
+ }
+
public static IEnumerable PathParameters(this IEnumerable parameters)
{
- return parameters.ByLocation(ParameterLocation.Path);
+ var pathParams = new List();
+ foreach (ParameterGo p in parameters.ByLocation(ParameterLocation.Path))
+ {
+ if (!p.Method.CodeModel.BaseUrl.Contains(p.SerializedName))
+ {
+ pathParams.Add(p);
+ }
+ }
+ return pathParams;
}
public static IEnumerable QueryParameters(this IEnumerable parameters)
diff --git a/src/generator/AutoRest.Go/Templates/MethodGroupTemplate.cshtml b/src/generator/AutoRest.Go/Templates/MethodGroupTemplate.cshtml
index 1424340c84..fdae9ac60e 100644
--- a/src/generator/AutoRest.Go/Templates/MethodGroupTemplate.cshtml
+++ b/src/generator/AutoRest.Go/Templates/MethodGroupTemplate.cshtml
@@ -34,15 +34,31 @@ type @(Model.ClientName) struct {
@WrapComment("// ", string.Format("New{0} creates an instance of the {0} client.", Model.ClientName))
func New@(Model.ClientName)(@(Model.GlobalParameters)) @(Model.ClientName) {
- return New@(Model.ClientName)WithBaseURI(DefaultBaseURI, @(Model.HelperGlobalParameters))
+ @if (!Model.IsCustomBaseUri)
+ {
+
+ return New@(Model.ClientName)WithBaseURI(DefaultBaseURI, @(Model.HelperGlobalParameters))
+
+ }
+ else
+ {
+
+ return @(Model.ClientName){ New(@(Model.HelperGlobalParameters))}
+
+ }
}
@EmptyLine
-@WrapComment("// ", string.Format("New{0}WithBaseURI creates an instance of the {0} client.", Model.ClientName))
-func New@(Model.ClientName)WithBaseURI(baseURI string, @(Model.GlobalParameters)) @(Model.ClientName) {
- return @(Model.ClientName){NewWithBaseURI(baseURI, @(Model.HelperGlobalParameters))}
+@if (!Model.IsCustomBaseUri)
+{
+ @WrapComment("// ", string.Format("New{0}WithBaseURI creates an instance of the {0} client.", Model.ClientName))
+
+ func New@(Model.ClientName)WithBaseURI(baseURI string, @(Model.GlobalParameters)) @(Model.ClientName) {
+ return @(Model.ClientName){ NewWithBaseURI(baseURI, @(Model.HelperGlobalParameters))}
+ }
+
+ @EmptyLine
}
-@EmptyLine
@foreach (var method in methods)
{
diff --git a/src/generator/AutoRest.Go/Templates/MethodTemplate.cshtml b/src/generator/AutoRest.Go/Templates/MethodTemplate.cshtml
index c79aee2d06..78d98de871 100644
--- a/src/generator/AutoRest.Go/Templates/MethodTemplate.cshtml
+++ b/src/generator/AutoRest.Go/Templates/MethodTemplate.cshtml
@@ -73,6 +73,11 @@ func (client @(Model.Owner)) @(Model.MethodSignature) (@Model.MethodReturnSignat
@EmptyLine
// @(Model.PreparerMethodName) prepares the @(Model.Name) request.
func (client @(Model.Owner)) @(Model.PreparerMethodName)(@(Model.MethodParametersSignature)) (*http.Request, error) {
+@if (Model.IsCustomBaseUri && Model.URLParameters.Count() > 0)
+{
+ @:@(Model.URLMap)
+ @:@EmptyLine
+}
@if (Model.PathParameters.Count() > 0)
{
@:@(Model.PathMap)
diff --git a/src/generator/AutoRest.Go/Templates/ServiceClientTemplate.cshtml b/src/generator/AutoRest.Go/Templates/ServiceClientTemplate.cshtml
index 3cfa4b9073..328beb5eb5 100644
--- a/src/generator/AutoRest.Go/Templates/ServiceClientTemplate.cshtml
+++ b/src/generator/AutoRest.Go/Templates/ServiceClientTemplate.cshtml
@@ -28,49 +28,92 @@ import (
const (
// APIVersion is the version of the @(Model.ServiceName)
APIVersion = "@Model.ApiVersion"
- @EmptyLine
- // DefaultBaseURI is the default URI used for the service @(Model.ServiceName)
- DefaultBaseURI = "@Model.BaseUrl"
+ @if (!Model.IsCustomBaseUri)
+ {
+ @EmptyLine
+ @:// DefaultBaseURI is the default URI used for the service @(Model.ServiceName)
+ @:DefaultBaseURI = "@Model.BaseUrl"
+ }
+ else
+ {
+ @(Model.ConstGlobalDefaultParameters)
+ }
)
@EmptyLine
@WrapComment("// ", Model.ClientDocumentation)
type @(Model.BaseClient) struct {
autorest.Client
- BaseURI string
+ @if (!Model.IsCustomBaseUri)
+ {
+ @:BaseURI string
+ }
APIVersion string
@foreach (var p in Model.Properties)
{
- if (!p.SerializedName.FixedValue.IsApiVersion())
- {
- @:@(string.Format((p.IsRequired || p.ModelType.CanBeEmpty()
- ? "{0} {1}": "{0} *{1}"),
- p.Name, p.ModelType.Name))
- }
+ if (!p.SerializedName.FixedValue.IsApiVersion())
+ {
+ @:@(string.Format((p.IsRequired || p.ModelType.CanBeEmpty()
+ ? "{0} {1}" : "{0} *{1}"),
+ p.Name, p.ModelType.Name))
+ }
}
}
+
@EmptyLine
@WrapComment("// ", string.Format("New creates an instance of the {0} client.", Model.BaseClient))
func New(@(Model.GlobalParameters))@(Model.BaseClient) {
- return NewWithBaseURI(DefaultBaseURI, @(Model.HelperGlobalParameters))
+ @if (!Model.IsCustomBaseUri)
+ {
+ @:return NewWithBaseURI(DefaultBaseURI, @(Model.HelperGlobalParameters))
+ }
+ else
+ {
+ @:return NewWithoutDefaults(@(Model.HelperAllGlobalParameters))
+ }
}
-@EmptyLine
-@WrapComment("// ", string.Format("NewWithBaseURI creates an instance of the {0} client.", Model.BaseClient))
-func NewWithBaseURI(baseURI string, @(Model.GlobalParameters)) @(Model.BaseClient) {
- return @(Model.BaseClient){
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- APIVersion: APIVersion,
- @foreach (var p in Model.Properties)
- {
- if (!p.SerializedName.Value.IsApiVersion())
- {
- @:@(string.Format("{0}: {1},", p.Name, p.Name.Value.ToSentence()))
+@if (!Model.IsCustomBaseUri)
+{
+
+ @EmptyLine
+ @WrapComment("// ", string.Format("NewWithBaseURI creates an instance of the {0} client.", Model.BaseClient))
+ func NewWithBaseURI(baseURI string, @(Model.GlobalParameters)) @(Model.BaseClient) {
+ return @(Model.BaseClient){
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ APIVersion: APIVersion,
+ @foreach (var p in Model.Properties)
+ {
+ if (!p.SerializedName.Value.IsApiVersion())
+ {
+ @:@(string.Format("{0}: {1},", p.Name, p.Name.Value.ToSentence()))
+ }
+ }
}
+ }
+
+}
+else
+{
+
+ @EmptyLine
+ @WrapComment("// ", string.Format("NewWithoutDefaults creates an instance of the {0} client.", Model.BaseClient))
+ func NewWithoutDefaults(@(Model.AllGlobalParameters)) @(Model.BaseClient) {
+ return @(Model.BaseClient){
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ APIVersion: APIVersion,
+ @foreach(var p in Model.Properties)
+ {
+ if (!p.SerializedName.Value.IsApiVersion())
+ {
+ @:@(string.Format("{0}: {1},", p.Name, p.Name.Value.ToSentence()))
+ }
+ }
}
}
+
}
@EmptyLine
diff --git a/src/generator/AutoRest.Go/Templates/VersionTemplate.cshtml b/src/generator/AutoRest.Go/Templates/VersionTemplate.cshtml
index 6ba8e4957b..32ce64cad0 100644
--- a/src/generator/AutoRest.Go/Templates/VersionTemplate.cshtml
+++ b/src/generator/AutoRest.Go/Templates/VersionTemplate.cshtml
@@ -13,7 +13,9 @@ package @Model.Namespace
@EmptyLine
import (
+ "bytes"
"fmt"
+ "strings"
)
@EmptyLine
@@ -21,21 +23,36 @@ const (
major = "@(Model.Version[0])"
minor = "@(Model.Version[1])"
patch = "@(Model.Version[2])"
- // Always begin a "tag" with a dash (as per http://semver.org)
- tag = "-beta"
+ tag = "@(Model.Version[3])"
- semVerFormat = "%s.%s.%s%s"
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
)
+// cached results of UserAgent and Version to prevent repeated operations.
+var (
+ userAgent string
+ version string
+)
+
@EmptyLine
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return fmt.Sprintf(userAgentFormat, Version(), "@(Model.Namespace)", "@(Model.ApiVersion)")
+ if userAgent == "" {
+ userAgent = fmt.Sprintf(userAgentFormat, Version(), "@(Model.Namespace)", "@(Model.ApiVersion)")
+ }
+ return userAgent
}
@EmptyLine
// Version returns the semantic version (see http://semver.org) of the client.
func Version() string {
- return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
+ if version == "" {
+ versionBuilder := bytes.NewBufferString(fmt.Sprintf("%s.%s.%s", major, minor, patch))
+ if tag != "" {
+ versionBuilder.WriteRune('-')
+ versionBuilder.WriteString(strings.TrimPrefix(tag, "-"))
+ }
+ version = string(versionBuilder.Bytes())
+ }
+ return version
}
diff --git a/src/generator/AutoRest.Go/TransformerGo.cs b/src/generator/AutoRest.Go/TransformerGo.cs
index 7abb06bb83..ce2507ab54 100644
--- a/src/generator/AutoRest.Go/TransformerGo.cs
+++ b/src/generator/AutoRest.Go/TransformerGo.cs
@@ -14,6 +14,7 @@
using System.Diagnostics;
using System.Globalization;
using System.Linq;
+using AutoRest.Extensions.Azure;
namespace AutoRest.Go
{
@@ -37,6 +38,7 @@ public override CodeModelGo TransformCodeModel(CodeModel cm)
TransformEnumTypes(cmg);
TransformMethods(cmg);
TransformModelTypes(cmg);
+ AzureExtensions.ProcessParameterizedHost(cmg);
return cmg;
}
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java
index bc8ca473c8..33fd5cad14 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java
@@ -1,5 +1,6 @@
package fixtures.azureparametergrouping;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -15,7 +16,7 @@ public class ParameterGroupingTests {
@BeforeClass
public static void setup() {
- client = new AutoRestParameterGroupingTestServiceImpl("http://localhost.:3000", null);
+ client = new AutoRestParameterGroupingTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurereport/CoverageReporter.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurereport/CoverageReporter.java
index 83f3cd1fb0..495bdde955 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurereport/CoverageReporter.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurereport/CoverageReporter.java
@@ -4,10 +4,11 @@
import java.util.List;
import java.util.Map;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import fixtures.azurereport.implementation.AutoRestReportServiceForAzureImpl;
public final class CoverageReporter {
- private static AutoRestReportServiceForAzureImpl client = new AutoRestReportServiceForAzureImpl("http://localhost:3000", null);
+ private static AutoRestReportServiceForAzureImpl client = new AutoRestReportServiceForAzureImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
private CoverageReporter() { }
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java
index ddb19d384d..ef33a385c0 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java
@@ -1,5 +1,6 @@
package fixtures.azurespecials;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -10,7 +11,7 @@ public class ApiVersionDefaultTests {
@BeforeClass
public static void setup() {
- client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost.:3000", null);
+ client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java
index be8c0ce6fa..70e59503c1 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java
@@ -1,5 +1,6 @@
package fixtures.azurespecials;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -10,7 +11,7 @@ public class ApiVersionLocalTests {
@BeforeClass
public static void setup() {
- client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost.:3000", null);
+ client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java
index 41607ef9df..b02e2f43d4 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java
@@ -2,6 +2,7 @@
import com.microsoft.rest.ServiceResponseWithHeaders;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -15,13 +16,13 @@ public class HeaderOperationsTests {
@BeforeClass
public static void setup() {
- client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost.:3000", null);
+ client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
public void customNamedRequestId() throws Exception {
ServiceResponseWithHeaders response = client.headers().customNamedRequestIdWithServiceResponseAsync("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0").toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
- Assert.assertEquals("123", response.getHeaders().fooRequestId());
+ Assert.assertEquals(200, response.response().code());
+ Assert.assertEquals("123", response.headers().fooRequestId());
}
}
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java
index c133562146..71c9c58482 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java
@@ -1,5 +1,6 @@
package fixtures.azurespecials;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
@@ -16,7 +17,7 @@ public class SkipUrlEncodingTests {
@BeforeClass
public static void setup() {
- client = new AutoRestAzureSpecialParametersTestClientImpl(baseUrl, null).skipUrlEncodings();
+ client = new AutoRestAzureSpecialParametersTestClientImpl(baseUrl, new BasicAuthenticationCredentials(null, null)).skipUrlEncodings();
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java
index 49f4c69989..5261a1fff6 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java
@@ -1,7 +1,7 @@
package fixtures.azurespecials;
-import com.microsoft.azure.RequestIdHeaderInterceptor;
-import com.microsoft.azure.RestClient;
+import com.microsoft.rest.interceptors.RequestIdHeaderInterceptor;
+import com.microsoft.rest.RestClient;
import com.microsoft.rest.credentials.TokenCredentials;
import org.junit.BeforeClass;
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java
index 7de8a61cf0..4a992705b3 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java
@@ -1,7 +1,7 @@
package fixtures.azurespecials;
-import com.microsoft.azure.RequestIdHeaderInterceptor;
-import com.microsoft.azure.RestClient;
+import com.microsoft.rest.interceptors.RequestIdHeaderInterceptor;
+import com.microsoft.rest.RestClient;
import com.microsoft.rest.credentials.TokenCredentials;
import org.junit.Assert;
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/head/HttpSuccessTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/head/HttpSuccessTests.java
index 61c328c262..b545d5bf45 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/head/HttpSuccessTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/head/HttpSuccessTests.java
@@ -1,5 +1,6 @@
package fixtures.head;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -11,7 +12,7 @@ public class HttpSuccessTests {
@BeforeClass
public static void setup() {
- client = new AutoRestHeadTestServiceImpl("http://localhost.:3000", null);
+ client = new AutoRestHeadTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/headexceptions/HeadExceptionTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/headexceptions/HeadExceptionTests.java
index 612a30a0e1..f1b635888c 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/headexceptions/HeadExceptionTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/headexceptions/HeadExceptionTests.java
@@ -1,17 +1,17 @@
package fixtures.headexceptions;
-import com.microsoft.rest.ServiceException;
+import com.microsoft.rest.RestException;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
+import fixtures.headexceptions.implementation.AutoRestHeadExceptionTestServiceImpl;
import org.junit.BeforeClass;
import org.junit.Test;
-import fixtures.headexceptions.implementation.AutoRestHeadExceptionTestServiceImpl;
-
public class HeadExceptionTests {
private static AutoRestHeadExceptionTestServiceImpl client;
@BeforeClass
public static void setup() {
- client = new AutoRestHeadExceptionTestServiceImpl("http://localhost.:3000", null);
+ client = new AutoRestHeadExceptionTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
@@ -24,7 +24,7 @@ public void headException204() throws Exception {
client.headExceptions().head204();
}
- @Test(expected = ServiceException.class)
+ @Test(expected = RestException.class)
public void headException404() throws Exception {
client.headExceptions().head404();
}
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LRORetrysTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LRORetrysTests.java
index 4fb602d603..f71202b055 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LRORetrysTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LRORetrysTests.java
@@ -1,5 +1,6 @@
package fixtures.lro;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -13,7 +14,7 @@ public class LRORetrysTests {
@BeforeClass
public static void setup() {
- client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost.:3000", null);
+ client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
client.getAzureClient().withLongRunningOperationRetryTimeout(0);
}
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROSADsTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROSADsTests.java
index 71b8473eb5..b42024e0d4 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROSADsTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROSADsTests.java
@@ -1,14 +1,13 @@
package fixtures.lro;
import com.microsoft.azure.CloudException;
-
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
+import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl;
+import fixtures.lro.implementation.ProductInner;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
-import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl;
-import fixtures.lro.implementation.ProductInner;
-
import static org.junit.Assert.fail;
public class LROSADsTests {
@@ -16,7 +15,7 @@ public class LROSADsTests {
@BeforeClass
public static void setup() {
- client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost.:3000", null);
+ client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
client.getAzureClient().withLongRunningOperationRetryTimeout(0);
}
@@ -28,7 +27,7 @@ public void putNonRetry400() throws Exception {
client.lROSADs().putNonRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -40,7 +39,7 @@ public void putNonRetry201Creating400() throws Exception {
client.lROSADs().putNonRetry201Creating400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -52,7 +51,7 @@ public void putAsyncRelativeRetry400() throws Exception {
client.lROSADs().putAsyncRelativeRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -62,7 +61,7 @@ public void deleteNonRetry400() throws Exception {
client.lROSADs().deleteNonRetry400();
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -72,7 +71,7 @@ public void delete202NonRetry400() throws Exception {
client.lROSADs().delete202NonRetry400();
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -82,7 +81,7 @@ public void deleteAsyncRelativeRetry400() throws Exception {
client.lROSADs().deleteAsyncRelativeRetry400();
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -94,7 +93,7 @@ public void postNonRetry400() throws Exception {
client.lROSADs().postNonRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -106,7 +105,7 @@ public void post202NonRetry400() throws Exception {
client.lROSADs().post202NonRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -118,7 +117,7 @@ public void postAsyncRelativeRetry400() throws Exception {
client.lROSADs().postAsyncRelativeRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -130,7 +129,7 @@ public void putError201NoProvisioningStatePayload() throws Exception {
client.lROSADs().putError201NoProvisioningStatePayload(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
@@ -143,7 +142,7 @@ public void putAsyncRelativeRetryNoStatus() throws Exception {
client.lROSADs().putAsyncRelativeRetryNoStatus(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
@@ -156,7 +155,7 @@ public void putAsyncRelativeRetryNoStatusPayload() throws Exception {
client.lROSADs().putAsyncRelativeRetryNoStatusPayload(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
@@ -172,7 +171,7 @@ public void deleteAsyncRelativeRetryNoStatus() throws Exception {
client.lROSADs().deleteAsyncRelativeRetryNoStatus();
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
@@ -185,7 +184,7 @@ public void post202NoLocation() throws Exception {
client.lROSADs().post202NoLocation(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(202, ex.getResponse().code());
+ Assert.assertEquals(202, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("Response does not contain an Azure"));
}
}
@@ -198,7 +197,7 @@ public void postAsyncRelativeRetryNoPayload() throws Exception {
client.lROSADs().postAsyncRelativeRetryNoPayload(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROsCustomHeaderTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROsCustomHeaderTests.java
index 406917d76e..cf13f65d08 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROsCustomHeaderTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROsCustomHeaderTests.java
@@ -1,5 +1,6 @@
package fixtures.lro;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -13,7 +14,7 @@ public class LROsCustomHeaderTests {
@BeforeClass
public static void setup() {
- client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", null);
+ client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
client.restClient().headers().addHeader("x-ms-client-request-id", "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0");
client.getAzureClient().withLongRunningOperationRetryTimeout(0);
}
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROsTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROsTests.java
index f05b72010d..415eb3f577 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROsTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/lro/LROsTests.java
@@ -1,25 +1,22 @@
package fixtures.lro;
import com.microsoft.azure.CloudException;
-import com.microsoft.azure.RestClient;
+import com.microsoft.rest.RestClient;
import com.microsoft.rest.ServiceCallback;
-
+import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl;
+import fixtures.lro.implementation.ProductInner;
+import fixtures.lro.implementation.SkuInner;
+import fixtures.lro.implementation.SubProductInner;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
+import rx.Observable;
+import rx.Subscriber;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl;
-import fixtures.lro.implementation.ProductInner;
-import fixtures.lro.implementation.SkuInner;
-import fixtures.lro.implementation.SubProductInner;
-import okhttp3.logging.HttpLoggingInterceptor;
-import rx.Observable;
-import rx.Subscriber;
-
import static org.junit.Assert.fail;
public class LROsTests {
@@ -29,7 +26,6 @@ public class LROsTests {
public static void setup() {
RestClient restClient = new RestClient.Builder()
.withBaseUrl("http://localhost:3000")
- .withLogLevel(HttpLoggingInterceptor.Level.NONE)
.build();
client = new AutoRestLongRunningOperationTestServiceImpl(restClient);
client.getAzureClient().withLongRunningOperationRetryTimeout(0);
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/paging/PagingTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/paging/PagingTests.java
index 8c8df001b2..9842755eb8 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/paging/PagingTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/paging/PagingTests.java
@@ -2,7 +2,10 @@
import com.microsoft.azure.CloudException;
import com.microsoft.azure.ListOperationCallback;
-
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
+import fixtures.paging.implementation.AutoRestPagingTestServiceImpl;
+import fixtures.paging.implementation.PagingGetMultiplePagesWithOffsetOptionsInner;
+import fixtures.paging.implementation.ProductInner;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -11,10 +14,6 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import fixtures.paging.implementation.AutoRestPagingTestServiceImpl;
-import fixtures.paging.implementation.PagingGetMultiplePagesWithOffsetOptionsInner;
-import fixtures.paging.implementation.ProductInner;
-
import static org.junit.Assert.fail;
public class PagingTests {
@@ -22,7 +21,7 @@ public class PagingTests {
@BeforeClass
public static void setup() {
- client = new AutoRestPagingTestServiceImpl("http://localhost:3000", null);
+ client = new AutoRestPagingTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
@@ -106,7 +105,7 @@ public void getSinglePagesFailure() throws Exception {
List response = client.pagings().getSinglePagesFailure();
fail();
} catch (CloudException ex) {
- Assert.assertNotNull(ex.getResponse());
+ Assert.assertNotNull(ex.response());
}
}
@@ -117,18 +116,13 @@ public void getMultiplePagesFailure() throws Exception {
response.size();
fail();
} catch (CloudException ex) {
- Assert.assertNotNull(ex.getResponse());
+ Assert.assertNotNull(ex.response());
}
}
@Test
public void getMultiplePagesFailureUri() throws Exception {
- try {
- List response = client.pagings().getMultiplePagesFailureUri();
- response.size();
- fail();
- } catch (CloudException ex) {
- Assert.assertNotNull(ex.getResponse());
- }
+ List response = client.pagings().getMultiplePagesFailureUri();
+ Assert.assertEquals(1, response.size());
}
}
diff --git a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java
index f2454bba6a..50279a2229 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java
+++ b/src/generator/AutoRest.Java.Azure.Fluent.Tests/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java
@@ -1,5 +1,6 @@
package fixtures.subscriptionidapiversion;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -14,7 +15,7 @@ public class GroupTests {
@BeforeClass
public static void setup() {
- client = new MicrosoftAzureTestUrlImpl("http://localhost.:3000", null);
+ client = new MicrosoftAzureTestUrlImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure.Fluent/CodeGeneratorJvaf.cs b/src/generator/AutoRest.Java.Azure.Fluent/CodeGeneratorJvaf.cs
index 4bcb94b218..d8eddfce36 100644
--- a/src/generator/AutoRest.Java.Azure.Fluent/CodeGeneratorJvaf.cs
+++ b/src/generator/AutoRest.Java.Azure.Fluent/CodeGeneratorJvaf.cs
@@ -21,7 +21,7 @@ namespace AutoRest.Java.Azure.Fluent
{
public class CodeGeneratorJvaf : CodeGeneratorJva
{
- private const string ClientRuntimePackage = "com.microsoft.azure:azure-client-runtime:1.0.0-beta5-SNAPSHOT";
+ private const string ClientRuntimePackage = "com.microsoft.azure:azure-client-runtime:1.0.0-beta6-SNAPSHOT";
private const string _packageInfoFileName = "package-info.java";
public override bool IsSingleFileGenerationSupported => true;
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java
index 820955ff80..ace3881305 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java
@@ -1,5 +1,6 @@
package fixtures.azureparametergrouping;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -14,7 +15,7 @@ public class ParameterGroupingTests {
@BeforeClass
public static void setup() {
- client = new AutoRestParameterGroupingTestServiceImpl("http://localhost:3000", null);
+ client = new AutoRestParameterGroupingTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurereport/CoverageReporter.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurereport/CoverageReporter.java
index 83f3cd1fb0..495bdde955 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurereport/CoverageReporter.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurereport/CoverageReporter.java
@@ -4,10 +4,11 @@
import java.util.List;
import java.util.Map;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import fixtures.azurereport.implementation.AutoRestReportServiceForAzureImpl;
public final class CoverageReporter {
- private static AutoRestReportServiceForAzureImpl client = new AutoRestReportServiceForAzureImpl("http://localhost:3000", null);
+ private static AutoRestReportServiceForAzureImpl client = new AutoRestReportServiceForAzureImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
private CoverageReporter() { }
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java
index 6c98d674e1..4814fdc5e6 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java
@@ -1,6 +1,7 @@
package fixtures.azurespecials;
import com.microsoft.rest.ServiceResponse;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -12,30 +13,30 @@ public class ApiVersionDefaultTests {
@BeforeClass
public static void setup() {
- client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", null);
+ client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
public void getMethodGlobalValid() throws Exception {
ServiceResponse response = client.apiVersionDefaults().getMethodGlobalValidWithServiceResponseAsync().toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
@Test
public void getMethodGlobalNotProvidedValid() throws Exception {
ServiceResponse response = client.apiVersionDefaults().getMethodGlobalNotProvidedValidWithServiceResponseAsync().toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
@Test
public void getPathGlobalValid() throws Exception {
ServiceResponse response = client.apiVersionDefaults().getPathGlobalValidWithServiceResponseAsync().toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
@Test
public void getSwaggerGlobalValid() throws Exception {
ServiceResponse response = client.apiVersionDefaults().getSwaggerGlobalValidWithServiceResponseAsync().toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
}
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java
index 98df057fc0..28588b563b 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java
@@ -1,6 +1,7 @@
package fixtures.azurespecials;
import com.microsoft.rest.ServiceResponse;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -12,30 +13,30 @@ public class ApiVersionLocalTests {
@BeforeClass
public static void setup() {
- client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", null);
+ client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
public void getMethodLocalValid() throws Exception {
ServiceResponse response = client.apiVersionLocals().getMethodLocalValidWithServiceResponseAsync().toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
@Test
public void getMethodGlobalNotProvidedValid() throws Exception {
ServiceResponse response = client.apiVersionLocals().getMethodLocalNullWithServiceResponseAsync().toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
@Test
public void getPathGlobalValid() throws Exception {
ServiceResponse response = client.apiVersionLocals().getPathLocalValidWithServiceResponseAsync().toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
@Test
public void getSwaggerGlobalValid() throws Exception {
ServiceResponse response = client.apiVersionLocals().getSwaggerLocalValidWithServiceResponseAsync().toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
}
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java
index 8588441ef2..9ad6db9e52 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java
@@ -2,6 +2,7 @@
import com.microsoft.rest.ServiceResponseWithHeaders;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl;
import fixtures.azurespecials.models.HeaderCustomNamedRequestIdHeaders;
import fixtures.azurespecials.models.HeaderCustomNamedRequestIdParamGroupingHeaders;
@@ -15,14 +16,14 @@ public class HeaderOperationsTests {
@BeforeClass
public static void setup() {
- client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", null);
+ client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
public void customNamedRequestId() throws Exception {
ServiceResponseWithHeaders response = client.headers().customNamedRequestIdWithServiceResponseAsync("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0").toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
- Assert.assertEquals("123", response.getHeaders().fooRequestId());
+ Assert.assertEquals(200, response.response().code());
+ Assert.assertEquals("123", response.headers().fooRequestId());
}
@Test
@@ -30,7 +31,7 @@ public void customNamedRequestIdParamGrouping() throws Exception {
HeaderCustomNamedRequestIdParamGroupingParameters group = new HeaderCustomNamedRequestIdParamGroupingParameters();
group.withFooClientRequestId("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0");
ServiceResponseWithHeaders response = client.headers().customNamedRequestIdParamGroupingWithServiceResponseAsync(group).toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
- Assert.assertEquals("123", response.getHeaders().fooRequestId());
+ Assert.assertEquals(200, response.response().code());
+ Assert.assertEquals("123", response.headers().fooRequestId());
}
}
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java
index b3556cd34c..c689e4b14a 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java
@@ -1,5 +1,6 @@
package fixtures.azurespecials;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
@@ -15,7 +16,7 @@ public class SkipUrlEncodingTests {
@BeforeClass
public static void setup() {
- client = new AutoRestAzureSpecialParametersTestClientImpl(baseUrl, null).skipUrlEncodings();
+ client = new AutoRestAzureSpecialParametersTestClientImpl(baseUrl, new BasicAuthenticationCredentials(null, null)).skipUrlEncodings();
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java
index 49f4c69989..5261a1fff6 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java
@@ -1,7 +1,7 @@
package fixtures.azurespecials;
-import com.microsoft.azure.RequestIdHeaderInterceptor;
-import com.microsoft.azure.RestClient;
+import com.microsoft.rest.interceptors.RequestIdHeaderInterceptor;
+import com.microsoft.rest.RestClient;
import com.microsoft.rest.credentials.TokenCredentials;
import org.junit.BeforeClass;
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java
index 7de8a61cf0..4a992705b3 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java
@@ -1,7 +1,7 @@
package fixtures.azurespecials;
-import com.microsoft.azure.RequestIdHeaderInterceptor;
-import com.microsoft.azure.RestClient;
+import com.microsoft.rest.interceptors.RequestIdHeaderInterceptor;
+import com.microsoft.rest.RestClient;
import com.microsoft.rest.credentials.TokenCredentials;
import org.junit.Assert;
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java
index aedaca543b..662775eb4d 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java
@@ -2,15 +2,13 @@
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.credentials.TokenCredentials;
-
+import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.UUID;
-import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl;
-
public class XMsClientRequestIdTests {
private static AutoRestAzureSpecialParametersTestClientImpl client;
@@ -26,13 +24,13 @@ public void get() throws Exception {
client.restClient().headers().addHeader("x-ms-client-request-id", "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0");
ServiceResponse response = client.xMsClientRequestIds().getWithServiceResponseAsync().toBlocking().last();
client.restClient().headers().removeHeader("x-ms-client-request-id");
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
@Test
public void paramGet() throws Exception {
client.restClient().headers().removeHeader("x-ms-client-request-id");
ServiceResponse response = client.xMsClientRequestIds().paramGetWithServiceResponseAsync("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0").toBlocking().last();
- Assert.assertEquals(200, response.getResponse().code());
+ Assert.assertEquals(200, response.response().code());
}
}
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/head/HttpSuccessTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/head/HttpSuccessTests.java
index 5417c88df1..c83b219c4f 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/head/HttpSuccessTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/head/HttpSuccessTests.java
@@ -1,5 +1,7 @@
package fixtures.head;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
+import okhttp3.logging.HttpLoggingInterceptor;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -10,8 +12,8 @@ public class HttpSuccessTests {
private static AutoRestHeadTestServiceImpl client;
@BeforeClass
- public static void setup() {
- client = new AutoRestHeadTestServiceImpl("http://localhost:3000", null);
+ public static void setup() throws Exception {
+ client = new AutoRestHeadTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/headexceptions/HeadExceptionTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/headexceptions/HeadExceptionTests.java
index 6e6e741c2d..d67dfe0d09 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/headexceptions/HeadExceptionTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/headexceptions/HeadExceptionTests.java
@@ -1,6 +1,7 @@
package fixtures.headexceptions;
-import com.microsoft.rest.ServiceException;
+import com.microsoft.rest.RestException;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -11,7 +12,7 @@ public class HeadExceptionTests {
@BeforeClass
public static void setup() {
- client = new AutoRestHeadExceptionTestServiceImpl("http://localhost:3000", null);
+ client = new AutoRestHeadExceptionTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
@@ -24,7 +25,7 @@ public void headException204() throws Exception {
client.headExceptions().head204();
}
- @Test(expected = ServiceException.class)
+ @Test(expected = RestException.class)
public void headException404() throws Exception {
client.headExceptions().head404();
}
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LRORetrysTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LRORetrysTests.java
index b0ed99e72b..4fb80bb4aa 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LRORetrysTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LRORetrysTests.java
@@ -1,15 +1,12 @@
package fixtures.lro;
-import com.microsoft.azure.RestClient;
-
+import com.microsoft.rest.RestClient;
+import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl;
+import fixtures.lro.models.Product;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
-import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl;
-import fixtures.lro.models.Product;
-import okhttp3.logging.HttpLoggingInterceptor;
-
public class LRORetrysTests {
private static AutoRestLongRunningOperationTestServiceImpl client;
@@ -17,7 +14,6 @@ public class LRORetrysTests {
public static void setup() {
RestClient restClient = new RestClient.Builder()
.withBaseUrl("http://localhost:3000")
- .withLogLevel(HttpLoggingInterceptor.Level.NONE)
.build();
client = new AutoRestLongRunningOperationTestServiceImpl(restClient);
client.getAzureClient().withLongRunningOperationRetryTimeout(0);
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROSADsTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROSADsTests.java
index 29c1aa5026..202823bf49 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROSADsTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROSADsTests.java
@@ -2,6 +2,7 @@
import com.microsoft.azure.CloudException;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -16,7 +17,7 @@ public class LROSADsTests {
@BeforeClass
public static void setup() {
- client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", null);
+ client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
client.getAzureClient().withLongRunningOperationRetryTimeout(0);
}
@@ -28,7 +29,7 @@ public void putNonRetry400() throws Exception {
client.lROSADs().putNonRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -40,7 +41,7 @@ public void putNonRetry201Creating400() throws Exception {
client.lROSADs().putNonRetry201Creating400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -52,7 +53,7 @@ public void putAsyncRelativeRetry400() throws Exception {
client.lROSADs().putAsyncRelativeRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -62,7 +63,7 @@ public void deleteNonRetry400() throws Exception {
client.lROSADs().deleteNonRetry400();
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -72,7 +73,7 @@ public void delete202NonRetry400() throws Exception {
client.lROSADs().delete202NonRetry400();
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -82,7 +83,7 @@ public void deleteAsyncRelativeRetry400() throws Exception {
client.lROSADs().deleteAsyncRelativeRetry400();
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -94,7 +95,7 @@ public void postNonRetry400() throws Exception {
client.lROSADs().postNonRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -106,7 +107,7 @@ public void post202NonRetry400() throws Exception {
client.lROSADs().post202NonRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -118,7 +119,7 @@ public void postAsyncRelativeRetry400() throws Exception {
client.lROSADs().postAsyncRelativeRetry400(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(400, ex.getResponse().code());
+ Assert.assertEquals(400, ex.response().code());
}
}
@@ -130,7 +131,7 @@ public void putError201NoProvisioningStatePayload() throws Exception {
client.lROSADs().putError201NoProvisioningStatePayload(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
@@ -143,7 +144,7 @@ public void putAsyncRelativeRetryNoStatus() throws Exception {
client.lROSADs().putAsyncRelativeRetryNoStatus(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
@@ -156,7 +157,7 @@ public void putAsyncRelativeRetryNoStatusPayload() throws Exception {
client.lROSADs().putAsyncRelativeRetryNoStatusPayload(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
@@ -172,7 +173,7 @@ public void deleteAsyncRelativeRetryNoStatus() throws Exception {
client.lROSADs().deleteAsyncRelativeRetryNoStatus();
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
@@ -185,7 +186,7 @@ public void post202NoLocation() throws Exception {
client.lROSADs().post202NoLocation(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(202, ex.getResponse().code());
+ Assert.assertEquals(202, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("Response does not contain an Azure"));
}
}
@@ -198,7 +199,7 @@ public void postAsyncRelativeRetryNoPayload() throws Exception {
client.lROSADs().postAsyncRelativeRetryNoPayload(product);
fail();
} catch (CloudException ex) {
- Assert.assertEquals(200, ex.getResponse().code());
+ Assert.assertEquals(200, ex.response().code());
Assert.assertTrue(ex.getMessage().contains("does not contain a valid body"));
}
}
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROsCustomHeaderTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROsCustomHeaderTests.java
index 1d32c7b4ec..29ba83b78a 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROsCustomHeaderTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROsCustomHeaderTests.java
@@ -2,6 +2,7 @@
import com.microsoft.azure.CustomHeaderInterceptor;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -19,7 +20,7 @@ public class LROsCustomHeaderTests {
@BeforeClass
public static void setup() {
- client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", null);
+ client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
client.restClient().headers().addHeader("x-ms-client-request-id", "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0");
client.getAzureClient().withLongRunningOperationRetryTimeout(0);
}
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROsTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROsTests.java
index b177d3593d..ada6d1d2dd 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROsTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/lro/LROsTests.java
@@ -1,9 +1,13 @@
package fixtures.lro;
import com.microsoft.azure.CloudException;
-import com.microsoft.azure.RestClient;
+import com.microsoft.rest.LogLevel;
+import com.microsoft.rest.RestClient;
import com.microsoft.rest.ServiceCallback;
-
+import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl;
+import fixtures.lro.models.Product;
+import fixtures.lro.models.Sku;
+import fixtures.lro.models.SubProduct;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
@@ -12,12 +16,6 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl;
-import fixtures.lro.models.Product;
-import fixtures.lro.models.Sku;
-import fixtures.lro.models.SubProduct;
-import okhttp3.logging.HttpLoggingInterceptor;
-
import static org.junit.Assert.fail;
public class LROsTests {
@@ -26,9 +24,9 @@ public class LROsTests {
@BeforeClass
public static void setup() {
RestClient restClient = new RestClient.Builder()
- .withBaseUrl("http://localhost:3000")
- .withLogLevel(HttpLoggingInterceptor.Level.NONE)
- .build();
+ .withBaseUrl("http://localhost:3000")
+ .withLogLevel(LogLevel.BODY_AND_HEADERS)
+ .build();
client = new AutoRestLongRunningOperationTestServiceImpl(restClient);
client.getAzureClient().withLongRunningOperationRetryTimeout(0);
}
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/paging/PagingTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/paging/PagingTests.java
index d9bae3d9e3..0758311923 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/paging/PagingTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/paging/PagingTests.java
@@ -1,8 +1,19 @@
package fixtures.paging;
+import com.microsoft.azure.AzureResponseBuilder;
import com.microsoft.azure.CloudException;
import com.microsoft.azure.ListOperationCallback;
-
+import com.microsoft.azure.serializer.AzureJacksonAdapter;
+import com.microsoft.rest.LogLevel;
+import com.microsoft.rest.RestClient;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
+import com.microsoft.rest.interceptors.LoggingInterceptor;
+import fixtures.paging.implementation.AutoRestPagingTestServiceImpl;
+import fixtures.paging.models.CustomParameterGroup;
+import fixtures.paging.models.PagingGetMultiplePagesWithOffsetOptions;
+import fixtures.paging.models.Product;
+import fixtures.paging.models.ProductProperties;
+import okhttp3.logging.HttpLoggingInterceptor;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -11,11 +22,6 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import fixtures.paging.implementation.AutoRestPagingTestServiceImpl;
-import fixtures.paging.models.PagingGetMultiplePagesWithOffsetOptions;
-import fixtures.paging.models.Product;
-import fixtures.paging.models.ProductProperties;
-
import static org.junit.Assert.fail;
public class PagingTests {
@@ -23,7 +29,13 @@ public class PagingTests {
@BeforeClass
public static void setup() {
- client = new AutoRestPagingTestServiceImpl("http://localhost:3000", null);
+ RestClient restClient = new RestClient.Builder()
+ .withBaseUrl("http://localhost:3000")
+ .withInterceptor(new LoggingInterceptor(LogLevel.BODY_AND_HEADERS))
+ .withSerializerAdapter(new AzureJacksonAdapter())
+ .withResponseBuilderFactory(new AzureResponseBuilder.Factory())
+ .build();
+ client = new AutoRestPagingTestServiceImpl(restClient);;
}
@Test
@@ -112,7 +124,7 @@ public void getSinglePagesFailure() throws Exception {
List response = client.pagings().getSinglePagesFailure();
fail();
} catch (CloudException ex) {
- Assert.assertNotNull(ex.getResponse());
+ Assert.assertNotNull(ex.response());
}
}
@@ -123,18 +135,25 @@ public void getMultiplePagesFailure() throws Exception {
response.size();
fail();
} catch (CloudException ex) {
- Assert.assertNotNull(ex.getResponse());
+ Assert.assertNotNull(ex.response());
}
}
@Test
public void getMultiplePagesFailureUri() throws Exception {
- try {
- List response = client.pagings().getMultiplePagesFailureUri();
- response.size();
- fail();
- } catch (CloudException ex) {
- Assert.assertNotNull(ex.getResponse());
- }
+ List response = client.pagings().getMultiplePagesFailureUri();
+ Assert.assertEquals(1, response.size());
+ }
+
+ @Test
+ public void getMultiplePagesFragmentNextLink() throws Exception {
+ List response = client.pagings().getMultiplePagesFragmentNextLink("test_user", "1.6");
+ Assert.assertEquals(10, response.size());
+ }
+
+ @Test
+ public void getMultiplePagesFragmentWithGroupingNextLink() throws Exception {
+ List response = client.pagings().getMultiplePagesFragmentWithGroupingNextLink(new CustomParameterGroup().withTenant("test_user").withApiVersion("1.6"));
+ Assert.assertEquals(10, response.size());
}
}
diff --git a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java
index 9725da9aa0..059119abed 100644
--- a/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java
+++ b/src/generator/AutoRest.Java.Azure.Tests/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java
@@ -1,5 +1,6 @@
package fixtures.subscriptionidapiversion;
+import com.microsoft.rest.credentials.BasicAuthenticationCredentials;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -14,7 +15,7 @@ public class GroupTests {
@BeforeClass
public static void setup() {
- client = new MicrosoftAzureTestUrlImpl("http://localhost:3000", null);
+ client = new MicrosoftAzureTestUrlImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null));
}
@Test
diff --git a/src/generator/AutoRest.Java.Azure/CodeGeneratorJva.cs b/src/generator/AutoRest.Java.Azure/CodeGeneratorJva.cs
index 7c0ca07b74..436075fd6f 100644
--- a/src/generator/AutoRest.Java.Azure/CodeGeneratorJva.cs
+++ b/src/generator/AutoRest.Java.Azure/CodeGeneratorJva.cs
@@ -21,7 +21,7 @@ namespace AutoRest.Java.Azure
{
public class CodeGeneratorJva : CodeGeneratorJv
{
- private const string ClientRuntimePackage = "com.microsoft.azure:azure-client-runtime:1.0.0-beta5-SNAPSHOT from snapshot repo https://oss.sonatype.org/content/repositories/snapshots/";
+ private const string ClientRuntimePackage = "com.microsoft.azure:azure-client-runtime:1.0.0-beta6-SNAPSHOT from snapshot repo https://oss.sonatype.org/content/repositories/snapshots/";
private const string _packageInfoFileName = "package-info.java";
public override bool IsSingleFileGenerationSupported => true;
diff --git a/src/generator/AutoRest.Java.Tests/src/test/java/fixtures/bodyarray/ArrayTests.java b/src/generator/AutoRest.Java.Tests/src/test/java/fixtures/bodyarray/ArrayTests.java
index 06d47daaff..b5215fa450 100644
--- a/src/generator/AutoRest.Java.Tests/src/test/java/fixtures/bodyarray/ArrayTests.java
+++ b/src/generator/AutoRest.Java.Tests/src/test/java/fixtures/bodyarray/ArrayTests.java
@@ -1,591 +1,591 @@
-package fixtures.bodyarray;
-
-import org.joda.time.DateTime;
-import org.joda.time.DateTimeZone;
-import org.joda.time.LocalDate;
-import org.joda.time.Period;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import fixtures.bodyarray.implementation.AutoRestSwaggerBATArrayServiceImpl;
-import fixtures.bodyarray.models.ErrorException;
-import fixtures.bodyarray.models.Product;
-
-public class ArrayTests {
- private static AutoRestSwaggerBATArrayService client;
-
- @BeforeClass
- public static void setup() {
- client = new AutoRestSwaggerBATArrayServiceImpl("http://localhost:3000");
- }
-
- @Test
- public void getNull() throws Exception {
- Assert.assertNull(client.arrays().getNull());
- }
-
- @Test
- public void getInvalid() throws Exception {
- try {
- List result = client.arrays().getInvalid();
- Assert.assertTrue(false);
- } catch (RuntimeException exception) {
- // expected
- Assert.assertTrue(exception.getMessage().contains("Unexpected end-of-input"));
- }
- }
-
- @Test
- public void getEmpty() throws Exception {
- List result = client.arrays().getEmpty();
- Assert.assertEquals(0, result.size());
- }
-
- @Test
- public void putEmpty() throws Exception {
- client.arrays().putEmpty(new ArrayList());
- }
-
- @Test
- public void getBooleanTfft() throws Exception {
- List result = client.arrays().getBooleanTfft();
- Object[] exected = new Boolean[] {true, false, false, true};
- Assert.assertArrayEquals(exected, result.toArray());
- }
-
- @Test
- public void putBooleanTfft() throws Exception {
- client.arrays().putBooleanTfft(Arrays.asList(true, false, false, true));
- }
-
- @Test
- public void getBooleanInvalidNull() throws Exception {
- try {
- List result = client.arrays().getBooleanInvalidNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getBooleanInvalidString() throws Exception {
- try {
- List result = client.arrays().getBooleanInvalidString();
- } catch (RuntimeException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("only \"true\" or \"false\" recognized"));
- }
- }
-
- @Test
- public void getIntegerValid() throws Exception {
- List result = client.arrays().getIntegerValid();
- Object[] expected = new Integer[] {1, -1, 3, 300};
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putIntegerValid() throws Exception {
- client.arrays().putIntegerValid(Arrays.asList(1, -1, 3, 300));
- }
-
- @Test
- public void getIntInvalidNull() throws Exception {
- try {
- List result = client.arrays().getIntInvalidNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getIntInvalidString() throws Exception {
- try {
- List result = client.arrays().getIntInvalidString();
- } catch (RuntimeException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("not a valid Integer value"));
- }
- }
-
- @Test
- public void getLongValid() throws Exception {
- List result = client.arrays().getLongValid();
- Object[] expected = new Long[] {1L, -1L, 3L, 300L};
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putLongValid() throws Exception {
- client.arrays().putLongValid(Arrays.asList(1L, -1L, 3L, 300L));
- }
-
- @Test
- public void getLongInvalidNull() throws Exception {
- try {
- List result = client.arrays().getLongInvalidNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getLongInvalidString() throws Exception {
- try {
- List result = client.arrays().getLongInvalidString();
- } catch (RuntimeException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("not a valid Long value"));
- }
- }
-
- @Test
- public void getFloatValid() throws Exception {
- List result = client.arrays().getFloatValid();
- Object[] expected = new Double[] {0d, -0.01, -1.2e20};
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putFloatValid() throws Exception {
- client.arrays().putFloatValid(Arrays.asList(0d, -0.01d, -1.2e20d));
- }
-
- @Test
- public void getFloatInvalidNull() throws Exception {
- try {
- List result = client.arrays().getFloatInvalidNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getFloatInvalidString() throws Exception {
- try {
- List result = client.arrays().getFloatInvalidString();
- } catch (RuntimeException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("not a valid Double value"));
- }
- }
-
- @Test
- public void getDoubleValid() throws Exception {
- List result = client.arrays().getDoubleValid();
- Object[] expected = new Double[] {0d, -0.01, -1.2e20};
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putDoubleValid() throws Exception {
- client.arrays().putDoubleValid(Arrays.asList(0d, -0.01d, -1.2e20d));
- }
-
- @Test
- public void getDoubleInvalidNull() throws Exception {
- try {
- List result = client.arrays().getDoubleInvalidNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getDoubleInvalidString() throws Exception {
- try {
- List result = client.arrays().getDoubleInvalidString();
- } catch (RuntimeException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("not a valid Double value"));
- }
- }
-
- @Test
- public void getStringValid() throws Exception {
- List result = client.arrays().getStringValid();
- Object[] expected = new String[] {"foo1", "foo2", "foo3"};
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putStringValid() throws Exception {
- client.arrays().putStringValid(Arrays.asList("foo1", "foo2", "foo3"));
- }
-
- @Test
- public void getStringWithNull() throws Exception {
- try {
- List result = client.arrays().getStringWithNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getStringWithInvalid() throws Exception {
- try {
- List result = client.arrays().getStringWithInvalid();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("InvalidFormatException"));
- }
- }
-
- @Test
- public void getUuidValid() throws Exception {
- List result = client.arrays().getUuidValid();
- Object[] expected = new UUID[] {UUID.fromString("6dcc7237-45fe-45c4-8a6b-3a8a3f625652"),
- UUID.fromString("d1399005-30f7-40d6-8da6-dd7c89ad34db"),
- UUID.fromString("f42f6aa1-a5bc-4ddf-907e-5f915de43205")};
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putUuidValid() throws Exception {
- client.arrays().putUuidValid(Arrays.asList(UUID.fromString("6dcc7237-45fe-45c4-8a6b-3a8a3f625652"),
- UUID.fromString("d1399005-30f7-40d6-8da6-dd7c89ad34db"), UUID.fromString("f42f6aa1-a5bc-4ddf-907e-5f915de43205")));
- }
-
- @Test
- public void getUuidInvalidChars() throws Exception {
- try {
- List result = client.arrays().getUuidInvalidChars();
- Assert.fail();
- } catch (RuntimeException ex) {
- // expected
- Assert.assertTrue(ex.getMessage(), ex.getMessage().contains("UUID has to be represented"));
- }
- }
- @Test
- public void getDateValid() throws Exception {
- List result = client.arrays().getDateValid();
- Object[] expected = new LocalDate[] {
- new LocalDate(2000, 12, 1),
- new LocalDate(1980, 1, 2),
- new LocalDate(1492, 10, 12)
- };
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putDateValid() throws Exception {
- client.arrays().putDateValid(Arrays.asList(
- new LocalDate(2000, 12, 1),
- new LocalDate(1980, 1, 2),
- new LocalDate(1492, 10, 12)
- ));
- }
-
- @Test
- public void getDateInvalidNull() throws Exception {
- try {
- List result = client.arrays().getDateInvalidNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getDateInvalidString() throws Exception {
- try {
- List result = client.arrays().getDateInvalidChars();
- } catch (RuntimeException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date\""));
- }
- }
-
- @Test
- public void getDateTimeValid() throws Exception {
- List result = client.arrays().getDateTimeValid();
- Object[] expected = new DateTime[] {
- new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC),
- new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC),
- new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC)
- };
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putDateTimeValid() throws Exception {
- client.arrays().putDateTimeValid(Arrays.asList(
- new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC),
- new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC),
- new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC)
- ));
- }
-
- @Test
- public void getDateTimeInvalidNull() throws Exception {
- try {
- List result = client.arrays().getDateTimeInvalidNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getDateTimeInvalidString() throws Exception {
- try {
- List result = client.arrays().getDateTimeInvalidChars();
- } catch (RuntimeException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date-time\""));
- }
- }
-
- @Test
- public void getDateTimeRfc1123Valid() throws Exception {
- List result = client.arrays().getDateTimeRfc1123Valid();
- Object[] expected = new DateTime[] {
- new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC),
- new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC),
- new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC)
- };
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putDateTimeRfc1123Valid() throws Exception {
- client.arrays().putDateTimeRfc1123Valid(Arrays.asList(
- new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC),
- new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC),
- new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC)
- ));
- }
-
- @Test
- public void getDurationValid() throws Exception {
- List result = client.arrays().getDurationValid();
- Object[] expected = new Period[] {
- new Period(0, 0, 0, 123, 22, 14, 12, 11),
- new Period(0, 0, 0, 5, 1, 0, 0, 0)
- };
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putDurationValid() throws Exception {
- client.arrays().putDurationValid(Arrays.asList(
- new Period(0, 0, 0, 123, 22, 14, 12, 11),
- new Period(0, 0, 0, 5, 1, 0, 0, 0)));
- }
-
- @Test
- public void getByteValid() throws Exception {
- List result = client.arrays().getByteValid();
- Object[] expected = new byte[][] {
- new byte[] {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA},
- new byte[] {(byte) 0x01, (byte) 0x02, (byte) 0x03},
- new byte[] {(byte) 0x25, (byte) 0x29, (byte) 0x43}
- };
- Assert.assertArrayEquals(expected, result.toArray());
- }
-
- @Test
- public void putByteValid() throws Exception {
- client.arrays().putByteValid(Arrays.asList(
- new byte[] {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA},
- new byte[] {(byte) 0x01, (byte) 0x02, (byte) 0x03},
- new byte[] {(byte) 0x25, (byte) 0x29, (byte) 0x43}
- ));
- }
-
- @Test
- public void getByteInvalidNull() throws Exception {
- try {
- List result = client.arrays().getByteInvalidNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getBase64Url() throws Exception {
- List result = client.arrays().getBase64Url();
- Assert.assertEquals(3, result.size());
- Assert.assertEquals("a string that gets encoded with base64url", new String(result.get(0)));
- Assert.assertEquals("test string", new String(result.get(1)));
- Assert.assertEquals("Lorem ipsum", new String(result.get(2)));
- }
-
- @Test
- public void getComplexNull() throws Exception {
- try {
- List result = client.arrays().getComplexNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getComplexEmpty() throws Exception {
- List result = client.arrays().getComplexEmpty();
- Assert.assertEquals(0, result.size());
- }
-
- @Test
- public void getComplexItemNull() throws Exception {
- List result = client.arrays().getComplexItemNull();
- Assert.assertEquals(3, result.size());
- Assert.assertNull(result.get(1));
- }
-
- @Test
- public void getComplexItemEmpty() throws Exception {
- List result = client.arrays().getComplexItemEmpty();
- Assert.assertEquals(3, result.size());
- Assert.assertNull(result.get(1).stringProperty());
- }
-
- @Test
- public void getComplexValid() throws Exception {
- List result = client.arrays().getComplexValid();
- Assert.assertEquals(3, result.size());
- Assert.assertEquals(5, result.get(2).integer().intValue());
- Assert.assertEquals("6", result.get(2).stringProperty());
- }
-
- @Test
- public void putComplexValid() throws Exception {
- List body = new ArrayList();
- Product p1 = new Product();
- p1.withInteger(1);
- p1.withStringProperty("2");
- body.add(p1);
- Product p2 = new Product();
- p2.withInteger(3);
- p2.withStringProperty("4");
- body.add(p2);
- Product p3 = new Product();
- p3.withInteger(5);
- p3.withStringProperty("6");
- body.add(p3);
- client.arrays().putComplexValid(body);
- }
-
- @Test
- public void getArrayNull() throws Exception {
- try {
- List> result = client.arrays().getArrayNull();
- } catch (ErrorException ex) {
- // expected
- Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
- }
- }
-
- @Test
- public void getArrayEmpty() throws Exception {
- List> result = client.arrays().getArrayEmpty();
- Assert.assertEquals(0, result.size());
- }
-
- @Test
- public void getArrayItemNull() throws Exception {
- List> result = client.arrays().getArrayItemNull();
- Assert.assertEquals(3, result.size());
- Assert.assertNull(result.get(1));
- }
-
- @Test
- public void getArrayItemEmpty() throws Exception {
- List> result = client.arrays().getArrayItemEmpty();
- Assert.assertEquals(3, result.size());
- Assert.assertEquals(0, result.get(1).size());
- }
-
- @Test
- public void getArrayValid() throws Exception {
- List> result = client.arrays().getArrayValid();
- Assert.assertArrayEquals(new String[]{"1", "2", "3"}, result.get(0).toArray());
- Assert.assertArrayEquals(new String[]{"4", "5", "6"}, result.get(1).toArray());
- Assert.assertArrayEquals(new String[] {"7", "8", "9"}, result.get(2).toArray());
- }
-
- @Test
- public void putArrayValid() throws Exception {
- List> body = new ArrayList>();
- body.add(Arrays.asList("1", "2", "3"));
- body.add(Arrays.asList("4", "5", "6"));
- body.add(Arrays.asList("7", "8", "9"));
- client.arrays().putArrayValid(body);
- }
-
- @Test
- public void getDictionaryNull() throws Exception {
- try {
- List