Skip to content

Commit

Permalink
Add support for multiple response types (#421)
Browse files Browse the repository at this point in the history
Operations that return different types depending on HTTP status code now
return interface{}.
Generate a method comment that includes the possible return types.
LROs are excluded from this conversion as it's not applicable.
Fixed response envelope generation for multi-response methods.
Remove HTTP redirect status codes for cases where the Go HTTP client
implicitly follows them and added missing tests.
Fixed codegen for checking HTTP status codes of single-response APIs.
Updated test server version which fixed a few urlgroup tests.
  • Loading branch information
jhendrixMSFT authored Jun 10, 2020
1 parent 403d35f commit f9f6f70
Show file tree
Hide file tree
Showing 14 changed files with 752 additions and 584 deletions.
316 changes: 177 additions & 139 deletions src/generator/operations.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"typescript": "~3.7.2",
"@typescript-eslint/eslint-plugin": "~2.6.0",
"@typescript-eslint/parser": "~2.6.0",
"@microsoft.azure/autorest.testserver": "2.10.41",
"@microsoft.azure/autorest.testserver": "2.10.42",
"@autorest/autorest": "~3.0.6173",
"eslint": "~6.6.0",
"@azure-tools/codegen": "~2.4.263",
Expand Down
361 changes: 200 additions & 161 deletions src/transform/transform.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/autorest/generated/azurespecialsgroup/header.go

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

2 changes: 1 addition & 1 deletion test/autorest/generated/errorsgroup/pet.go

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

164 changes: 65 additions & 99 deletions test/autorest/generated/httpinfrastructuregroup/httpredirects.go

Large diffs are not rendered by default.

135 changes: 36 additions & 99 deletions test/autorest/generated/httpinfrastructuregroup/models.go

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

Loading

0 comments on commit f9f6f70

Please sign in to comment.