Azure / Azure/azure-rest-api-specs

`Microsoft.ApiManagement/service/policyFragments@2022-04-01-preview` - `ROUNDTRIP_INCONSISTENT_PROPERTY`

Open
#21,835 1 comment 1 reaction 0 assignees View on GitHub
API Management Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

## Microsoft.ApiManagement/service/policyFragments@2022-04-01-preview - ROUNDTRIP_INCONSISTENT_PROPERTY

### Description

I found differences between PUT request body and GET response:

- .properties.value: expect
```


@{
return ((666 & 0xFF) << 8).ToString();
}

```
, but got
```


@{
return ((666 & 0xFF) << 8).ToString();
}

```
```json
{
"properties": {
"description": "Test policy fragment",
"format": "rawxml",
"value": Got "\r\n\t\r\n\t\t@{\r\n\t\t\treturn ((666 & 0xFF) << 8).ToString();\r\n\t\t}\r\n\t\r\n" in response, expect "\n\t\n\t\t@{\n\t\t\treturn ((666 & 0xFF) << 8).ToString();\n\t\t}\n\t\n\n"
}
}
```

### Details

1. ARM Fully-Qualified Resource Type
```
Microsoft.ApiManagement/service/policyFragments
```

2. API Version
```
2022-04-01-preview
```

3. Swagger issue type
```
Swagger Correctness
```

4. OperationId
```
TODO
e.g., VirtualMachines_Get
```

5. Swagger GitHub permalink
```
TODO,
e.g., https://github.com/Azure/azure-rest-api-specs/blob/60723d13309c8f8060d020a7f3dd9d6e380f0bbd
/specification/compute/resource-manager/Microsoft.Compute/stable/2020-06-01/compute.json#L9065-L9101
```

6. Error code
```
ROUNDTRIP_INCONSISTENT_PROPERTY
```

7. Request traces
```
PUT https://management.azure.com/subscriptions/{subscription_id}/resourceGroups/henglu129/providers/Microsoft.ApiManagement/service/henglu129/policyFragments/henglu129?api-version=2022-04-01-preview
Accept: application/json
Authorization: REDACTED
Content-Length: 341
Content-Type: application/json
User-Agent: HashiCorp Terraform/1.2.8 (+https://www.terraform.io) Terraform Plugin SDK/2.8.0 terraform-provider-azapi/v1.1.0 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: REDACTED
--------------------------------------------------------------------------------
{"properties":{"description":"Test policy fragment","format":"rawxml","value":"\u003cfragment\u003e\n\t\u003cset-header name=\"custom-header\" exists-action=\"override\"\u003e\n\t\t\u003cvalue\u003e@{\n\t\t\treturn ((666 \u0026 0xFF) \u003c\u003c 8).ToString();\n\t\t}\u003c/value\u003e\n\t\u003c/set-header\u003e\n\u003c/fragment\u003e\n"}}
--------------------------------------------------------------------------------

RESPONSE Status: 202 Accepted
Cache-Control: no-cache
Content-Length: 0
Date: Fri, 09 Dec 2022 04:42:46 GMT
Expires: -1
Location: REDACTED
Pragma: no-cache
Server: Microsoft-HTTPAPI/2.0
Strict-Transport-Security: REDACTED
X-Content-Type-Options: REDACTED
X-Ms-Correlation-Request-Id: REDACTED
X-Ms-Ratelimit-Remaining-Subscription-Writes: REDACTED
X-Ms-Request-Id: e86d35b9-68b9-2c50-c545-e1962c8baf6f
X-Ms-Routing-Request-Id: REDACTED
Response contained no body

GET https://management.azure.com/subscriptions/{subscription_id}/resourceGroups/henglu129/providers/Microsoft.ApiManagement/service/henglu129/policyFragments/henglu129?api-version=2022-04-01-preview
Accept: application/json
Authorization: REDACTED
User-Agent: HashiCorp Terraform/1.2.8 (+https://www.terraform.io) Terraform Plugin SDK/2.8.0 terraform-provider-azapi/v1.1.0 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: REDACTED
--------------------------------------------------------------------------------
RESPONSE Status: 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Fri, 09 Dec 2022 04:42:59 GMT
Etag: "JQkAAAAAAAA="
Expires: -1
Pragma: no-cache
Server: Microsoft-HTTPAPI/2.0
Strict-Transport-Security: REDACTED
Vary: REDACTED
X-Content-Type-Options: REDACTED
X-Ms-Correlation-Request-Id: REDACTED
X-Ms-Ratelimit-Remaining-Subscription-Reads: REDACTED
X-Ms-Request-Id: 996ed6f0-b6e1-07c2-ddfa-6325857d9141
X-Ms-Routing-Request-Id: REDACTED
--------------------------------------------------------------------------------
{
"id": "/subscriptions/{subscription_id}/resourceGroups/henglu129/providers/Microsoft.ApiManagement/service/henglu129/policyfragments/henglu129",
"type": "Microsoft.ApiManagement/service/policyFragments",
"name": "henglu129",
"properties": {
"description": "Test policy fragment",
"value": "\r\n\t\r\n\t\t@{\r\n\t\t\treturn ((666 & 0xFF) << 8).ToString();\r\n\t\t}\r\n\t\r\n"
}
}
--------------------------------------------------------------------------------
```

### Links
1. [Semantic and Model Violations Reference](https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/Semantic-and-Model-Violations-Reference.md)
2. [S360 action item generator for Swagger issues](https://aka.ms/swaggers360)

Contributor guide

Open the contributing guide

Research direction

Start with documentation/Semantic-and-Model-Violations-Reference.md and locate the Microsoft.ApiManagement/service/policyFragments 2022-04-01-preview specification. Compare the reported PUT value with the GET response and determine the specification change needed; done means the round-trip no longer produces the reported inconsistency.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.