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 all 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 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
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
Loading