Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uptake change to body consistency #293

Merged
merged 19 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@azure-tools/typespec-autorest"
---

Add support for new `@body` `@bodyRoot` and `@bodyIgnore` decorators
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@azure-tools/typespec-azure-core"
- "@azure-tools/typespec-azure-resource-manager"
---

Update to support new meaning of `@body`
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@azure-tools/typespec-autorest-canonical"
---

Add support for new `@body`, `@bodyRoot` and `@bodyIgnore`
2 changes: 1 addition & 1 deletion core
Submodule core updated 31 files
+23 −0 .chronus/changes/body-consitency-2024-2-27-18-35-44-1.md
+18 −0 .chronus/changes/body-consitency-2024-2-27-18-35-44-2.md
+22 −0 .chronus/changes/body-consitency-2024-2-27-18-35-44.md
+9 −0 .chronus/changes/body-consitency-2024-3-2-15-21-10.md
+18 −0 .chronus/changes/body-consitency-2024-3-2-15-21-9.md
+67 −1 docs/libraries/http/reference/decorators.md
+2 −0 docs/libraries/http/reference/index.mdx
+69 −1 packages/http/README.md
+28 −1 packages/http/generated-defs/TypeSpec.Http.ts
+8 −0 packages/http/generated-defs/TypeSpec.Http.ts-test.ts
+29 −1 packages/http/lib/http-decorators.tsp
+174 −0 packages/http/src/body.ts
+21 −0 packages/http/src/decorators.ts
+8 −0 packages/http/src/lib.ts
+22 −10 packages/http/src/metadata.ts
+19 −43 packages/http/src/parameters.ts
+39 −58 packages/http/src/responses.ts
+15 −2 packages/http/src/types.ts
+65 −1 packages/http/test/http-decorators.test.ts
+202 −0 packages/http/test/parameters.test.ts
+115 −73 packages/http/test/responses.test.ts
+0 −168 packages/http/test/routes.test.ts
+0 −6 packages/openapi3/src/lib.ts
+32 −6 packages/openapi3/src/openapi.ts
+12 −2 packages/openapi3/src/schema-emitter.ts
+3 −0 packages/openapi3/src/visibility-usage.ts
+23 −6 packages/openapi3/test/metadata.test.ts
+67 −0 packages/openapi3/test/parameters.test.ts
+97 −59 packages/openapi3/test/return-types.test.ts
+1 −1 packages/openapi3/tsconfig.json
+7 −7 packages/rest/lib/resource.tsp
16 changes: 8 additions & 8 deletions docs/libraries/azure-resource-manager/reference/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,10 @@ model Azure.ResourceManager.ArmResourceCreatedSyncResponse<Resource>

#### Properties

| Name | Type | Description |
| ---------- | ---------- | --------------------------------------------------- |
| body | `Resource` | The body type of the operation request or response. |
| statusCode | `201` | The status code. |
| Name | Type | Description |
| ---------- | ---------- | ---------------- |
| statusCode | `201` | The status code. |
| body | `Resource` | |

### `ArmResourceExistsResponse` {#Azure.ResourceManager.ArmResourceExistsResponse}

Expand Down Expand Up @@ -372,10 +372,10 @@ model Azure.ResourceManager.ArmResponse<ResponseBody>

#### Properties

| Name | Type | Description |
| ---------- | -------------- | --------------------------------------------------- |
| statusCode | `200` | The status code. |
| body | `ResponseBody` | The body type of the operation request or response. |
| Name | Type | Description |
| ---------- | -------------- | ---------------- |
| statusCode | `200` | The status code. |
| body | `ResponseBody` | |

### `CustomerManagedKeyEncryption` {#Azure.ResourceManager.CustomerManagedKeyEncryption}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ interface WidgetParts {
reorderParts is Operations.LongRunningResourceCollectionAction<
WidgetPart,
WidgetPartReorderRequest,
TypeSpec.Http.AcceptedResponse
{}
timotheeguerin marked this conversation as resolved.
Show resolved Hide resolved
>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ interface MarketplaceAgreements extends ResourceListBySubscription<ConfluentAgre
...KeysOf<ConfluentAgreementResource>,

@doc("The agreement details.")
@body
@bodyRoot
agreement: ConfluentAgreementResource,
): ArmResponse<ConfluentAgreementResource> | ErrorResponse;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,10 @@
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "Error object that describes the error when status is \"Failed\"."
},
"result": {
"type": "object",
"description": "The result of the operation."
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,9 @@ paths:
allOf:
- $ref: '#/components/schemas/Azure.Core.Foundations.Error'
description: Error object that describes the error when status is "Failed".
result:
type: object
description: The result of the operation.
description: Provides status details for long running operations.
default:
description: An unexpected error response.
Expand Down
Loading
Loading