diff --git a/tests-upgrade/Configuration.json b/tests-upgrade/Configuration.json index 51c7d7c1ce..73ac602112 100644 --- a/tests-upgrade/Configuration.json +++ b/tests-upgrade/Configuration.json @@ -23,6 +23,7 @@ "datamodels-datatypes-array", "datamodels-datatypes-integer", "datamodels-datatypes-string", + "datamodels-combineschema", "directive-model", "directive-tableformat", "extension-ms-azureresource", diff --git a/tests-upgrade/datamodels-combineschema/readme.md b/tests-upgrade/datamodels-combineschema/readme.md new file mode 100644 index 0000000000..cd6b9c0ac2 --- /dev/null +++ b/tests-upgrade/datamodels-combineschema/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../readme.azure.noprofile.md +input-file: + - $(this-folder)/swagger.json + +``` diff --git a/tests-upgrade/datamodels-combineschema/swagger.json b/tests-upgrade/datamodels-combineschema/swagger.json new file mode 100644 index 0000000000..9f83a802c3 --- /dev/null +++ b/tests-upgrade/datamodels-combineschema/swagger.json @@ -0,0 +1,105 @@ +{ + + "swagger": "2.0", + "info": { + "title": "DatabricksClient", + "version": "2018-04-01", + "description": "ARM Databricks" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/pets": { + "patch": { + "tags": [ + "pets" + ], + "operationId": "Pets_Update", + "description": "Gets pet list.", + "parameters": [ + { + "name": "pets", + "in": "body", + "required": true, + "description": "The pets update.", + "schema": { + "$ref":"#/definitions/Dog" + } + } + ], + "responses": { + "200": { + "description": "OK-Return workspace." + } + } + } + } + }, + "definitions": { + "Pet": { + "type": "object", + "properties": { + "petType": { + "type": "string" + } + } + }, + "Dog":{ + "type": "object", + "properties": { + "bark": { + "type": "boolean" + }, + "breed": { + "type": "string" + } + } + }, + "Cat": { + "allOf": [ + { + "$ref": "#/definitions/Pet" + + }, + { + "type": "object", + "properties": { + "hunts": { + "type": "boolean" + }, + "age": { + "type": "integer" + } + } + } + ] + + } + } +} \ No newline at end of file diff --git a/tests-upgrade/datamodels-datatypes-object/readme.md b/tests-upgrade/datamodels-datatypes-object/readme.md new file mode 100644 index 0000000000..cd6b9c0ac2 --- /dev/null +++ b/tests-upgrade/datamodels-datatypes-object/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../readme.azure.noprofile.md +input-file: + - $(this-folder)/swagger.json + +``` diff --git a/tests-upgrade/datamodels-datatypes-object/swagger.json b/tests-upgrade/datamodels-datatypes-object/swagger.json new file mode 100644 index 0000000000..b82571a675 --- /dev/null +++ b/tests-upgrade/datamodels-datatypes-object/swagger.json @@ -0,0 +1,131 @@ +{ + + "swagger": "2.0", + "info": { + "title": "DatabricksClient", + "version": "2018-04-01", + "description": "ARM Databricks" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/resourceGroup": { + "get": { + "tags": [ + "Workspaces" + ], + "operationId": "Workspaces_Get", + "description": "Gets the workspace.", + "responses": { + "200": { + "description": "OK-Return workspace." + } + } + } + } + }, + "definitions": { + "Model": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "integer" + } + } + }, + "Model2": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "username" + ] + }, + "Model3": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "readOnly": true + }, + "password": { + "type": "string" + } + }, + "required": [ + "id", + "username" + ] + }, + "ContactInfo": { + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "phone": { + "type": "string" + } + } + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "contact_info": { + "$ref": "#/definitions/ContactInfo" + } + } + }, + "Model4": { + "type": "object", + "minProperties": 2, + "maxProperties": 10 + } + } +} \ No newline at end of file