Skip to content

Commit

Permalink
fix(sdk): use correct struct for response
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Sep 7, 2022
1 parent abca5ed commit 04b308f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 18 deletions.
4 changes: 2 additions & 2 deletions consent/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (h *Handler) adminGetOAuth2LoginRequest(w http.ResponseWriter, r *http.Requ
return
}
if request.WasHandled {
h.r.Writer().WriteCode(w, r, http.StatusGone, &HandledOAuth2ConsentRequest{
h.r.Writer().WriteCode(w, r, http.StatusGone, &RequestHandlerResponse{
RedirectTo: request.RequestURL,
})
return
Expand Down Expand Up @@ -698,7 +698,7 @@ type adminRejectOAuth2ConsentRequest struct {
// Schemes: http, https
//
// Responses:
// 200: handledOAuth2ConsentRequest
// 200: successfulOAuth2RequestResponse
// default: oAuth2ApiError
func (h *Handler) adminRejectOAuth2ConsentRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
challenge := stringsx.Coalesce(
Expand Down
1 change: 0 additions & 1 deletion internal/httpclient/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
api/openapi.yaml
Expand Down
6 changes: 2 additions & 4 deletions internal/httpclient/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,8 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/handledOAuth2ConsentRequest'
description: handledOAuth2ConsentRequest
$ref: '#/components/schemas/successfulOAuth2RequestResponse'
description: successfulOAuth2RequestResponse
default:
content:
application/json:
Expand Down Expand Up @@ -1919,8 +1919,6 @@ components:
- message
type: object
handledOAuth2ConsentRequest:
example:
redirect_to: redirect_to
properties:
redirect_to:
description: Original request URL to which you should redirect the user
Expand Down
8 changes: 4 additions & 4 deletions internal/httpclient/api_v1.go

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

6 changes: 3 additions & 3 deletions internal/httpclient/docs/V1Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ No authorization required

## AdminRejectOAuth2ConsentRequest

> HandledOAuth2ConsentRequest AdminRejectOAuth2ConsentRequest(ctx).ConsentChallenge(consentChallenge).RejectOAuth2Request(rejectOAuth2Request).Execute()
> SuccessfulOAuth2RequestResponse AdminRejectOAuth2ConsentRequest(ctx).ConsentChallenge(consentChallenge).RejectOAuth2Request(rejectOAuth2Request).Execute()
Reject an OAuth 2.0 Consent Request

Expand Down Expand Up @@ -1596,7 +1596,7 @@ func main() {
fmt.Fprintf(os.Stderr, "Error when calling `V1Api.AdminRejectOAuth2ConsentRequest``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AdminRejectOAuth2ConsentRequest`: HandledOAuth2ConsentRequest
// response from `AdminRejectOAuth2ConsentRequest`: SuccessfulOAuth2RequestResponse
fmt.Fprintf(os.Stdout, "Response from `V1Api.AdminRejectOAuth2ConsentRequest`: %v\n", resp)
}
```
Expand All @@ -1617,7 +1617,7 @@ Name | Type | Description | Notes

### Return type

[**HandledOAuth2ConsentRequest**](HandledOAuth2ConsentRequest.md)
[**SuccessfulOAuth2RequestResponse**](SuccessfulOAuth2RequestResponse.md)

### Authorization

Expand Down
4 changes: 2 additions & 2 deletions spec/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2239,11 +2239,11 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/handledOAuth2ConsentRequest"
"$ref": "#/components/schemas/successfulOAuth2RequestResponse"
}
}
},
"description": "handledOAuth2ConsentRequest"
"description": "successfulOAuth2RequestResponse"
},
"default": {
"content": {
Expand Down
4 changes: 2 additions & 2 deletions spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -827,9 +827,9 @@
],
"responses": {
"200": {
"description": "handledOAuth2ConsentRequest",
"description": "successfulOAuth2RequestResponse",
"schema": {
"$ref": "#/definitions/handledOAuth2ConsentRequest"
"$ref": "#/definitions/successfulOAuth2RequestResponse"
}
},
"default": {
Expand Down

0 comments on commit 04b308f

Please sign in to comment.