Skip to content

Commit

Permalink
[Tables] Adding swagger.md (#15016)
Browse files Browse the repository at this point in the history
* adding swagger

* updating swagger with autorest command

* more fixes

* fixing directive

* updating swagger.md

* fixed swagger

* fixing directive

* add dataplane flag

* updating swagger

* commented out tests, passes remaining

* addressing chris hamons feedback

* undoing changes

* undoing the rest of changes

* updating generated code

* formatting gen code

* more formatting corrections

* one last formatting correction
  • Loading branch information
seankane-msft authored Jul 14, 2021
1 parent 3d6b5ce commit 658d8c5
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 15 deletions.
41 changes: 41 additions & 0 deletions sdk/tables/autorest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Go

These settings apply only when `--go` is specified on the command line.

<!-- Original autorest command used by Chris Scott -->
<!-- autorest --use=@autorest/go@4.0.0-preview.20 https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cosmos-db/data-plane/readme.md --tag=package-2019-02 --file-prefix="zz_generated_" --modelerfour.lenient-model-deduplication --license-header=MICROSOFT_MIT_NO_VERSION --output-folder=aztables --module=aztables --openapi-type="data-plane" --credential-scope=none -->

``` yaml
go: true
version: "^3.0.0"
input-file: https://github.com/Azure/azure-rest-api-specs/blob/d744b6bcb95ab4034832ded556dbbe58f4287c5b/specification/cosmos-db/data-plane/Microsoft.Tables/preview/2019-02-02/table.json
license-header: MICROSOFT_MIT_NO_VERSION
clear-output-folder: false
output-folder: aztable
file-prefix: "zz_generated_"
# namespace: aztable
tag: package-2019-02
credential-scope: none
use: "@autorest/go@4.0.0-preview.23"
openapi-type: data-plane
```
<!-- This change will have to be made by hand for now, leaving this directive in case it is useful later -->
<!--
``` yaml
directive:
# dynamically change TableEntityProperties from map[string]interface{} to []byte
- from: swagger-document
where: $.definitions.TableEntityProperties
transform: >-
$["type"] = "string";
$["format"] = "byte";
delete $.additionalProperties;
``` -->
### Go multi-api
``` yaml $(go) && $(multiapi)
batch:
- tag: package-2019-02
```
3 changes: 2 additions & 1 deletion sdk/tables/aztable/table_service_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func NewTableServiceClient(serviceURL string, cred azcore.Credential, options *T
if isCosmosEndpoint(serviceURL) {
conOptions.PerCallPolicies = []azcore.Policy{CosmosPatchTransformPolicy{}}
}
con := newConnection(serviceURL, cred, conOptions)
conOptions.PerCallPolicies = append(conOptions.PerCallPolicies, cred.AuthenticationPolicy(azcore.AuthenticationPolicyOptions{Options: azcore.TokenRequestOptions{Scopes: []string{"none"}}}))
con := newConnection(serviceURL, conOptions)
c, _ := cred.(*SharedKeyCredential)
return &TableServiceClient{client: &tableClient{con}, service: &serviceClient{con}, cred: *c}, nil
}
Expand Down
6 changes: 1 addition & 5 deletions sdk/tables/aztable/zz_generated_connection.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sdk/tables/aztable/zz_generated_constants.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions sdk/tables/aztable/zz_generated_models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 658d8c5

Please sign in to comment.