Skip to content

Commit

Permalink
Uptake change to body consistency (#293)
Browse files Browse the repository at this point in the history
Core PR microsoft/typespec#2945

Azure spec PR showing scale of breaking changes
Azure/azure-rest-api-specs#27897
  • Loading branch information
timotheeguerin authored Apr 17, 2024
1 parent 6d0dd91 commit 6a59458
Show file tree
Hide file tree
Showing 31 changed files with 576 additions and 287 deletions.
8 changes: 8 additions & 0 deletions .chronus/changes/uptake-body-consitency-2024-3-16-19-18-52.md
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
9 changes: 9 additions & 0 deletions .chronus/changes/uptake-body-consitency-2024-3-16-19-18-53.md
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`
8 changes: 8 additions & 0 deletions .chronus/changes/uptake-body-consitency-2024-3-16-20-19-22.md
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 34 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
+8 −0 .chronus/changes/fixDirectiveParsing-2024-3-16-17-9-37.md
+67 −1 docs/libraries/http/reference/decorators.md
+2 −0 docs/libraries/http/reference/index.mdx
+7 −5 packages/compiler/src/core/parser.ts
+20 −0 packages/compiler/test/parser.test.ts
+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
2 changes: 1 addition & 1 deletion packages/samples/specs/data-plane/widget-manager/main.tsp
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
never
>;
}

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;
}
Loading

0 comments on commit 6a59458

Please sign in to comment.