Skip to content

Commit

Permalink
Update blob swagger spec to a commit on main branch (#31851)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR


### Issues associated with this PR


### Describe the problem that is addressed by this PR


### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
  • Loading branch information
EmmaZhu authored Nov 20, 2024
1 parent 6b0d0e0 commit e3475bc
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion sdk/storage/storage-blob/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ enable-xml: true
generate-metadata: false
license-header: MICROSOFT_MIT_NO_VERSION
output-folder: ../src/generated
input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/2d3b08fe43bc4a573acd166d3d2ba0c631b016fb/specification/storage/data-plane/Microsoft.BlobStorage/stable/2025-01-05/blob.json
input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b478dcdabacb37945ff89daa0eda1ae1afc98db4/specification/storage/data-plane/Microsoft.BlobStorage/stable/2025-01-05/blob.json
model-date-time-as-string: true
optional-response-headers: true
v3: true
Expand Down Expand Up @@ -1483,4 +1483,56 @@ directive:
transform: $.enum = [ "2025-01-05" ];
```

### Remove structured body parameters.

```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}]["get"]
transform: >
$["parameters"] = $["parameters"].filter(function(param) { return false == param['$ref'].endsWith("#/parameters/StructuredBodyGet")});
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}"]["get"]["responses"]["200"]["headers"]
transform: >
delete $["x-ms-structured-body"];
delete $["x-ms-structured-content-length"];
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}"]["get"]["responses"]["200"]["headers"]
transform: >
delete $["x-ms-structured-body"];
delete $["x-ms-structured-content-length"];
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}?BlockBlob"]["put"]
transform: >
$["parameters"] = $["parameters"].filter(function(param) { return (typeof param['$ref'] === "undefined") || (false == param['$ref'].endsWith("#/parameters/StructuredBodyPut") && false == param['$ref'].endsWith("#/parameters/StructuredContentLength"))});
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}?BlockBlob"]["put"]["responses"]["201"]["headers"]
transform: >
delete $["x-ms-structured-body"];
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}?comp=block"]["put"]
transform: >
$["parameters"] = $["parameters"].filter(function(param) { return (typeof param['$ref'] === "undefined") || (false == param['$ref'].endsWith("#/parameters/StructuredBodyPut") && false == param['$ref'].endsWith("#/parameters/StructuredContentLength"))});
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}?comp=block"]["put"]["responses"]["201"]["headers"]
transform: >
delete $["x-ms-structured-body"];
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}?comp=page&update"]["put"]
transform: >
$["parameters"] = $["parameters"].filter(function(param) { return (typeof param['$ref'] === "undefined") || (false == param['$ref'].endsWith("#/parameters/StructuredBodyPut") && false == param['$ref'].endsWith("#/parameters/StructuredContentLength"))});
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}?comp=page&update"]["put"]["responses"]["201"]["headers"]
transform: >
delete $["x-ms-structured-body"];
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}?comp=appendblock"]["put"]
transform: >
$["parameters"] = $["parameters"].filter(function(param) { return (typeof param['$ref'] === "undefined") || (false == param['$ref'].endsWith("#/parameters/StructuredBodyPut") && false == param['$ref'].endsWith("#/parameters/StructuredContentLength"))});
- from: swagger-document
where: $["x-ms-paths"]["/{containerName}/{blob}?comp=appendblock"]["put"]["responses"]["201"]["headers"]
transform: >
delete $["x-ms-structured-body"];
```

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Fstorage-blob%2Fswagger%2FREADME.png)

0 comments on commit e3475bc

Please sign in to comment.