From d82ebd9a2b74c3c2583c909cb4df00c1a62e7e0f Mon Sep 17 00:00:00 2001 From: raychen Date: Thu, 1 Dec 2022 16:57:51 +0800 Subject: [PATCH 01/10] Adding cadl sample project --- .../Contoso.WidgetManager.Shared/main.cadl | 8 + .../Contoso.WidgetManager.Shared/package.json | 23 + .../Contoso.WidgetManager/cadl-project.yaml | 5 + .../Widgets_DeleteWidgetSample.json | 25 + .../Widgets_GetWidgetSample.json | 24 + .../Contoso.WidgetManager/main.cadl | 60 ++ .../Contoso.WidgetManager/package.json | 11 + .../examples/Widgets_DeleteWidgetSample.json | 25 + .../examples/Widgets_GetWidgetSample.json | 24 + .../preview/2022-11-01-preview/widgets.json | 552 ++++++++++++++++++ documentation/cadl-structure-guidelines.md | 47 +- 11 files changed, 791 insertions(+), 13 deletions(-) create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.cadl create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.cadl b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.cadl new file mode 100644 index 000000000000..264c3c639f87 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.cadl @@ -0,0 +1,8 @@ +@doc("Custom etag") +model CustomEtag { + @doc("The customized entity tag.") + etag: string; + + @doc("The customized entity tag.") + createdDate: zonedDateTime; +} \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json new file mode 100644 index 000000000000..f4ecf25565d3 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json @@ -0,0 +1,23 @@ +{ + "name": "contoso-widget-manager-shared", + "version": "1.0.0", + "description": "", + "cadlMain": "main.cadl", + "scripts": { + "build": "" + }, + "dependencies": { + "@azure-tools/cadl-azure-core": "latest" + }, + "devDependencies": { + "@cadl-lang/compiler": "latest", + "@azure-tools/cadl-autorest": "latest", + "@cadl-lang/openapi": "latest", + "@cadl-lang/openapi3": "latest", + "@cadl-lang/rest": "latest", + "@cadl-lang/versioning": "latest" + }, + "keywords": [], + "author": "", + "license": "" +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml new file mode 100644 index 000000000000..463e412bdc06 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml @@ -0,0 +1,5 @@ +emitters: + "@azure-tools/cadl-autorest": + output-file: widgets.json + azure-resource-provider-folder: ../../data-plane + examples-directory: ./examples \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json new file mode 100644 index 000000000000..402fccb6ae2a --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json @@ -0,0 +1,25 @@ +{ + "operationId": "Widgets_DeleteWidget", + "title": "Delete widget by widget name using long-running operation.", + "parameters": { + "api-version": "2022-11-01-preview", + "widgetName": "searchbox" + }, + "responses": { + "204": {}, + "202": { + "headers": { + "location": "https://contosowidgetmanager.azure.com/operations/00000000-0000-0000-0000-000000000123/result?api-version=2022-11-01-preview", + "operation-location": "https://contosowidgetmanager.azure.com/operations/00000000-0000-0000-0000-000000000123?api-version=2022-11-01-preview" + } + }, + "default": { + "body": { + "error": { + "code": "Error code", + "message": "Error message" + } + } + } + } +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json new file mode 100644 index 000000000000..907a5b8cbef2 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json @@ -0,0 +1,24 @@ +{ + "operationId": "Widgets_GetWidget", + "title": "Get widget by widget name.", + "parameters": { + "api-version": "2022-11-01-preview", + "widgetName": "searchbox" + }, + "responses": { + "200": { + "body": { + "name": "bingsearch", + "manufacturerId": "a-22-01" + } + }, + "default": { + "body": { + "error": { + "code": "Error code", + "message": "Error message" + } + } + } + } +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl new file mode 100644 index 000000000000..450f8cfd5559 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl @@ -0,0 +1,60 @@ +import "@cadl-lang/rest"; +import "@cadl-lang/versioning"; +import "@azure-tools/cadl-autorest"; +import "@azure-tools/cadl-azure-core"; +import "../Contoso.WidgetManager.Shared"; + +using Cadl.Http; +using Cadl.Rest; +using Cadl.Versioning; +using Azure.Core; + +@service({ + title: "Contoso Widget Manager", + }) +@versioned(Contoso.WidgetManager.Versions) +@versionedDependency([[Contoso.WidgetManager.Versions.v2022_11_01_Preview, Azure.Core.Versions.v1_0_Preview_1]]) +namespace Contoso.WidgetManager; + +enum Versions { + v2022_11_01_Preview: "2022-11-01-preview", +} + +@doc("A widget.") +@resource("widgets") +model Widget { + @key("widgetName") + @doc("The widget name.") + @visibility("read") + name: string; + + @doc("The ID of the widget's manufacturer.") + manufacturerId: string; + + @doc("The etag of the widget.") + tag?: CustomEtag; +} + +interface Widgets { + @doc("Fetch a Widget by name.") + getWidget is ResourceRead; + + @doc("Gets status of a Widget operation.") + getWidgetOperationStatus is GetResourceOperationStatus; + + @doc("Creates or updates a Widget asynchronously.") + @pollingOperation(Widgets.getWidgetOperationStatus) + createOrUpdateWidget is LongRunningResourceCreateOrUpdate; + + @doc("Delete a Widget asynchronously.") + @pollingOperation(Widgets.getWidgetOperationStatus) + deleteWidget is LongRunningResourceDelete; + + @doc("List Widget resources") + listWidgets is ResourceList< + Widget, + { + parameters: StandardListQueryParameters & SelectQueryParameter; + } + >; +} \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json new file mode 100644 index 000000000000..5f132359b17b --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json @@ -0,0 +1,11 @@ +{ + "name": "contoso-widget-manager", + "dependencies": { + "@cadl-lang/compiler": "latest", + "@cadl-lang/rest": "latest", + "@cadl-lang/versioning": "latest", + "@azure-tools/cadl-autorest": "latest", + "@azure-tools/cadl-azure-core": "latest" + }, + "private": true +} \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json new file mode 100644 index 000000000000..402fccb6ae2a --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json @@ -0,0 +1,25 @@ +{ + "operationId": "Widgets_DeleteWidget", + "title": "Delete widget by widget name using long-running operation.", + "parameters": { + "api-version": "2022-11-01-preview", + "widgetName": "searchbox" + }, + "responses": { + "204": {}, + "202": { + "headers": { + "location": "https://contosowidgetmanager.azure.com/operations/00000000-0000-0000-0000-000000000123/result?api-version=2022-11-01-preview", + "operation-location": "https://contosowidgetmanager.azure.com/operations/00000000-0000-0000-0000-000000000123?api-version=2022-11-01-preview" + } + }, + "default": { + "body": { + "error": { + "code": "Error code", + "message": "Error message" + } + } + } + } +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json new file mode 100644 index 000000000000..907a5b8cbef2 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json @@ -0,0 +1,24 @@ +{ + "operationId": "Widgets_GetWidget", + "title": "Get widget by widget name.", + "parameters": { + "api-version": "2022-11-01-preview", + "widgetName": "searchbox" + }, + "responses": { + "200": { + "body": { + "name": "bingsearch", + "manufacturerId": "a-22-01" + } + }, + "default": { + "body": { + "error": { + "code": "Error code", + "message": "Error message" + } + } + } + } +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json new file mode 100644 index 000000000000..5e164e009192 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json @@ -0,0 +1,552 @@ +{ + "swagger": "2.0", + "info": { + "title": "Contoso Widget Manager", + "version": "2022-11-01-preview", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": { + "/widgets": { + "get": { + "operationId": "Widgets_ListWidgets", + "description": "List Widget resources", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SelectQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Widget" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Widget[]", + "description": "The Widget items on this page" + }, + "nextLink": { + "type": "string", + "description": "The link to the next page of items", + "format": "uri", + "x-cadl-name": "Rest.ResourceLocation" + } + }, + "description": "Paged collection of Widget items", + "required": [ + "value" + ], + "x-cadl-name": "Azure.Core.Foundations.CustomPage" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/widgets/{widgetName}": { + "get": { + "operationId": "Widgets_GetWidget", + "description": "Fetch a Widget by name.", + "parameters": [ + { + "name": "widgetName", + "in": "path", + "required": true, + "description": "The widget name.", + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Widget" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get widget by widget name.": { + "$ref": "./examples/Widgets_GetWidgetSample.json" + } + } + }, + "patch": { + "operationId": "Widgets_CreateOrUpdateWidget", + "description": "Creates or updates a Widget asynchronously.", + "parameters": [ + { + "name": "widgetName", + "in": "path", + "required": true, + "description": "The widget name.", + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "manufacturerId": { + "type": "string", + "description": "The ID of the widget's manufacturer." + }, + "tag": { + "$ref": "#/definitions/CustomEtag", + "description": "The etag of the widget." + } + }, + "description": "The template for adding optional properties.", + "x-cadl-name": "Azure.Core.Foundations.ResourceCreateOrUpdateModel" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "Operation-Location": { + "description": "The location of an instance of OperationStatus", + "type": "string", + "format": "uri" + } + }, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The widget name.", + "readOnly": true + }, + "manufacturerId": { + "type": "string", + "description": "The ID of the widget's manufacturer." + }, + "tag": { + "$ref": "#/definitions/CustomEtag", + "description": "The etag of the widget." + } + }, + "required": [ + "name", + "manufacturerId" + ], + "x-cadl-name": "Azure.Core.Foundations.ResourceOkResponse" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "headers": { + "Operation-Location": { + "description": "The location of an instance of OperationStatus", + "type": "string", + "format": "uri" + } + }, + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The widget name.", + "readOnly": true + }, + "manufacturerId": { + "type": "string", + "description": "The ID of the widget's manufacturer." + }, + "tag": { + "$ref": "#/definitions/CustomEtag", + "description": "The etag of the widget." + } + }, + "description": "A resource was successfully created.", + "required": [ + "name", + "manufacturerId" + ], + "x-cadl-name": "Azure.Core.Foundations.ResourceCreatedResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + }, + "consumes": [ + "application/merge-patch+json" + ] + }, + "delete": { + "operationId": "Widgets_DeleteWidget", + "description": "Delete a Widget asynchronously.", + "parameters": [ + { + "name": "widgetName", + "in": "path", + "required": true, + "description": "The widget name.", + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The request has been accepted for processing, but processing has not yet completed.", + "headers": { + "Operation-Location": { + "description": "The location of an instance of OperationStatus", + "type": "string", + "format": "uri" + } + }, + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the operation." + }, + "status": { + "$ref": "#/definitions/Azure.Core.Foundations.OperationState", + "description": "The status of the operation" + }, + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "Error object that describes the error when status is \"Failed\"." + } + }, + "required": [ + "id", + "status" + ], + "x-cadl-name": "Azure.Core.Foundations.AcceptedResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete widget by widget name using long-running operation.": { + "$ref": "./examples/Widgets_DeleteWidgetSample.json" + } + } + } + }, + "/widgets/{widgetName}/operations/{operationId}": { + "get": { + "operationId": "Widgets_GetWidgetOperationStatus", + "description": "Gets status of a Widget operation.", + "parameters": [ + { + "name": "widgetName", + "in": "path", + "required": true, + "description": "The widget name.", + "type": "string" + }, + { + "name": "operationId", + "in": "path", + "required": true, + "description": "The unique ID of the operation.", + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the operation." + }, + "status": { + "$ref": "#/definitions/Azure.Core.Foundations.OperationState", + "description": "The status of the operation" + }, + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "Error object that describes the error when status is \"Failed\"." + }, + "result": { + "$ref": "#/definitions/Widget", + "description": "The result of the operation." + }, + "widgetName": { + "type": "string", + "description": "The widget name." + } + }, + "required": [ + "id", + "status", + "widgetName" + ], + "x-cadl-name": "(anonymous model)" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "Azure.Core.Foundations.Error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [], + "x-cadl-name": "Azure.Core.Foundations.Error[]", + "description": "An array of details about specific errors that led to this reported error." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "description": "The error object.", + "required": [ + "code", + "message", + "details" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "description": "A response containing error details.", + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + }, + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "required": [ + "code" + ] + }, + "Azure.Core.Foundations.OperationState": { + "type": "string", + "enum": [ + "InProgress", + "Succeeded", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "OperationState", + "modelAsString": true + } + }, + "CustomEtag": { + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "The customized entity tag." + }, + "createdDate": { + "type": "string", + "format": "date-time", + "description": "The customized entity tag." + } + }, + "description": "Custom etag", + "required": [ + "etag", + "createdDate" + ] + }, + "Versions": { + "type": "string", + "enum": [ + "2022-11-01-preview" + ], + "x-ms-enum": { + "name": "Versions", + "modelAsString": false, + "values": [ + { + "name": "v2022_11_01_Preview", + "value": "2022-11-01-preview" + } + ] + } + }, + "Widget": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The widget name.", + "readOnly": true + }, + "manufacturerId": { + "type": "string", + "description": "The ID of the widget's manufacturer." + }, + "tag": { + "$ref": "#/definitions/CustomEtag", + "description": "The etag of the widget." + } + }, + "description": "A widget.", + "required": [ + "name", + "manufacturerId" + ] + } + }, + "parameters": { + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "description": "The API version to use for this operation.", + "minLength": 1, + "type": "string", + "x-ms-parameter-location": "method" + }, + "Azure.Core.MaxPageSizeQueryParameter": { + "name": "maxpagesize", + "in": "query", + "required": false, + "description": "The maximum number of result items per page.", + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "Azure.Core.SelectQueryParameter": { + "name": "select", + "in": "query", + "required": false, + "description": "Select the specified fields to be included in the response.", + "type": "array", + "items": { + "type": "string" + }, + "x-ms-parameter-location": "method" + }, + "Azure.Core.SkipQueryParameter": { + "name": "skip", + "in": "query", + "required": false, + "description": "The number of result items to skip.", + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "Azure.Core.TopQueryParameter": { + "name": "top", + "in": "query", + "required": false, + "description": "The number of result items to return.", + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + } + } +} diff --git a/documentation/cadl-structure-guidelines.md b/documentation/cadl-structure-guidelines.md index e768ecdaa99b..f93c0ba343c9 100644 --- a/documentation/cadl-structure-guidelines.md +++ b/documentation/cadl-structure-guidelines.md @@ -1,17 +1,34 @@ -# Repository Guidelines for Cadl Specs - -## Purpose + +* 1. [Purpose](#Purpose) +* 2. [Repository](#Repository) +* 3. [Structure Overview](#StructureOverview) +* 4. [Service Folders](#ServiceFolders) + * 4.1. [Packages](#Packages) + * 4.2. [Structure](#Structure) +* 5. [Service Family Libraries](#ServiceFamilyLibraries) + * 5.1. [Service Folder](#ServiceFolder) + * 5.2. [Working in Feature Branches](#WorkinginFeatureBranches) + * 5.3. [Publishing Specs](#PublishingSpecs) +* 6. [Sample Project](#SampleProject) + + +# Repository Guidelines for Cadl Specs + +## 1. Purpose We need to formulate a strategy for checking in actual Cadl service specs for Azure. Service teams need to know where and how to check these in and tooling needs to know how to find and consume them. While OpenAPI specs traditionally have been just spec documents, Cadl "specs" could include service-specific functions, decorators and so forth that elevate them to the level of a library, and to maximize the benefits of Cadl, this approach needs to be supported as a first-class citizen. -## Repository +## 2. Repository Cadl can co-exist with Swagger within the existing `azure-rest-api-specs` repository. This approach will make it easier to generate Swagger artifacts without needing to sync between repos at the downside of having to live with any baggage associated with the repo as it ages. There are currently over 1,000 issues and 500 open PRs in this repo. -## Structure Overview +## 3. Structure Overview This proposal strives to align with [Azure SDK Repo Structure Guidelines](https://azure.github.io/azure-sdk/policies_repostructure.html). @@ -52,7 +69,7 @@ Examples below: -> resource-manager (swagger) ``` -## Service Folders +## 4. Service Folders The service folder contains the entire Cadl library specification for a service, which could include custom linter rules, methods, etc. @@ -61,13 +78,13 @@ The folder name should correspond to the RP-name, but dropping the leading "Azur - `Management` at the end of the service RP-name indicates a management (resource manager) libarary. - `Shared` at the end of the name indicates a shared library. If a management library has a shared component (unlikely), `Shared` should follow `Management`. -### Packages +### 4.1. Packages All services and service family libraries are modeled as Cadl packages, since you must install supporting librarie for proper tooling support. Per this proposal, all packages defined in the repo would be **unpublished**. Only packages in `cadl-azure` would be published. We will annotate the packages with `"private": true` in the `package.json` file to prevent publishing these to npm. All packages defined in this repo would use the `@cadl-api-spec` scope and use a lowercased, dashed form of the service namespace (ex: `@cadl-api-spec/azure-storage-blob`). -### Structure +### 4.2. Structure Each package should have the following minimum structure: @@ -87,7 +104,7 @@ To distinguish between folders which define a service, an SDK, or both, one can - SDKs _may_ have a sidecar file to customize how the SDK is shaped. Folders that describe service definitions only will not have a sidecar file. _Note: the absence of a sidecar does not mean that a folder does not describe an SDK, but the presence of one means it is an SDK._ - Services will take a dependency on `@azure-tools/autorest` and configure the emitter in `cadl-project.yaml`. -## Service Family Libraries +## 5. Service Family Libraries The service family library concept allows a family of services to share common models, linter rules, templates, etc. @@ -130,18 +147,22 @@ Here's an example of how Cognitive Services might use multiple shared libraries: Cadl has a versioning library which allows a single spec to represent multiple versions through projections. Service teams have GA service versions as well as public and private Preview service versions. The versioning library is currently optimized for the kinds of changes allowed between GA service releases: long-lived, stable, backward compatible changes. Preview versions are shorter-lived and often have wildly breaking changes from one version to the next, for which the versioning library is not optimized. -### Service Folder +### 5.1. Service Folder The service folder contains the Cadl files for the service package. Services transitioning to Cadl may simply begin by modeling their versioned Cadl from their latest stable Swagger. Existing services DO NOT need to model past service versions unless a business rationale exists. Future versions should be added to the spec using the necessary versioning decorators. The inital version in the spec need not feature version annotations since it is considered the baseline (i.e. it makes no implications about prior versions since it does not know about them). -### Working in Feature Branches +### 5.2. Working in Feature Branches Feature branches enable diffing the proposed change directly against the main branch. Feature branches should be used for either GA or preview API version development. On the feature branch, the service team should directly modify the cadl within the service folder as this works well with GitHub's diffing strategy. -### Publishing Specs +### 5.3. Publishing Specs The purest approach to publish a spec is to merge the PR that modifies the Cadl spec in the service folder. This is the simplest experience for projecting the Cadl and generating artifacts, including server-side codegen. In the event that a major break makes it infeasible to continue using a spec with version annotations, the spec could be reset to some base version (likely the breaking one) and continue versioning from there. The commit hash or tag that represented the spec prior to the reset would need to be tracked in order to regenerate older versions of the spec. At this point, if an update was needed to an older version of the spec no longer represented on the latest commit on `main`, we would need a servicing branch and update the hash pointers to the commit on that servicing branch. -This option is only suitable for _public_ previews. Private previews should live solely in a branch (in either the public or private repo) until/unless they become a public preview. \ No newline at end of file +This option is only suitable for _public_ previews. Private previews should live solely in a branch (in either the public or private repo) until/unless they become a public preview. + +## 6. Sample Project + +Here's a [cadl-sample-project](./cadl-sample-project) to demonstrate the files and folders supposed to be included when check in to this `azure-rest-api-specs` repository. \ No newline at end of file From 1f66627dd6e43bb983bf0909e2194457246a8c5b Mon Sep 17 00:00:00 2001 From: Wei Dong <40835867+dw511214992@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:45:55 +0800 Subject: [PATCH 02/10] cadl sample: packaqe.json & cadl-project.yaml (#21903) * cadl sample: packaqe.json & cadl-project.yaml * Update cadl-project.yaml --- .../Contoso.WidgetManager/cadl-project.yaml | 37 ++++++++++++++++++- .../Contoso.WidgetManager/package.json | 6 +-- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml index 463e412bdc06..cb829a0f122e 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml @@ -1,5 +1,38 @@ -emitters: +parameters: + "python-sdk-folder": + default: "{cwd}/azure-sdk-for-python/" + "java-sdk-folder": + default: "{cwd}/azure-sdk-for-java/" + "js-sdk-folder": + default: "{cwd}/azure-sdk-for-java/" + "csharp-sdk-folder": + default: "{cwd}/azure-sdk-for-java/" + "openapi-folder": + default: "{project-root}/../dataplane/" + "service-directory-name": + default: "contosowidgetmanager" +emit: + - "@azure-tools/cadl-autorest" +options: "@azure-tools/cadl-autorest": output-file: widgets.json azure-resource-provider-folder: ../../data-plane - examples-directory: ./examples \ No newline at end of file + examples-directory: ./examples + "@azure-tools/cadl-python": + "package-name": "azure-contosowidgetmanager" + "emitter-output-dir": "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" + "package-mode": "dataplane" + "@azure-tools/cadl-csharp": + namespace: Azure.Contoso.Widgetmanager + "emitter-output-dir": "{csharp-sdk-folder}/sdk/{service-directory-name}/{namespace}/src" + "@azure-tools/cadl-typescript": + "emitter-output-dir": "{js-sdk-folder}/sdk/{service-directory-name}/contosowidgetmanager-rest" + generateMetadata: true + generateTest: true + azureSdkForJs: true + packageDetails: + name: "@azure-rest/contosowidgetmanager-rest" + description: "Contoso WidgetManager Service" + "@azure-tools/cadl-java": + "emitter-output-dir": "{java-sdk-folder}/sdk/{service-directory-name}/azure-contoso-widgetmanager" + namespace: com.azure.contosowidgetmanager diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json index 5f132359b17b..7bff90148c62 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json @@ -1,11 +1,7 @@ { "name": "contoso-widget-manager", "dependencies": { - "@cadl-lang/compiler": "latest", - "@cadl-lang/rest": "latest", - "@cadl-lang/versioning": "latest", "@azure-tools/cadl-autorest": "latest", - "@azure-tools/cadl-azure-core": "latest" }, "private": true -} \ No newline at end of file +} From 9b110a29ad05f7e2e1620975fcdb7faa5399dbd7 Mon Sep 17 00:00:00 2001 From: raychen Date: Thu, 15 Dec 2022 21:50:14 +0800 Subject: [PATCH 03/10] Use faked shared model --- .../Contoso.WidgetManager.Shared/main.cadl | 10 +++++----- .../Contoso.WidgetManager.Shared/package.json | 8 -------- .../Contoso.WidgetManager/main.cadl | 6 +++--- .../Contoso.WidgetManager/package.json | 2 +- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.cadl b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.cadl index 264c3c639f87..ce9d59382a69 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.cadl +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/main.cadl @@ -1,8 +1,8 @@ -@doc("Custom etag") -model CustomEtag { - @doc("The customized entity tag.") - etag: string; +@doc("Faked shared model") +model FakedSharedModel { + @doc("The tag.") + tag: string; - @doc("The customized entity tag.") + @doc("The created date.") createdDate: zonedDateTime; } \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json index f4ecf25565d3..8d6a840b6663 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json @@ -9,14 +9,6 @@ "dependencies": { "@azure-tools/cadl-azure-core": "latest" }, - "devDependencies": { - "@cadl-lang/compiler": "latest", - "@azure-tools/cadl-autorest": "latest", - "@cadl-lang/openapi": "latest", - "@cadl-lang/openapi3": "latest", - "@cadl-lang/rest": "latest", - "@cadl-lang/versioning": "latest" - }, "keywords": [], "author": "", "license": "" diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl index 450f8cfd5559..c3e8a6e61771 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl @@ -14,7 +14,7 @@ using Azure.Core; }) @versioned(Contoso.WidgetManager.Versions) @versionedDependency([[Contoso.WidgetManager.Versions.v2022_11_01_Preview, Azure.Core.Versions.v1_0_Preview_1]]) -namespace Contoso.WidgetManager; +namespace Azure.Contoso.WidgetManager; enum Versions { v2022_11_01_Preview: "2022-11-01-preview", @@ -31,8 +31,8 @@ model Widget { @doc("The ID of the widget's manufacturer.") manufacturerId: string; - @doc("The etag of the widget.") - tag?: CustomEtag; + @doc("The faked shared model.") + sharedModel?: FakedSharedModel; } interface Widgets { diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json index 7bff90148c62..4d8fd4a967a1 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/package.json @@ -1,7 +1,7 @@ { "name": "contoso-widget-manager", "dependencies": { - "@azure-tools/cadl-autorest": "latest", + "@azure-tools/cadl-autorest": "latest" }, "private": true } From 2d0bf4e2bdeee51e6027413c79d03b96b9749097 Mon Sep 17 00:00:00 2001 From: Ray Chen Date: Mon, 19 Dec 2022 11:20:15 +0800 Subject: [PATCH 04/10] Update documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml Co-authored-by: Wes Haggard --- .../Contoso.WidgetManager/cadl-project.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml index cb829a0f122e..7f124713f970 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml @@ -8,7 +8,7 @@ parameters: "csharp-sdk-folder": default: "{cwd}/azure-sdk-for-java/" "openapi-folder": - default: "{project-root}/../dataplane/" + default: "{project-root}/../data-plane/" "service-directory-name": default: "contosowidgetmanager" emit: From 92c1e51e9f2293aad67329e39cdc4b4ec33c369d Mon Sep 17 00:00:00 2001 From: Wei Dong <40835867+dw511214992@users.noreply.github.com> Date: Mon, 19 Dec 2022 11:33:25 +0800 Subject: [PATCH 05/10] Update cadl-project.yaml --- .../Contoso.WidgetManager/cadl-project.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml index 7f124713f970..4020fe981279 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml @@ -4,9 +4,9 @@ parameters: "java-sdk-folder": default: "{cwd}/azure-sdk-for-java/" "js-sdk-folder": - default: "{cwd}/azure-sdk-for-java/" + default: "{cwd}/azure-sdk-for-js/" "csharp-sdk-folder": - default: "{cwd}/azure-sdk-for-java/" + default: "{cwd}/azure-sdk-for-csharp/" "openapi-folder": default: "{project-root}/../data-plane/" "service-directory-name": From 1a3d8eadb53a924913142e3cc47088c4cccece6f Mon Sep 17 00:00:00 2001 From: raychen Date: Tue, 20 Dec 2022 10:56:43 +0800 Subject: [PATCH 06/10] Adjusted to minimum file set --- .../Contoso.WidgetManager.Shared/package.json | 15 ------- .../Contoso.WidgetManager/cadl-project.yaml | 6 +-- .../Contoso.WidgetManager/main.cadl | 1 - .../examples/Widgets_DeleteWidgetSample.json | 0 .../examples/Widgets_GetWidgetSample.json | 0 .../preview/2022-11-01-preview/widgets.json | 43 ++++++++++--------- 6 files changed, 24 insertions(+), 41 deletions(-) delete mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json rename documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/{Contoso.WidgetManager => Azure.Contoso.WidgetManager}/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json (100%) rename documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/{Contoso.WidgetManager => Azure.Contoso.WidgetManager}/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json (100%) rename documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/{Contoso.WidgetManager => Azure.Contoso.WidgetManager}/preview/2022-11-01-preview/widgets.json (94%) diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json deleted file mode 100644 index 8d6a840b6663..000000000000 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager.Shared/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "contoso-widget-manager-shared", - "version": "1.0.0", - "description": "", - "cadlMain": "main.cadl", - "scripts": { - "build": "" - }, - "dependencies": { - "@azure-tools/cadl-azure-core": "latest" - }, - "keywords": [], - "author": "", - "license": "" -} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml index 4020fe981279..fe6dab1fe4c8 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml @@ -6,9 +6,7 @@ parameters: "js-sdk-folder": default: "{cwd}/azure-sdk-for-js/" "csharp-sdk-folder": - default: "{cwd}/azure-sdk-for-csharp/" - "openapi-folder": - default: "{project-root}/../data-plane/" + default: "{cwd}/azure-sdk-for-csharp/" "service-directory-name": default: "contosowidgetmanager" emit: @@ -16,7 +14,7 @@ emit: options: "@azure-tools/cadl-autorest": output-file: widgets.json - azure-resource-provider-folder: ../../data-plane + azure-resource-provider-folder: ../../../../data-plane examples-directory: ./examples "@azure-tools/cadl-python": "package-name": "azure-contosowidgetmanager" diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl index c3e8a6e61771..d7521d635d85 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/main.cadl @@ -1,6 +1,5 @@ import "@cadl-lang/rest"; import "@cadl-lang/versioning"; -import "@azure-tools/cadl-autorest"; import "@azure-tools/cadl-azure-core"; import "../Contoso.WidgetManager.Shared"; diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json similarity index 100% rename from documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json rename to documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json similarity index 100% rename from documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json rename to documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json similarity index 94% rename from documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json rename to documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json index 5e164e009192..87247f134532 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json @@ -58,9 +58,9 @@ }, "nextLink": { "type": "string", - "description": "The link to the next page of items", "format": "uri", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items", + "x-cadl-name": "Rest.ResourceLocation" } }, "description": "Paged collection of Widget items", @@ -142,9 +142,9 @@ "type": "string", "description": "The ID of the widget's manufacturer." }, - "tag": { - "$ref": "#/definitions/CustomEtag", - "description": "The etag of the widget." + "sharedModel": { + "$ref": "#/definitions/FakedSharedModel", + "description": "The faked shared model." } }, "description": "The template for adding optional properties.", @@ -174,9 +174,9 @@ "type": "string", "description": "The ID of the widget's manufacturer." }, - "tag": { - "$ref": "#/definitions/CustomEtag", - "description": "The etag of the widget." + "sharedModel": { + "$ref": "#/definitions/FakedSharedModel", + "description": "The faked shared model." } }, "required": [ @@ -207,9 +207,9 @@ "type": "string", "description": "The ID of the widget's manufacturer." }, - "tag": { - "$ref": "#/definitions/CustomEtag", - "description": "The etag of the widget." + "sharedModel": { + "$ref": "#/definitions/FakedSharedModel", + "description": "The faked shared model." } }, "description": "A resource was successfully created.", @@ -441,22 +441,22 @@ "modelAsString": true } }, - "CustomEtag": { + "FakedSharedModel": { "type": "object", "properties": { - "etag": { + "tag": { "type": "string", - "description": "The customized entity tag." + "description": "The tag." }, "createdDate": { "type": "string", "format": "date-time", - "description": "The customized entity tag." + "description": "The created date." } }, - "description": "Custom etag", + "description": "Faked shared model", "required": [ - "etag", + "tag", "createdDate" ] }, @@ -467,7 +467,7 @@ ], "x-ms-enum": { "name": "Versions", - "modelAsString": false, + "modelAsString": true, "values": [ { "name": "v2022_11_01_Preview", @@ -488,9 +488,9 @@ "type": "string", "description": "The ID of the widget's manufacturer." }, - "tag": { - "$ref": "#/definitions/CustomEtag", - "description": "The etag of the widget." + "sharedModel": { + "$ref": "#/definitions/FakedSharedModel", + "description": "The faked shared model." } }, "description": "A widget.", @@ -506,6 +506,7 @@ "in": "query", "required": true, "description": "The API version to use for this operation.", + "x-ms-client-name": "apiVersion", "minLength": 1, "type": "string", "x-ms-parameter-location": "method" From 412416486daa9d2c033ddafd87421e57223b61d5 Mon Sep 17 00:00:00 2001 From: Wei Dong <40835867+dw511214992@users.noreply.github.com> Date: Thu, 5 Jan 2023 16:46:39 +0800 Subject: [PATCH 07/10] update .Net emitter configuration --- .../Contoso.WidgetManager/cadl-project.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml index fe6dab1fe4c8..c24a32c03cb6 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml @@ -22,6 +22,8 @@ options: "package-mode": "dataplane" "@azure-tools/cadl-csharp": namespace: Azure.Contoso.Widgetmanager + clear-output-folder: true + model-namespace: false "emitter-output-dir": "{csharp-sdk-folder}/sdk/{service-directory-name}/{namespace}/src" "@azure-tools/cadl-typescript": "emitter-output-dir": "{js-sdk-folder}/sdk/{service-directory-name}/contosowidgetmanager-rest" From 040a6d218f7c5ef96604b3687ef6ef70810be851 Mon Sep 17 00:00:00 2001 From: Wei Dong <40835867+dw511214992@users.noreply.github.com> Date: Fri, 6 Jan 2023 16:49:27 +0800 Subject: [PATCH 08/10] update java emitter config --- .../Contoso.WidgetManager/cadl-project.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml index c24a32c03cb6..b67f345cb4de 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/cadl-project.yaml @@ -35,4 +35,4 @@ options: description: "Contoso WidgetManager Service" "@azure-tools/cadl-java": "emitter-output-dir": "{java-sdk-folder}/sdk/{service-directory-name}/azure-contoso-widgetmanager" - namespace: com.azure.contosowidgetmanager + namespace: com.azure.contoso.widgetmanager From 7fa10ddde3a4a7aca99b97b90adf5adcce69c376 Mon Sep 17 00:00:00 2001 From: raychen Date: Mon, 9 Jan 2023 12:15:47 +0800 Subject: [PATCH 09/10] Fixed examples issues --- .../Widgets_CreateOrUpdateWidgetSample.json | 37 +++++++++++++++ .../Widgets_DeleteWidgetSample.json | 8 +++- ...idgets_GetWidgetOperationStatusSample.json | 45 +++++++++++++++++++ .../Widgets_GetWidgetSample.json | 3 +- .../Widgets_ListWidgetsSample.json | 30 +++++++++++++ .../Widgets_CreateOrUpdateWidgetSample.json | 37 +++++++++++++++ .../examples/Widgets_DeleteWidgetSample.json | 8 +++- ...idgets_GetWidgetOperationStatusSample.json | 45 +++++++++++++++++++ .../examples/Widgets_GetWidgetSample.json | 3 +- .../examples/Widgets_ListWidgetsSample.json | 30 +++++++++++++ .../preview/2022-11-01-preview/widgets.json | 17 ++++++- 11 files changed, 256 insertions(+), 7 deletions(-) create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_CreateOrUpdateWidgetSample.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetOperationStatusSample.json create mode 100644 documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_ListWidgetsSample.json diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json new file mode 100644 index 000000000000..ea61087b5887 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json @@ -0,0 +1,37 @@ +{ + "title": "Widgets_CreateOrUpdateWidget", + "operationId": "Widgets_CreateOrUpdateWidget", + "parameters": { + "widgetName": "name1", + "api-version": "2022-11-01-preview", + "body": { + "manufacturerId": "manufacturer id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + } + }, + "responses": { + "200": { + "body": { + "name": "name1", + "manufacturerId": "manufacturer id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + } + }, + "201": { + "body": { + "name": "name1", + "manufacturerId": "manufacturer id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + } + } + } +} \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json index 402fccb6ae2a..8a6b117b5cde 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_DeleteWidgetSample.json @@ -6,18 +6,22 @@ "widgetName": "searchbox" }, "responses": { - "204": {}, "202": { "headers": { "location": "https://contosowidgetmanager.azure.com/operations/00000000-0000-0000-0000-000000000123/result?api-version=2022-11-01-preview", "operation-location": "https://contosowidgetmanager.azure.com/operations/00000000-0000-0000-0000-000000000123?api-version=2022-11-01-preview" + }, + "body": { + "id": "id1", + "status": "deleted" } }, "default": { "body": { "error": { "code": "Error code", - "message": "Error message" + "message": "Error message", + "details": [] } } } diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json new file mode 100644 index 000000000000..30162dc6af2d --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json @@ -0,0 +1,45 @@ +{ + "title": "Widgets_GetWidgetOperationStatus", + "operationId": "Widgets_GetWidgetOperationStatus", + "parameters": { + "widgetName": "name1", + "operationId": "opreation id1", + "api-version": "2022-11-01-preview" + }, + "responses": { + "200": { + "body": { + "id": "opreation id1", + "status": "InProgress", + "error": { + "code": "Error code", + "message": "Error message", + "target": "op1", + "details": [ + { + "code": "code1", + "message": "message1", + "target": "op1", + "details": [], + "innererror": { + "code": "code1" + } + } + ], + "innererror": { + "code": "code1" + } + }, + "result": { + "name": "bingsearch", + "manufacturerId": "manufacturer Id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + }, + "widgetName": "rfazvwnfwwomiwrh" + } + } + } +} \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json index 907a5b8cbef2..9c07ed974352 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetSample.json @@ -16,7 +16,8 @@ "body": { "error": { "code": "Error code", - "message": "Error message" + "message": "Error message", + "details": [] } } } diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json new file mode 100644 index 000000000000..aec029622b41 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json @@ -0,0 +1,30 @@ +{ + "title": "Widgets_ListWidgets", + "operationId": "Widgets_ListWidgets", + "parameters": { + "top": 8, + "skip": 15, + "maxpagesize": 27, + "select": [ + "type1" + ], + "api-version": "2022-11-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "bingsearch", + "manufacturerId": "manufacturer Id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + } + ], + "nextLink": "https://microsoft.com/a" + } + } + } +} \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_CreateOrUpdateWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_CreateOrUpdateWidgetSample.json new file mode 100644 index 000000000000..ea61087b5887 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_CreateOrUpdateWidgetSample.json @@ -0,0 +1,37 @@ +{ + "title": "Widgets_CreateOrUpdateWidget", + "operationId": "Widgets_CreateOrUpdateWidget", + "parameters": { + "widgetName": "name1", + "api-version": "2022-11-01-preview", + "body": { + "manufacturerId": "manufacturer id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + } + }, + "responses": { + "200": { + "body": { + "name": "name1", + "manufacturerId": "manufacturer id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + } + }, + "201": { + "body": { + "name": "name1", + "manufacturerId": "manufacturer id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + } + } + } +} \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json index 402fccb6ae2a..8a6b117b5cde 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_DeleteWidgetSample.json @@ -6,18 +6,22 @@ "widgetName": "searchbox" }, "responses": { - "204": {}, "202": { "headers": { "location": "https://contosowidgetmanager.azure.com/operations/00000000-0000-0000-0000-000000000123/result?api-version=2022-11-01-preview", "operation-location": "https://contosowidgetmanager.azure.com/operations/00000000-0000-0000-0000-000000000123?api-version=2022-11-01-preview" + }, + "body": { + "id": "id1", + "status": "deleted" } }, "default": { "body": { "error": { "code": "Error code", - "message": "Error message" + "message": "Error message", + "details": [] } } } diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetOperationStatusSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetOperationStatusSample.json new file mode 100644 index 000000000000..30162dc6af2d --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetOperationStatusSample.json @@ -0,0 +1,45 @@ +{ + "title": "Widgets_GetWidgetOperationStatus", + "operationId": "Widgets_GetWidgetOperationStatus", + "parameters": { + "widgetName": "name1", + "operationId": "opreation id1", + "api-version": "2022-11-01-preview" + }, + "responses": { + "200": { + "body": { + "id": "opreation id1", + "status": "InProgress", + "error": { + "code": "Error code", + "message": "Error message", + "target": "op1", + "details": [ + { + "code": "code1", + "message": "message1", + "target": "op1", + "details": [], + "innererror": { + "code": "code1" + } + } + ], + "innererror": { + "code": "code1" + } + }, + "result": { + "name": "bingsearch", + "manufacturerId": "manufacturer Id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + }, + "widgetName": "rfazvwnfwwomiwrh" + } + } + } +} \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json index 907a5b8cbef2..9c07ed974352 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetSample.json @@ -16,7 +16,8 @@ "body": { "error": { "code": "Error code", - "message": "Error message" + "message": "Error message", + "details": [] } } } diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_ListWidgetsSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_ListWidgetsSample.json new file mode 100644 index 000000000000..aec029622b41 --- /dev/null +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_ListWidgetsSample.json @@ -0,0 +1,30 @@ +{ + "title": "Widgets_ListWidgets", + "operationId": "Widgets_ListWidgets", + "parameters": { + "top": 8, + "skip": 15, + "maxpagesize": 27, + "select": [ + "type1" + ], + "api-version": "2022-11-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "bingsearch", + "manufacturerId": "manufacturer Id1", + "sharedModel": { + "tag": "tag1", + "createdDate": "2023-01-09T02:12:25.689Z" + } + } + ], + "nextLink": "https://microsoft.com/a" + } + } + } +} \ No newline at end of file diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json index 87247f134532..3f79510f911e 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/widgets.json @@ -79,6 +79,11 @@ }, "x-ms-pageable": { "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Widgets_ListWidgets": { + "$ref": "./examples/Widgets_ListWidgetsSample.json" + } } } }, @@ -229,7 +234,12 @@ }, "consumes": [ "application/merge-patch+json" - ] + ], + "x-ms-examples": { + "Widgets_CreateOrUpdateWidget": { + "$ref": "./examples/Widgets_CreateOrUpdateWidgetSample.json" + } + } }, "delete": { "operationId": "Widgets_DeleteWidget", @@ -357,6 +367,11 @@ "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } } + }, + "x-ms-examples": { + "Widgets_GetWidgetOperationStatus": { + "$ref": "./examples/Widgets_GetWidgetOperationStatusSample.json" + } } } } From c7af4a50b6505cffed73ea5f7ef96c624da91910 Mon Sep 17 00:00:00 2001 From: raychen Date: Mon, 9 Jan 2023 21:58:23 +0800 Subject: [PATCH 10/10] Fixed example style issue --- .../2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json | 2 +- .../Widgets_GetWidgetOperationStatusSample.json | 2 +- .../examples/2022-11-01-preview/Widgets_ListWidgetsSample.json | 2 +- .../examples/Widgets_CreateOrUpdateWidgetSample.json | 2 +- .../examples/Widgets_GetWidgetOperationStatusSample.json | 2 +- .../2022-11-01-preview/examples/Widgets_ListWidgetsSample.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json index ea61087b5887..9adc3398bcad 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_CreateOrUpdateWidgetSample.json @@ -34,4 +34,4 @@ } } } -} \ No newline at end of file +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json index 30162dc6af2d..c88b6155b003 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_GetWidgetOperationStatusSample.json @@ -42,4 +42,4 @@ } } } -} \ No newline at end of file +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json index aec029622b41..e60878b8300a 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/Contoso.WidgetManager/examples/2022-11-01-preview/Widgets_ListWidgetsSample.json @@ -27,4 +27,4 @@ } } } -} \ No newline at end of file +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_CreateOrUpdateWidgetSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_CreateOrUpdateWidgetSample.json index ea61087b5887..9adc3398bcad 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_CreateOrUpdateWidgetSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_CreateOrUpdateWidgetSample.json @@ -34,4 +34,4 @@ } } } -} \ No newline at end of file +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetOperationStatusSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetOperationStatusSample.json index 30162dc6af2d..c88b6155b003 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetOperationStatusSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_GetWidgetOperationStatusSample.json @@ -42,4 +42,4 @@ } } } -} \ No newline at end of file +} diff --git a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_ListWidgetsSample.json b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_ListWidgetsSample.json index aec029622b41..e60878b8300a 100644 --- a/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_ListWidgetsSample.json +++ b/documentation/cadl-sample-project/specification/contosowidgetmanager/data-plane/Azure.Contoso.WidgetManager/preview/2022-11-01-preview/examples/Widgets_ListWidgetsSample.json @@ -27,4 +27,4 @@ } } } -} \ No newline at end of file +}