diff --git a/client/handler.go b/client/handler.go index 79274b8dcf4..d9ac5ab5d65 100644 --- a/client/handler.go +++ b/client/handler.go @@ -109,8 +109,8 @@ type createOAuth2Client struct { // // Responses: // 201: oAuth2Client -// 400: errorBadRequest -// default: errorDefault +// 400: errorOAuth2BadRequest +// default: errorOAuth2Default func (h *Handler) createOAuth2Client(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { c, err := h.CreateClient(r, h.r.ClientValidator().Validate, false) if err != nil { @@ -158,8 +158,8 @@ type createOidcDynamicClient struct { // // Responses: // 201: oAuth2Client -// 400: errorBadRequest -// default: errorDefault +// 400: errorOAuth2BadRequest +// default: errorOAuth2Default func (h *Handler) createOidcDynamicClient(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { if err := h.requireDynamicAuth(r); err != nil { h.r.Writer().WriteError(w, r, err) @@ -267,9 +267,9 @@ type setOAuth2Client struct { // // Responses: // 200: oAuth2Client -// 400: errorBadRequest -// 404: errorNotFound -// default: errorDefault +// 400: errorOAuth2BadRequest +// 404: errorOAuth2NotFound +// default: errorOAuth2Default func (h *Handler) setOAuth2Client(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var c Client if err := json.NewDecoder(r.Body).Decode(&c); err != nil { @@ -354,8 +354,8 @@ type setOidcDynamicClient struct { // // Responses: // 200: oAuth2Client -// 404: errorNotFound -// default: errorDefault +// 404: errorOAuth2NotFound +// default: errorOAuth2Default func (h *Handler) setOidcDynamicClient(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { if err := h.requireDynamicAuth(r); err != nil { h.r.Writer().WriteError(w, r, err) @@ -435,8 +435,8 @@ type patchOAuth2Client struct { // // Responses: // 200: oAuth2Client -// 404: errorNotFound -// default: errorDefault +// 404: errorOAuth2NotFound +// default: errorOAuth2Default func (h *Handler) patchOAuth2Client(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { patchJSON, err := io.ReadAll(r.Body) if err != nil { @@ -520,7 +520,7 @@ type listOAuth2ClientsParameters struct { // // Responses: // 200: listOAuth2Clients -// default: errorDefault +// default: errorOAuth2Default func (h *Handler) listOAuth2Clients(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { page, itemsPerPage := x.ParsePagination(r) filters := Filter{ @@ -584,7 +584,7 @@ type adminGetOAuth2Client struct { // // Responses: // 200: oAuth2Client -// default: errorDefault +// default: errorOAuth2Default func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var id = ps.ByName("id") c, err := h.r.ClientManager().GetConcreteClient(r.Context(), id) @@ -633,7 +633,7 @@ type getOidcDynamicClient struct { // // Responses: // 200: oAuth2Client -// default: errorDefault +// default: errorOAuth2Default func (h *Handler) getOidcDynamicClient(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { if err := h.requireDynamicAuth(r); err != nil { h.r.Writer().WriteError(w, r, err) diff --git a/consent/handler.go b/consent/handler.go index c70b86f6845..e517783d802 100644 --- a/consent/handler.go +++ b/consent/handler.go @@ -116,7 +116,7 @@ type adminRevokeOAuth2ConsentSessions struct { // // Responses: // 204: emptyResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminRevokeOAuth2ConsentSessions(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { subject := r.URL.Query().Get("subject") client := r.URL.Query().Get("client") @@ -177,7 +177,7 @@ type adminListOAuth2SubjectConsentSessions struct { // // Responses: // 200: previousOAuth2ConsentSessions -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminListOAuth2SubjectConsentSessions(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { subject := r.URL.Query().Get("subject") if subject == "" { @@ -242,7 +242,7 @@ type adminRevokeOAuth2LoginSessions struct { // // Responses: // 204: emptyResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminRevokeOAuth2LoginSessions(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { subject := r.URL.Query().Get("subject") if subject == "" { @@ -288,7 +288,7 @@ type adminGetOAuth2LoginRequest struct { // Responses: // 200: oAuth2LoginRequest // 410: handledOAuth2LoginRequest -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminGetOAuth2LoginRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { challenge := stringsx.Coalesce( r.URL.Query().Get("login_challenge"), @@ -354,7 +354,7 @@ type adminAcceptOAuth2LoginRequest struct { // // Responses: // 200: successfulOAuth2RequestResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminAcceptOAuth2LoginRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { challenge := stringsx.Coalesce( r.URL.Query().Get("login_challenge"), @@ -453,7 +453,7 @@ type adminRejectOAuth2LoginRequest struct { // // Responses: // 200: successfulOAuth2RequestResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminRejectOAuth2LoginRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { challenge := stringsx.Coalesce( r.URL.Query().Get("login_challenge"), @@ -534,7 +534,7 @@ type adminGetOAuth2ConsentRequest struct { // Responses: // 200: oAuth2ConsentRequest // 410: handledOAuth2ConsentRequest -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminGetOAuth2ConsentRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { challenge := stringsx.Coalesce( r.URL.Query().Get("consent_challenge"), @@ -610,7 +610,7 @@ type adminAcceptOAuth2ConsentRequest struct { // // Responses: // 200: successfulOAuth2RequestResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminAcceptOAuth2ConsentRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { challenge := stringsx.Coalesce( r.URL.Query().Get("consent_challenge"), @@ -698,7 +698,7 @@ type adminRejectOAuth2ConsentRequest struct { // // Responses: // 200: successfulOAuth2RequestResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminRejectOAuth2ConsentRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { challenge := stringsx.Coalesce( r.URL.Query().Get("consent_challenge"), @@ -769,7 +769,7 @@ type adminAcceptOAuth2LogoutRequest struct { // // Responses: // 200: successfulOAuth2RequestResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminAcceptOAuth2LogoutRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { challenge := stringsx.Coalesce( r.URL.Query().Get("logout_challenge"), @@ -813,7 +813,7 @@ type adminRejectOAuth2LogoutRequest struct { // // Responses: // 204: emptyResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminRejectOAuth2LogoutRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { challenge := stringsx.Coalesce( r.URL.Query().Get("logout_challenge"), @@ -849,7 +849,7 @@ type adminGetOAuth2LogoutRequest struct { // Responses: // 200: oAuth2LogoutRequest // 410: handledOAuth2LogoutRequest -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminGetOAuth2LogoutRequest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { challenge := stringsx.Coalesce( r.URL.Query().Get("logout_challenge"), diff --git a/health/doc.go b/health/doc.go index 8592821c25a..2ada4571212 100644 --- a/health/doc.go +++ b/health/doc.go @@ -20,7 +20,7 @@ package health // // Responses: // 200: healthStatus -// 500: oAuth2ApiError +// 500: errorOAuth2 func swaggerPublicIsInstanceAlive() {} // Alive returns an ok status if the instance is ready to handle HTTP requests. @@ -43,7 +43,7 @@ func swaggerPublicIsInstanceAlive() {} // // Responses: // 200: healthStatus -// 500: oAuth2ApiError +// 500: errorOAuth2 func swaggerAdminIsInstanceAlive() {} // Ready returns an ok status if the instance is ready to handle HTTP requests and all ReadyCheckers are ok. diff --git a/internal/httpclient/.openapi-generator/FILES b/internal/httpclient/.openapi-generator/FILES index e06fce5a9f7..eaad136831b 100644 --- a/internal/httpclient/.openapi-generator/FILES +++ b/internal/httpclient/.openapi-generator/FILES @@ -14,7 +14,7 @@ docs/AcceptOAuth2ConsentRequestSession.md docs/AcceptOAuth2LoginRequest.md docs/AdminCreateJsonWebKeySetBody.md docs/AdminTrustOAuth2JwtGrantIssuerBody.md -docs/ErrorBody.md +docs/ErrorOAuth2.md docs/GenericError.md docs/GetVersion200Response.md docs/HandledOAuth2ConsentRequest.md @@ -31,9 +31,7 @@ docs/JsonPatch.md docs/JsonWebKey.md docs/JsonWebKeySet.md docs/MetadataApi.md -docs/ModelError.md docs/OAuth2AccessRequest.md -docs/OAuth2ApiError.md docs/OAuth2Client.md docs/OAuth2ClientTokenLifespans.md docs/OAuth2ConsentRequest.md @@ -70,8 +68,7 @@ model_accept_o_auth2_consent_request_session.go model_accept_o_auth2_login_request.go model_admin_create_json_web_key_set_body.go model_admin_trust_o_auth2_jwt_grant_issuer_body.go -model_error.go -model_error_body.go +model_error_o_auth2.go model_generic_error.go model_get_version_200_response.go model_handled_o_auth2_consent_request.go @@ -88,7 +85,6 @@ model_json_patch.go model_json_web_key.go model_json_web_key_set.go model_o_auth2_access_request.go -model_o_auth2_api_error.go model_o_auth2_client.go model_o_auth2_client_token_lifespans.go model_o_auth2_consent_request.go diff --git a/internal/httpclient/README.md b/internal/httpclient/README.md index e07d590293b..905509a8048 100644 --- a/internal/httpclient/README.md +++ b/internal/httpclient/README.md @@ -143,7 +143,7 @@ All URIs are relative to _http://localhost_ - [AcceptOAuth2LoginRequest](docs/AcceptOAuth2LoginRequest.md) - [AdminCreateJsonWebKeySetBody](docs/AdminCreateJsonWebKeySetBody.md) - [AdminTrustOAuth2JwtGrantIssuerBody](docs/AdminTrustOAuth2JwtGrantIssuerBody.md) -- [ErrorBody](docs/ErrorBody.md) +- [ErrorOAuth2](docs/ErrorOAuth2.md) - [GenericError](docs/GenericError.md) - [GetVersion200Response](docs/GetVersion200Response.md) - [HandledOAuth2ConsentRequest](docs/HandledOAuth2ConsentRequest.md) @@ -159,9 +159,7 @@ All URIs are relative to _http://localhost_ - [JsonPatch](docs/JsonPatch.md) - [JsonWebKey](docs/JsonWebKey.md) - [JsonWebKeySet](docs/JsonWebKeySet.md) -- [ModelError](docs/ModelError.md) - [OAuth2AccessRequest](docs/OAuth2AccessRequest.md) -- [OAuth2ApiError](docs/OAuth2ApiError.md) - [OAuth2Client](docs/OAuth2Client.md) - [OAuth2ClientTokenLifespans](docs/OAuth2ClientTokenLifespans.md) - [OAuth2ConsentRequest](docs/OAuth2ConsentRequest.md) diff --git a/internal/httpclient/api/openapi.yaml b/internal/httpclient/api/openapi.yaml index 9b993bb14b7..7484488afdf 100644 --- a/internal/httpclient/api/openapi.yaml +++ b/internal/httpclient/api/openapi.yaml @@ -41,8 +41,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Discover JSON Web Keys tags: - v0alpha2 @@ -73,8 +73,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: OpenID Connect Discovery tags: - v0alpha2 @@ -142,7 +142,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Default Error Response summary: List OAuth 2.0 Clients tags: @@ -173,13 +173,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Bad Request Error Response default: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Default Error Response summary: Create OAuth 2.0 Client tags: @@ -249,7 +249,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Default Error Response summary: Get an OAuth 2.0 Client tags: @@ -297,13 +297,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Not Found Error Response default: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Default Error Response summary: Patch OAuth 2.0 Client tags: @@ -351,19 +351,19 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Bad Request Error Response "404": content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Not Found Error Response default: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Default Error Response summary: Set OAuth 2.0 Client tags: @@ -440,8 +440,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Delete a JSON Web Key Set tags: - v0alpha2 @@ -480,8 +480,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Retrieve a JSON Web Key Set tags: - v0alpha2 @@ -533,8 +533,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Generate a New JSON Web Key tags: - v0alpha2 @@ -579,8 +579,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Update a JSON Web Key Set tags: - v0alpha2 @@ -627,8 +627,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Delete a JSON Web Key tags: - v0alpha2 @@ -665,8 +665,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Fetch a JSON Web Key tags: - v0alpha2 @@ -719,8 +719,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Update a JSON Web Key tags: - v0alpha2 @@ -777,8 +777,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Get OAuth 2.0 Consent Request Information tags: - v0alpha2 @@ -846,8 +846,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Accept an OAuth 2.0 Consent Request tags: - v0alpha2 @@ -912,8 +912,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Reject an OAuth 2.0 Consent Request tags: - v0alpha2 @@ -964,8 +964,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Get an OAuth 2.0 Login Request tags: - v0alpha2 @@ -1026,8 +1026,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Accept an OAuth 2.0 Login Request tags: - v0alpha2 @@ -1084,8 +1084,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Reject an OAuth 2.0 Login Request tags: - v0alpha2 @@ -1118,8 +1118,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Get an OAuth 2.0 Logout Request tags: - v0alpha2 @@ -1152,8 +1152,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Accept an OAuth 2.0 Logout Request tags: - v0alpha2 @@ -1194,8 +1194,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Reject an OAuth 2.0 Logout Request tags: - v0alpha2 @@ -1245,8 +1245,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Revokes OAuth 2.0 Consent Sessions of a Subject for a Specific OAuth 2.0 Client @@ -1310,8 +1310,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: List OAuth 2.0 Consent Sessions of a Subject tags: - v0alpha2 @@ -1344,8 +1344,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Invalidates All OAuth 2.0 Login Sessions of a Certain User tags: - v0alpha2 @@ -1378,8 +1378,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Introspect OAuth2 Access or Refresh Tokens tags: - v0alpha2 @@ -1407,8 +1407,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: Delete OAuth2 Access Tokens from a Client tags: - v0alpha2 @@ -1659,8 +1659,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 summary: The OAuth 2.0 Authorize Endpoint tags: - v0alpha2 @@ -1698,13 +1698,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Bad Request Error Response default: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Default Error Response summary: Register OAuth2 Client using OpenID Dynamic Client Registration tags: @@ -1800,7 +1800,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Default Error Response security: - bearer: [] @@ -1864,13 +1864,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Not Found Error Response default: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Default Error Response security: - bearer: [] @@ -1906,8 +1906,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 security: - basic: [] - oauth2: [] @@ -1965,8 +1965,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 security: - basic: [] - oauth2: [] @@ -1998,8 +1998,8 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/oAuth2ApiError" - description: oAuth2ApiError + $ref: "#/components/schemas/errorOAuth2" + description: errorOAuth2 security: - oauth2: [] summary: OpenID Connect Userinfo @@ -2033,23 +2033,23 @@ components: description: "Empty responses are sent when, for example, resources are deleted.\ \ The HTTP status code for empty responses is\ntypically 201." - errorBadRequest: + errorOAuth2BadRequest: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Bad Request Error Response - errorDefault: + errorOAuth2Default: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Default Error Response - errorNotFound: + errorOAuth2NotFound: content: application/json: schema: - $ref: "#/components/schemas/errorBody" + $ref: "#/components/schemas/errorOAuth2" description: Not Found Error Response listOAuth2Clients: content: @@ -2362,114 +2362,39 @@ components: - jwk - scope type: object - error: + errorOAuth2: description: Error + example: + error_debug: error_debug + status_code: 401 + error_description: error_description + error: error + error_hint: The redirect URL is not allowed. properties: - code: - description: HTTP Status Code - example: 404 - format: int64 - type: integer - debug: - description: |- - Debug Details - - This field is often not exposed to protect against leaking - sensitive information. - example: SQL field "foo" is not a bool. - type: string - details: - additionalProperties: {} - description: |- - Additional Error Details - - Further error details - type: object - id: - description: |- - Error ID - - Useful when trying to identify various errors in application logic. + error: + description: Error type: string - message: + error_debug: description: |- - Error Message + Error Debug Information - The error's message. - example: The resource could not be found + Only available in dev mode. type: string - reason: - description: Error Reason - example: User with ID 1234 does not exist. + error_description: + description: Error Description type: string - request: + error_hint: description: |- - HTTP Request ID + Error Hint - The request ID is often exposed internally in order to trace - errors across service architectures. This is often a UUID. - example: d7ef54b1-ec15-46e6-bccb-524b82c035e6 - type: string - status: - description: HTTP Status Description - example: Not Found + Helps the user identify the error cause. + example: The redirect URL is not allowed. type: string - required: - - message - type: object - errorBody: - properties: - code: + status_code: description: HTTP Status Code - example: 404 + example: 401 format: int64 type: integer - debug: - description: |- - Debug Details - - This field is often not exposed to protect against leaking - sensitive information. - example: SQL field "foo" is not a bool. - type: string - details: - additionalProperties: {} - description: |- - Additional Error Details - - Further error details - type: object - id: - description: |- - Error ID - - Useful when trying to identify various errors in application logic. - type: string - message: - description: |- - Error Message - - The error's message. - example: The resource could not be found - type: string - reason: - description: Error Reason - example: User with ID 1234 does not exist. - type: string - request: - description: |- - HTTP Request ID - - The request ID is often exposed internally in order to trace - errors across service architectures. This is often a UUID. - example: d7ef54b1-ec15-46e6-bccb-524b82c035e6 - type: string - status: - description: HTTP Status Description - example: Not Found - type: string - required: - - message type: object genericError: properties: @@ -2964,37 +2889,6 @@ components: type: array title: Requester is a token endpoint's request context. type: object - oAuth2ApiError: - description: An API error caused by Ory's OAuth 2.0 APIs. - example: - error_debug: The database adapter was unable to find the element - status_code: 404 - error_description: Object with ID 12345 does not exist - error: The requested resource could not be found - properties: - error: - description: Name is the error name. - example: The requested resource could not be found - type: string - error_debug: - description: - Debug contains debug information. This is usually not available and - has to be enabled. - example: The database adapter was unable to find the element - type: string - error_description: - description: - Description contains further information on the nature of the error. - example: Object with ID 12345 does not exist - type: string - status_code: - description: - "Code represents the error status code (404, 403, 401, ...)." - example: 404 - format: int64 - type: integer - title: OAuth2 API Error - type: object oAuth2Client: description: "OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect\ diff --git a/internal/httpclient/api_oauth2.go b/internal/httpclient/api_oauth2.go index 2464c01f23a..2eaa1e4c83f 100644 --- a/internal/httpclient/api_oauth2.go +++ b/internal/httpclient/api_oauth2.go @@ -122,7 +122,7 @@ func (a *Oauth2ApiService) CreateOAuth2ClientExecute(r ApiCreateOAuth2ClientRequ error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -131,7 +131,7 @@ func (a *Oauth2ApiService) CreateOAuth2ClientExecute(r ApiCreateOAuth2ClientRequ newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -349,7 +349,7 @@ func (a *Oauth2ApiService) GetOAuth2ClientExecute(r ApiGetOAuth2ClientRequest) ( body: localVarBody, error: localVarHTTPResponse.Status, } - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -497,7 +497,7 @@ func (a *Oauth2ApiService) ListOAuth2ClientsExecute(r ApiListOAuth2ClientsReques body: localVarBody, error: localVarHTTPResponse.Status, } - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -626,7 +626,7 @@ func (a *Oauth2ApiService) PatchOAuth2ClientExecute(r ApiPatchOAuth2ClientReques error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 404 { - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -635,7 +635,7 @@ func (a *Oauth2ApiService) PatchOAuth2ClientExecute(r ApiPatchOAuth2ClientReques newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -765,7 +765,7 @@ func (a *Oauth2ApiService) SetOAuth2ClientExecute(r ApiSetOAuth2ClientRequest) ( error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -775,7 +775,7 @@ func (a *Oauth2ApiService) SetOAuth2ClientExecute(r ApiSetOAuth2ClientRequest) ( return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -784,7 +784,7 @@ func (a *Oauth2ApiService) SetOAuth2ClientExecute(r ApiSetOAuth2ClientRequest) ( newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() diff --git a/internal/httpclient/api_oidc.go b/internal/httpclient/api_oidc.go index 7b2f5f8f2df..1e0dc833c92 100644 --- a/internal/httpclient/api_oidc.go +++ b/internal/httpclient/api_oidc.go @@ -131,7 +131,7 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r ApiCreateOidcDynamicCl error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -140,7 +140,7 @@ func (a *OidcApiService) CreateOidcDynamicClientExecute(r ApiCreateOidcDynamicCl newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -257,7 +257,7 @@ func (a *OidcApiService) GetOidcDynamicClientExecute(r ApiGetOidcDynamicClientRe body: localVarBody, error: localVarHTTPResponse.Status, } - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -395,7 +395,7 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r ApiSetOidcDynamicClientRe error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 404 { - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -404,7 +404,7 @@ func (a *OidcApiService) SetOidcDynamicClientExecute(r ApiSetOidcDynamicClientRe newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - var v ErrorBody + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() diff --git a/internal/httpclient/api_v0alpha2.go b/internal/httpclient/api_v0alpha2.go index 1d487c69086..cd30559019f 100644 --- a/internal/httpclient/api_v0alpha2.go +++ b/internal/httpclient/api_v0alpha2.go @@ -141,7 +141,7 @@ func (a *V0alpha2ApiService) AdminAcceptOAuth2ConsentRequestExecute(r ApiAdminAc body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -278,7 +278,7 @@ func (a *V0alpha2ApiService) AdminAcceptOAuth2LoginRequestExecute(r ApiAdminAcce body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -397,7 +397,7 @@ func (a *V0alpha2ApiService) AdminAcceptOAuth2LogoutRequestExecute(r ApiAdminAcc body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -521,7 +521,7 @@ func (a *V0alpha2ApiService) AdminCreateJsonWebKeySetExecute(r ApiAdminCreateJso body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -635,7 +635,7 @@ func (a *V0alpha2ApiService) AdminDeleteJsonWebKeyExecute(r ApiAdminDeleteJsonWe body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -736,7 +736,7 @@ func (a *V0alpha2ApiService) AdminDeleteJsonWebKeySetExecute(r ApiAdminDeleteJso body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -841,7 +841,7 @@ func (a *V0alpha2ApiService) AdminDeleteOAuth2TokenExecute(r ApiAdminDeleteOAuth body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1050,7 +1050,7 @@ func (a *V0alpha2ApiService) AdminGetJsonWebKeyExecute(r ApiAdminGetJsonWebKeyRe body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1163,7 +1163,7 @@ func (a *V0alpha2ApiService) AdminGetJsonWebKeySetExecute(r ApiAdminGetJsonWebKe body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1299,7 +1299,7 @@ func (a *V0alpha2ApiService) AdminGetOAuth2ConsentRequestExecute(r ApiAdminGetOA newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1432,7 +1432,7 @@ func (a *V0alpha2ApiService) AdminGetOAuth2LoginRequestExecute(r ApiAdminGetOAut newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1559,7 +1559,7 @@ func (a *V0alpha2ApiService) AdminGetOAuth2LogoutRequestExecute(r ApiAdminGetOAu newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1803,7 +1803,7 @@ func (a *V0alpha2ApiService) AdminIntrospectOAuth2TokenExecute(r ApiAdminIntrosp body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1946,7 +1946,7 @@ func (a *V0alpha2ApiService) AdminListOAuth2SubjectConsentSessionsExecute(r ApiA body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -2240,7 +2240,7 @@ func (a *V0alpha2ApiService) AdminRejectOAuth2ConsentRequestExecute(r ApiAdminRe body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -2376,7 +2376,7 @@ func (a *V0alpha2ApiService) AdminRejectOAuth2LoginRequestExecute(r ApiAdminReje body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -2501,7 +2501,7 @@ func (a *V0alpha2ApiService) AdminRejectOAuth2LogoutRequestExecute(r ApiAdminRej body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -2628,7 +2628,7 @@ func (a *V0alpha2ApiService) AdminRevokeOAuth2ConsentSessionsExecute(r ApiAdminR body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -2736,7 +2736,7 @@ func (a *V0alpha2ApiService) AdminRevokeOAuth2LoginSessionsExecute(r ApiAdminRev body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -2969,7 +2969,7 @@ func (a *V0alpha2ApiService) AdminUpdateJsonWebKeyExecute(r ApiAdminUpdateJsonWe body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -3090,7 +3090,7 @@ func (a *V0alpha2ApiService) AdminUpdateJsonWebKeySetExecute(r ApiAdminUpdateJso body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -3308,7 +3308,7 @@ func (a *V0alpha2ApiService) DiscoverJsonWebKeysExecute(r ApiDiscoverJsonWebKeys body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -3420,7 +3420,7 @@ func (a *V0alpha2ApiService) DiscoverOidcConfigurationExecute(r ApiDiscoverOidcC body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -3534,7 +3534,7 @@ func (a *V0alpha2ApiService) GetOidcUserInfoExecute(r ApiGetOidcUserInfoRequest) body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -3561,7 +3561,7 @@ type ApiPerformOAuth2AuthorizationFlowRequest struct { ApiService *V0alpha2ApiService } -func (r ApiPerformOAuth2AuthorizationFlowRequest) Execute() (*OAuth2ApiError, *http.Response, error) { +func (r ApiPerformOAuth2AuthorizationFlowRequest) Execute() (*ErrorOAuth2, *http.Response, error) { return r.ApiService.PerformOAuth2AuthorizationFlowExecute(r) } @@ -3585,13 +3585,13 @@ func (a *V0alpha2ApiService) PerformOAuth2AuthorizationFlow(ctx context.Context) // Execute executes the request // -// @return OAuth2ApiError -func (a *V0alpha2ApiService) PerformOAuth2AuthorizationFlowExecute(r ApiPerformOAuth2AuthorizationFlowRequest) (*OAuth2ApiError, *http.Response, error) { +// @return ErrorOAuth2 +func (a *V0alpha2ApiService) PerformOAuth2AuthorizationFlowExecute(r ApiPerformOAuth2AuthorizationFlowRequest) (*ErrorOAuth2, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *OAuth2ApiError + localVarReturnValue *ErrorOAuth2 ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "V0alpha2ApiService.PerformOAuth2AuthorizationFlow") @@ -3644,7 +3644,7 @@ func (a *V0alpha2ApiService) PerformOAuth2AuthorizationFlowExecute(r ApiPerformO body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -3804,7 +3804,7 @@ func (a *V0alpha2ApiService) PerformOAuth2TokenFlowExecute(r ApiPerformOAuth2Tok body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -4014,7 +4014,7 @@ func (a *V0alpha2ApiService) RevokeOAuth2TokenExecute(r ApiRevokeOAuth2TokenRequ body: localVarBody, error: localVarHTTPResponse.Status, } - var v OAuth2ApiError + var v ErrorOAuth2 err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() diff --git a/internal/httpclient/docs/ErrorBody.md b/internal/httpclient/docs/ErrorBody.md deleted file mode 100644 index 350d63cab9b..00000000000 --- a/internal/httpclient/docs/ErrorBody.md +++ /dev/null @@ -1,231 +0,0 @@ -# ErrorBody - -## Properties - -| Name | Type | Description | Notes | -| ----------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -| **Code** | Pointer to **int64** | HTTP Status Code | [optional] | -| **Debug** | Pointer to **string** | Debug Details This field is often not exposed to protect against leaking sensitive information. | [optional] | -| **Details** | Pointer to **map[string]interface{}** | Additional Error Details Further error details | [optional] | -| **Id** | Pointer to **string** | Error ID Useful when trying to identify various errors in application logic. | [optional] | -| **Message** | **string** | Error Message The error's message. | -| **Reason** | Pointer to **string** | Error Reason | [optional] | -| **Request** | Pointer to **string** | HTTP Request ID The request ID is often exposed internally in order to trace errors across service architectures. This is often a UUID. | [optional] | -| **Status** | Pointer to **string** | HTTP Status Description | [optional] | - -## Methods - -### NewErrorBody - -`func NewErrorBody(message string, ) *ErrorBody` - -NewErrorBody instantiates a new ErrorBody object This constructor will assign -default values to properties that have it defined, and makes sure properties -required by API are set, but the set of arguments will change when the set of -required properties is changed - -### NewErrorBodyWithDefaults - -`func NewErrorBodyWithDefaults() *ErrorBody` - -NewErrorBodyWithDefaults instantiates a new ErrorBody object This constructor -will only assign default values to properties that have it defined, but it -doesn't guarantee that properties required by API are set - -### GetCode - -`func (o *ErrorBody) GetCode() int64` - -GetCode returns the Code field if non-nil, zero value otherwise. - -### GetCodeOk - -`func (o *ErrorBody) GetCodeOk() (*int64, bool)` - -GetCodeOk returns a tuple with the Code field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetCode - -`func (o *ErrorBody) SetCode(v int64)` - -SetCode sets Code field to given value. - -### HasCode - -`func (o *ErrorBody) HasCode() bool` - -HasCode returns a boolean if a field has been set. - -### GetDebug - -`func (o *ErrorBody) GetDebug() string` - -GetDebug returns the Debug field if non-nil, zero value otherwise. - -### GetDebugOk - -`func (o *ErrorBody) GetDebugOk() (*string, bool)` - -GetDebugOk returns a tuple with the Debug field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetDebug - -`func (o *ErrorBody) SetDebug(v string)` - -SetDebug sets Debug field to given value. - -### HasDebug - -`func (o *ErrorBody) HasDebug() bool` - -HasDebug returns a boolean if a field has been set. - -### GetDetails - -`func (o *ErrorBody) GetDetails() map[string]interface{}` - -GetDetails returns the Details field if non-nil, zero value otherwise. - -### GetDetailsOk - -`func (o *ErrorBody) GetDetailsOk() (*map[string]interface{}, bool)` - -GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetDetails - -`func (o *ErrorBody) SetDetails(v map[string]interface{})` - -SetDetails sets Details field to given value. - -### HasDetails - -`func (o *ErrorBody) HasDetails() bool` - -HasDetails returns a boolean if a field has been set. - -### GetId - -`func (o *ErrorBody) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ErrorBody) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ErrorBody) SetId(v string)` - -SetId sets Id field to given value. - -### HasId - -`func (o *ErrorBody) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetMessage - -`func (o *ErrorBody) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *ErrorBody) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetMessage - -`func (o *ErrorBody) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### GetReason - -`func (o *ErrorBody) GetReason() string` - -GetReason returns the Reason field if non-nil, zero value otherwise. - -### GetReasonOk - -`func (o *ErrorBody) GetReasonOk() (*string, bool)` - -GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetReason - -`func (o *ErrorBody) SetReason(v string)` - -SetReason sets Reason field to given value. - -### HasReason - -`func (o *ErrorBody) HasReason() bool` - -HasReason returns a boolean if a field has been set. - -### GetRequest - -`func (o *ErrorBody) GetRequest() string` - -GetRequest returns the Request field if non-nil, zero value otherwise. - -### GetRequestOk - -`func (o *ErrorBody) GetRequestOk() (*string, bool)` - -GetRequestOk returns a tuple with the Request field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetRequest - -`func (o *ErrorBody) SetRequest(v string)` - -SetRequest sets Request field to given value. - -### HasRequest - -`func (o *ErrorBody) HasRequest() bool` - -HasRequest returns a boolean if a field has been set. - -### GetStatus - -`func (o *ErrorBody) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *ErrorBody) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetStatus - -`func (o *ErrorBody) SetStatus(v string)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *ErrorBody) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/internal/httpclient/docs/ErrorOAuth2.md b/internal/httpclient/docs/ErrorOAuth2.md new file mode 100644 index 00000000000..10ad3c6471f --- /dev/null +++ b/internal/httpclient/docs/ErrorOAuth2.md @@ -0,0 +1,160 @@ +# ErrorOAuth2 + +## Properties + +| Name | Type | Description | Notes | +| -------------------- | --------------------- | --------------------------------------------------- | ---------- | +| **Error** | Pointer to **string** | Error | [optional] | +| **ErrorDebug** | Pointer to **string** | Error Debug Information Only available in dev mode. | [optional] | +| **ErrorDescription** | Pointer to **string** | Error Description | [optional] | +| **ErrorHint** | Pointer to **string** | Error Hint Helps the user identify the error cause. | [optional] | +| **StatusCode** | Pointer to **int64** | HTTP Status Code | [optional] | + +## Methods + +### NewErrorOAuth2 + +`func NewErrorOAuth2() *ErrorOAuth2` + +NewErrorOAuth2 instantiates a new ErrorOAuth2 object This constructor will +assign default values to properties that have it defined, and makes sure +properties required by API are set, but the set of arguments will change when +the set of required properties is changed + +### NewErrorOAuth2WithDefaults + +`func NewErrorOAuth2WithDefaults() *ErrorOAuth2` + +NewErrorOAuth2WithDefaults instantiates a new ErrorOAuth2 object This +constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *ErrorOAuth2) GetError() string` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ErrorOAuth2) GetErrorOk() (*string, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value +otherwise and a boolean to check if the value has been set. + +### SetError + +`func (o *ErrorOAuth2) SetError(v string)` + +SetError sets Error field to given value. + +### HasError + +`func (o *ErrorOAuth2) HasError() bool` + +HasError returns a boolean if a field has been set. + +### GetErrorDebug + +`func (o *ErrorOAuth2) GetErrorDebug() string` + +GetErrorDebug returns the ErrorDebug field if non-nil, zero value otherwise. + +### GetErrorDebugOk + +`func (o *ErrorOAuth2) GetErrorDebugOk() (*string, bool)` + +GetErrorDebugOk returns a tuple with the ErrorDebug field if it's non-nil, zero +value otherwise and a boolean to check if the value has been set. + +### SetErrorDebug + +`func (o *ErrorOAuth2) SetErrorDebug(v string)` + +SetErrorDebug sets ErrorDebug field to given value. + +### HasErrorDebug + +`func (o *ErrorOAuth2) HasErrorDebug() bool` + +HasErrorDebug returns a boolean if a field has been set. + +### GetErrorDescription + +`func (o *ErrorOAuth2) GetErrorDescription() string` + +GetErrorDescription returns the ErrorDescription field if non-nil, zero value +otherwise. + +### GetErrorDescriptionOk + +`func (o *ErrorOAuth2) GetErrorDescriptionOk() (*string, bool)` + +GetErrorDescriptionOk returns a tuple with the ErrorDescription field if it's +non-nil, zero value otherwise and a boolean to check if the value has been set. + +### SetErrorDescription + +`func (o *ErrorOAuth2) SetErrorDescription(v string)` + +SetErrorDescription sets ErrorDescription field to given value. + +### HasErrorDescription + +`func (o *ErrorOAuth2) HasErrorDescription() bool` + +HasErrorDescription returns a boolean if a field has been set. + +### GetErrorHint + +`func (o *ErrorOAuth2) GetErrorHint() string` + +GetErrorHint returns the ErrorHint field if non-nil, zero value otherwise. + +### GetErrorHintOk + +`func (o *ErrorOAuth2) GetErrorHintOk() (*string, bool)` + +GetErrorHintOk returns a tuple with the ErrorHint field if it's non-nil, zero +value otherwise and a boolean to check if the value has been set. + +### SetErrorHint + +`func (o *ErrorOAuth2) SetErrorHint(v string)` + +SetErrorHint sets ErrorHint field to given value. + +### HasErrorHint + +`func (o *ErrorOAuth2) HasErrorHint() bool` + +HasErrorHint returns a boolean if a field has been set. + +### GetStatusCode + +`func (o *ErrorOAuth2) GetStatusCode() int64` + +GetStatusCode returns the StatusCode field if non-nil, zero value otherwise. + +### GetStatusCodeOk + +`func (o *ErrorOAuth2) GetStatusCodeOk() (*int64, bool)` + +GetStatusCodeOk returns a tuple with the StatusCode field if it's non-nil, zero +value otherwise and a boolean to check if the value has been set. + +### SetStatusCode + +`func (o *ErrorOAuth2) SetStatusCode(v int64)` + +SetStatusCode sets StatusCode field to given value. + +### HasStatusCode + +`func (o *ErrorOAuth2) HasStatusCode() bool` + +HasStatusCode returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/internal/httpclient/docs/ModelError.md b/internal/httpclient/docs/ModelError.md deleted file mode 100644 index 485c54671e0..00000000000 --- a/internal/httpclient/docs/ModelError.md +++ /dev/null @@ -1,231 +0,0 @@ -# ModelError - -## Properties - -| Name | Type | Description | Notes | -| ----------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -| **Code** | Pointer to **int64** | HTTP Status Code | [optional] | -| **Debug** | Pointer to **string** | Debug Details This field is often not exposed to protect against leaking sensitive information. | [optional] | -| **Details** | Pointer to **map[string]interface{}** | Additional Error Details Further error details | [optional] | -| **Id** | Pointer to **string** | Error ID Useful when trying to identify various errors in application logic. | [optional] | -| **Message** | **string** | Error Message The error's message. | -| **Reason** | Pointer to **string** | Error Reason | [optional] | -| **Request** | Pointer to **string** | HTTP Request ID The request ID is often exposed internally in order to trace errors across service architectures. This is often a UUID. | [optional] | -| **Status** | Pointer to **string** | HTTP Status Description | [optional] | - -## Methods - -### NewModelError - -`func NewModelError(message string, ) *ModelError` - -NewModelError instantiates a new ModelError object This constructor will assign -default values to properties that have it defined, and makes sure properties -required by API are set, but the set of arguments will change when the set of -required properties is changed - -### NewModelErrorWithDefaults - -`func NewModelErrorWithDefaults() *ModelError` - -NewModelErrorWithDefaults instantiates a new ModelError object This constructor -will only assign default values to properties that have it defined, but it -doesn't guarantee that properties required by API are set - -### GetCode - -`func (o *ModelError) GetCode() int64` - -GetCode returns the Code field if non-nil, zero value otherwise. - -### GetCodeOk - -`func (o *ModelError) GetCodeOk() (*int64, bool)` - -GetCodeOk returns a tuple with the Code field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetCode - -`func (o *ModelError) SetCode(v int64)` - -SetCode sets Code field to given value. - -### HasCode - -`func (o *ModelError) HasCode() bool` - -HasCode returns a boolean if a field has been set. - -### GetDebug - -`func (o *ModelError) GetDebug() string` - -GetDebug returns the Debug field if non-nil, zero value otherwise. - -### GetDebugOk - -`func (o *ModelError) GetDebugOk() (*string, bool)` - -GetDebugOk returns a tuple with the Debug field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetDebug - -`func (o *ModelError) SetDebug(v string)` - -SetDebug sets Debug field to given value. - -### HasDebug - -`func (o *ModelError) HasDebug() bool` - -HasDebug returns a boolean if a field has been set. - -### GetDetails - -`func (o *ModelError) GetDetails() map[string]interface{}` - -GetDetails returns the Details field if non-nil, zero value otherwise. - -### GetDetailsOk - -`func (o *ModelError) GetDetailsOk() (*map[string]interface{}, bool)` - -GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetDetails - -`func (o *ModelError) SetDetails(v map[string]interface{})` - -SetDetails sets Details field to given value. - -### HasDetails - -`func (o *ModelError) HasDetails() bool` - -HasDetails returns a boolean if a field has been set. - -### GetId - -`func (o *ModelError) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ModelError) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ModelError) SetId(v string)` - -SetId sets Id field to given value. - -### HasId - -`func (o *ModelError) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetMessage - -`func (o *ModelError) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *ModelError) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetMessage - -`func (o *ModelError) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### GetReason - -`func (o *ModelError) GetReason() string` - -GetReason returns the Reason field if non-nil, zero value otherwise. - -### GetReasonOk - -`func (o *ModelError) GetReasonOk() (*string, bool)` - -GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetReason - -`func (o *ModelError) SetReason(v string)` - -SetReason sets Reason field to given value. - -### HasReason - -`func (o *ModelError) HasReason() bool` - -HasReason returns a boolean if a field has been set. - -### GetRequest - -`func (o *ModelError) GetRequest() string` - -GetRequest returns the Request field if non-nil, zero value otherwise. - -### GetRequestOk - -`func (o *ModelError) GetRequestOk() (*string, bool)` - -GetRequestOk returns a tuple with the Request field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetRequest - -`func (o *ModelError) SetRequest(v string)` - -SetRequest sets Request field to given value. - -### HasRequest - -`func (o *ModelError) HasRequest() bool` - -HasRequest returns a boolean if a field has been set. - -### GetStatus - -`func (o *ModelError) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *ModelError) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetStatus - -`func (o *ModelError) SetStatus(v string)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *ModelError) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/internal/httpclient/docs/OAuth2ApiError.md b/internal/httpclient/docs/OAuth2ApiError.md deleted file mode 100644 index 5982680f5fa..00000000000 --- a/internal/httpclient/docs/OAuth2ApiError.md +++ /dev/null @@ -1,134 +0,0 @@ -# OAuth2ApiError - -## Properties - -| Name | Type | Description | Notes | -| -------------------- | --------------------- | -------------------------------------------------------------------------------------- | ---------- | -| **Error** | Pointer to **string** | Name is the error name. | [optional] | -| **ErrorDebug** | Pointer to **string** | Debug contains debug information. This is usually not available and has to be enabled. | [optional] | -| **ErrorDescription** | Pointer to **string** | Description contains further information on the nature of the error. | [optional] | -| **StatusCode** | Pointer to **int64** | Code represents the error status code (404, 403, 401, ...). | [optional] | - -## Methods - -### NewOAuth2ApiError - -`func NewOAuth2ApiError() *OAuth2ApiError` - -NewOAuth2ApiError instantiates a new OAuth2ApiError object This constructor will -assign default values to properties that have it defined, and makes sure -properties required by API are set, but the set of arguments will change when -the set of required properties is changed - -### NewOAuth2ApiErrorWithDefaults - -`func NewOAuth2ApiErrorWithDefaults() *OAuth2ApiError` - -NewOAuth2ApiErrorWithDefaults instantiates a new OAuth2ApiError object This -constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetError - -`func (o *OAuth2ApiError) GetError() string` - -GetError returns the Error field if non-nil, zero value otherwise. - -### GetErrorOk - -`func (o *OAuth2ApiError) GetErrorOk() (*string, bool)` - -GetErrorOk returns a tuple with the Error field if it's non-nil, zero value -otherwise and a boolean to check if the value has been set. - -### SetError - -`func (o *OAuth2ApiError) SetError(v string)` - -SetError sets Error field to given value. - -### HasError - -`func (o *OAuth2ApiError) HasError() bool` - -HasError returns a boolean if a field has been set. - -### GetErrorDebug - -`func (o *OAuth2ApiError) GetErrorDebug() string` - -GetErrorDebug returns the ErrorDebug field if non-nil, zero value otherwise. - -### GetErrorDebugOk - -`func (o *OAuth2ApiError) GetErrorDebugOk() (*string, bool)` - -GetErrorDebugOk returns a tuple with the ErrorDebug field if it's non-nil, zero -value otherwise and a boolean to check if the value has been set. - -### SetErrorDebug - -`func (o *OAuth2ApiError) SetErrorDebug(v string)` - -SetErrorDebug sets ErrorDebug field to given value. - -### HasErrorDebug - -`func (o *OAuth2ApiError) HasErrorDebug() bool` - -HasErrorDebug returns a boolean if a field has been set. - -### GetErrorDescription - -`func (o *OAuth2ApiError) GetErrorDescription() string` - -GetErrorDescription returns the ErrorDescription field if non-nil, zero value -otherwise. - -### GetErrorDescriptionOk - -`func (o *OAuth2ApiError) GetErrorDescriptionOk() (*string, bool)` - -GetErrorDescriptionOk returns a tuple with the ErrorDescription field if it's -non-nil, zero value otherwise and a boolean to check if the value has been set. - -### SetErrorDescription - -`func (o *OAuth2ApiError) SetErrorDescription(v string)` - -SetErrorDescription sets ErrorDescription field to given value. - -### HasErrorDescription - -`func (o *OAuth2ApiError) HasErrorDescription() bool` - -HasErrorDescription returns a boolean if a field has been set. - -### GetStatusCode - -`func (o *OAuth2ApiError) GetStatusCode() int64` - -GetStatusCode returns the StatusCode field if non-nil, zero value otherwise. - -### GetStatusCodeOk - -`func (o *OAuth2ApiError) GetStatusCodeOk() (*int64, bool)` - -GetStatusCodeOk returns a tuple with the StatusCode field if it's non-nil, zero -value otherwise and a boolean to check if the value has been set. - -### SetStatusCode - -`func (o *OAuth2ApiError) SetStatusCode(v int64)` - -SetStatusCode sets StatusCode field to given value. - -### HasStatusCode - -`func (o *OAuth2ApiError) HasStatusCode() bool` - -HasStatusCode returns a boolean if a field has been set. - -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to README]](../README.md) diff --git a/internal/httpclient/docs/V0alpha2Api.md b/internal/httpclient/docs/V0alpha2Api.md index 85f7aae8f14..fb8915862e4 100644 --- a/internal/httpclient/docs/V0alpha2Api.md +++ b/internal/httpclient/docs/V0alpha2Api.md @@ -1915,7 +1915,7 @@ struct via the builder pattern ## PerformOAuth2AuthorizationFlow -> OAuth2ApiError PerformOAuth2AuthorizationFlow(ctx).Execute() +> ErrorOAuth2 PerformOAuth2AuthorizationFlow(ctx).Execute() The OAuth 2.0 Authorize Endpoint @@ -1940,7 +1940,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `V0alpha2Api.PerformOAuth2AuthorizationFlow``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `PerformOAuth2AuthorizationFlow`: OAuth2ApiError + // response from `PerformOAuth2AuthorizationFlow`: ErrorOAuth2 fmt.Fprintf(os.Stdout, "Response from `V0alpha2Api.PerformOAuth2AuthorizationFlow`: %v\n", resp) } ``` @@ -1956,7 +1956,7 @@ apiPerformOAuth2AuthorizationFlowRequest struct via the builder pattern ### Return type -[**OAuth2ApiError**](OAuth2ApiError.md) +[**ErrorOAuth2**](ErrorOAuth2.md) ### Authorization diff --git a/internal/httpclient/model_error.go b/internal/httpclient/model_error.go deleted file mode 100644 index 0f0064c67e1..00000000000 --- a/internal/httpclient/model_error.go +++ /dev/null @@ -1,367 +0,0 @@ -/* -Ory Hydra API - -Documentation for all of Ory Hydra's APIs. - -API version: -Contact: hi@ory.sh -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "encoding/json" -) - -// ModelError Error -type ModelError struct { - // HTTP Status Code - Code *int64 `json:"code,omitempty"` - // Debug Details This field is often not exposed to protect against leaking sensitive information. - Debug *string `json:"debug,omitempty"` - // Additional Error Details Further error details - Details map[string]interface{} `json:"details,omitempty"` - // Error ID Useful when trying to identify various errors in application logic. - Id *string `json:"id,omitempty"` - // Error Message The error's message. - Message string `json:"message"` - // Error Reason - Reason *string `json:"reason,omitempty"` - // HTTP Request ID The request ID is often exposed internally in order to trace errors across service architectures. This is often a UUID. - Request *string `json:"request,omitempty"` - // HTTP Status Description - Status *string `json:"status,omitempty"` -} - -// NewModelError instantiates a new ModelError object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewModelError(message string) *ModelError { - this := ModelError{} - this.Message = message - return &this -} - -// NewModelErrorWithDefaults instantiates a new ModelError object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewModelErrorWithDefaults() *ModelError { - this := ModelError{} - return &this -} - -// GetCode returns the Code field value if set, zero value otherwise. -func (o *ModelError) GetCode() int64 { - if o == nil || o.Code == nil { - var ret int64 - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelError) GetCodeOk() (*int64, bool) { - if o == nil || o.Code == nil { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *ModelError) HasCode() bool { - if o != nil && o.Code != nil { - return true - } - - return false -} - -// SetCode gets a reference to the given int64 and assigns it to the Code field. -func (o *ModelError) SetCode(v int64) { - o.Code = &v -} - -// GetDebug returns the Debug field value if set, zero value otherwise. -func (o *ModelError) GetDebug() string { - if o == nil || o.Debug == nil { - var ret string - return ret - } - return *o.Debug -} - -// GetDebugOk returns a tuple with the Debug field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelError) GetDebugOk() (*string, bool) { - if o == nil || o.Debug == nil { - return nil, false - } - return o.Debug, true -} - -// HasDebug returns a boolean if a field has been set. -func (o *ModelError) HasDebug() bool { - if o != nil && o.Debug != nil { - return true - } - - return false -} - -// SetDebug gets a reference to the given string and assigns it to the Debug field. -func (o *ModelError) SetDebug(v string) { - o.Debug = &v -} - -// GetDetails returns the Details field value if set, zero value otherwise. -func (o *ModelError) GetDetails() map[string]interface{} { - if o == nil || o.Details == nil { - var ret map[string]interface{} - return ret - } - return o.Details -} - -// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelError) GetDetailsOk() (map[string]interface{}, bool) { - if o == nil || o.Details == nil { - return nil, false - } - return o.Details, true -} - -// HasDetails returns a boolean if a field has been set. -func (o *ModelError) HasDetails() bool { - if o != nil && o.Details != nil { - return true - } - - return false -} - -// SetDetails gets a reference to the given map[string]interface{} and assigns it to the Details field. -func (o *ModelError) SetDetails(v map[string]interface{}) { - o.Details = v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *ModelError) GetId() string { - if o == nil || o.Id == nil { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelError) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *ModelError) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *ModelError) SetId(v string) { - o.Id = &v -} - -// GetMessage returns the Message field value -func (o *ModelError) GetMessage() string { - if o == nil { - var ret string - return ret - } - - return o.Message -} - -// GetMessageOk returns a tuple with the Message field value -// and a boolean to check if the value has been set. -func (o *ModelError) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Message, true -} - -// SetMessage sets field value -func (o *ModelError) SetMessage(v string) { - o.Message = v -} - -// GetReason returns the Reason field value if set, zero value otherwise. -func (o *ModelError) GetReason() string { - if o == nil || o.Reason == nil { - var ret string - return ret - } - return *o.Reason -} - -// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelError) GetReasonOk() (*string, bool) { - if o == nil || o.Reason == nil { - return nil, false - } - return o.Reason, true -} - -// HasReason returns a boolean if a field has been set. -func (o *ModelError) HasReason() bool { - if o != nil && o.Reason != nil { - return true - } - - return false -} - -// SetReason gets a reference to the given string and assigns it to the Reason field. -func (o *ModelError) SetReason(v string) { - o.Reason = &v -} - -// GetRequest returns the Request field value if set, zero value otherwise. -func (o *ModelError) GetRequest() string { - if o == nil || o.Request == nil { - var ret string - return ret - } - return *o.Request -} - -// GetRequestOk returns a tuple with the Request field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelError) GetRequestOk() (*string, bool) { - if o == nil || o.Request == nil { - return nil, false - } - return o.Request, true -} - -// HasRequest returns a boolean if a field has been set. -func (o *ModelError) HasRequest() bool { - if o != nil && o.Request != nil { - return true - } - - return false -} - -// SetRequest gets a reference to the given string and assigns it to the Request field. -func (o *ModelError) SetRequest(v string) { - o.Request = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *ModelError) GetStatus() string { - if o == nil || o.Status == nil { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ModelError) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *ModelError) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *ModelError) SetStatus(v string) { - o.Status = &v -} - -func (o ModelError) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Code != nil { - toSerialize["code"] = o.Code - } - if o.Debug != nil { - toSerialize["debug"] = o.Debug - } - if o.Details != nil { - toSerialize["details"] = o.Details - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if true { - toSerialize["message"] = o.Message - } - if o.Reason != nil { - toSerialize["reason"] = o.Reason - } - if o.Request != nil { - toSerialize["request"] = o.Request - } - if o.Status != nil { - toSerialize["status"] = o.Status - } - return json.Marshal(toSerialize) -} - -type NullableModelError struct { - value *ModelError - isSet bool -} - -func (v NullableModelError) Get() *ModelError { - return v.value -} - -func (v *NullableModelError) Set(val *ModelError) { - v.value = val - v.isSet = true -} - -func (v NullableModelError) IsSet() bool { - return v.isSet -} - -func (v *NullableModelError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModelError(val *ModelError) *NullableModelError { - return &NullableModelError{value: val, isSet: true} -} - -func (v NullableModelError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModelError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient/model_error_body.go b/internal/httpclient/model_error_body.go deleted file mode 100644 index fb4c1563b03..00000000000 --- a/internal/httpclient/model_error_body.go +++ /dev/null @@ -1,367 +0,0 @@ -/* -Ory Hydra API - -Documentation for all of Ory Hydra's APIs. - -API version: -Contact: hi@ory.sh -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "encoding/json" -) - -// ErrorBody struct for ErrorBody -type ErrorBody struct { - // HTTP Status Code - Code *int64 `json:"code,omitempty"` - // Debug Details This field is often not exposed to protect against leaking sensitive information. - Debug *string `json:"debug,omitempty"` - // Additional Error Details Further error details - Details map[string]interface{} `json:"details,omitempty"` - // Error ID Useful when trying to identify various errors in application logic. - Id *string `json:"id,omitempty"` - // Error Message The error's message. - Message string `json:"message"` - // Error Reason - Reason *string `json:"reason,omitempty"` - // HTTP Request ID The request ID is often exposed internally in order to trace errors across service architectures. This is often a UUID. - Request *string `json:"request,omitempty"` - // HTTP Status Description - Status *string `json:"status,omitempty"` -} - -// NewErrorBody instantiates a new ErrorBody object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewErrorBody(message string) *ErrorBody { - this := ErrorBody{} - this.Message = message - return &this -} - -// NewErrorBodyWithDefaults instantiates a new ErrorBody object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewErrorBodyWithDefaults() *ErrorBody { - this := ErrorBody{} - return &this -} - -// GetCode returns the Code field value if set, zero value otherwise. -func (o *ErrorBody) GetCode() int64 { - if o == nil || o.Code == nil { - var ret int64 - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorBody) GetCodeOk() (*int64, bool) { - if o == nil || o.Code == nil { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *ErrorBody) HasCode() bool { - if o != nil && o.Code != nil { - return true - } - - return false -} - -// SetCode gets a reference to the given int64 and assigns it to the Code field. -func (o *ErrorBody) SetCode(v int64) { - o.Code = &v -} - -// GetDebug returns the Debug field value if set, zero value otherwise. -func (o *ErrorBody) GetDebug() string { - if o == nil || o.Debug == nil { - var ret string - return ret - } - return *o.Debug -} - -// GetDebugOk returns a tuple with the Debug field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorBody) GetDebugOk() (*string, bool) { - if o == nil || o.Debug == nil { - return nil, false - } - return o.Debug, true -} - -// HasDebug returns a boolean if a field has been set. -func (o *ErrorBody) HasDebug() bool { - if o != nil && o.Debug != nil { - return true - } - - return false -} - -// SetDebug gets a reference to the given string and assigns it to the Debug field. -func (o *ErrorBody) SetDebug(v string) { - o.Debug = &v -} - -// GetDetails returns the Details field value if set, zero value otherwise. -func (o *ErrorBody) GetDetails() map[string]interface{} { - if o == nil || o.Details == nil { - var ret map[string]interface{} - return ret - } - return o.Details -} - -// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorBody) GetDetailsOk() (map[string]interface{}, bool) { - if o == nil || o.Details == nil { - return nil, false - } - return o.Details, true -} - -// HasDetails returns a boolean if a field has been set. -func (o *ErrorBody) HasDetails() bool { - if o != nil && o.Details != nil { - return true - } - - return false -} - -// SetDetails gets a reference to the given map[string]interface{} and assigns it to the Details field. -func (o *ErrorBody) SetDetails(v map[string]interface{}) { - o.Details = v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *ErrorBody) GetId() string { - if o == nil || o.Id == nil { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorBody) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *ErrorBody) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *ErrorBody) SetId(v string) { - o.Id = &v -} - -// GetMessage returns the Message field value -func (o *ErrorBody) GetMessage() string { - if o == nil { - var ret string - return ret - } - - return o.Message -} - -// GetMessageOk returns a tuple with the Message field value -// and a boolean to check if the value has been set. -func (o *ErrorBody) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Message, true -} - -// SetMessage sets field value -func (o *ErrorBody) SetMessage(v string) { - o.Message = v -} - -// GetReason returns the Reason field value if set, zero value otherwise. -func (o *ErrorBody) GetReason() string { - if o == nil || o.Reason == nil { - var ret string - return ret - } - return *o.Reason -} - -// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorBody) GetReasonOk() (*string, bool) { - if o == nil || o.Reason == nil { - return nil, false - } - return o.Reason, true -} - -// HasReason returns a boolean if a field has been set. -func (o *ErrorBody) HasReason() bool { - if o != nil && o.Reason != nil { - return true - } - - return false -} - -// SetReason gets a reference to the given string and assigns it to the Reason field. -func (o *ErrorBody) SetReason(v string) { - o.Reason = &v -} - -// GetRequest returns the Request field value if set, zero value otherwise. -func (o *ErrorBody) GetRequest() string { - if o == nil || o.Request == nil { - var ret string - return ret - } - return *o.Request -} - -// GetRequestOk returns a tuple with the Request field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorBody) GetRequestOk() (*string, bool) { - if o == nil || o.Request == nil { - return nil, false - } - return o.Request, true -} - -// HasRequest returns a boolean if a field has been set. -func (o *ErrorBody) HasRequest() bool { - if o != nil && o.Request != nil { - return true - } - - return false -} - -// SetRequest gets a reference to the given string and assigns it to the Request field. -func (o *ErrorBody) SetRequest(v string) { - o.Request = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *ErrorBody) GetStatus() string { - if o == nil || o.Status == nil { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ErrorBody) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *ErrorBody) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *ErrorBody) SetStatus(v string) { - o.Status = &v -} - -func (o ErrorBody) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Code != nil { - toSerialize["code"] = o.Code - } - if o.Debug != nil { - toSerialize["debug"] = o.Debug - } - if o.Details != nil { - toSerialize["details"] = o.Details - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - if true { - toSerialize["message"] = o.Message - } - if o.Reason != nil { - toSerialize["reason"] = o.Reason - } - if o.Request != nil { - toSerialize["request"] = o.Request - } - if o.Status != nil { - toSerialize["status"] = o.Status - } - return json.Marshal(toSerialize) -} - -type NullableErrorBody struct { - value *ErrorBody - isSet bool -} - -func (v NullableErrorBody) Get() *ErrorBody { - return v.value -} - -func (v *NullableErrorBody) Set(val *ErrorBody) { - v.value = val - v.isSet = true -} - -func (v NullableErrorBody) IsSet() bool { - return v.isSet -} - -func (v *NullableErrorBody) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableErrorBody(val *ErrorBody) *NullableErrorBody { - return &NullableErrorBody{value: val, isSet: true} -} - -func (v NullableErrorBody) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableErrorBody) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient/model_o_auth2_api_error.go b/internal/httpclient/model_error_o_auth2.go similarity index 59% rename from internal/httpclient/model_o_auth2_api_error.go rename to internal/httpclient/model_error_o_auth2.go index 56605bb5bb7..47b81b55881 100644 --- a/internal/httpclient/model_o_auth2_api_error.go +++ b/internal/httpclient/model_error_o_auth2.go @@ -15,37 +15,39 @@ import ( "encoding/json" ) -// OAuth2ApiError An API error caused by Ory's OAuth 2.0 APIs. -type OAuth2ApiError struct { - // Name is the error name. +// ErrorOAuth2 Error +type ErrorOAuth2 struct { + // Error Error *string `json:"error,omitempty"` - // Debug contains debug information. This is usually not available and has to be enabled. + // Error Debug Information Only available in dev mode. ErrorDebug *string `json:"error_debug,omitempty"` - // Description contains further information on the nature of the error. + // Error Description ErrorDescription *string `json:"error_description,omitempty"` - // Code represents the error status code (404, 403, 401, ...). + // Error Hint Helps the user identify the error cause. + ErrorHint *string `json:"error_hint,omitempty"` + // HTTP Status Code StatusCode *int64 `json:"status_code,omitempty"` } -// NewOAuth2ApiError instantiates a new OAuth2ApiError object +// NewErrorOAuth2 instantiates a new ErrorOAuth2 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewOAuth2ApiError() *OAuth2ApiError { - this := OAuth2ApiError{} +func NewErrorOAuth2() *ErrorOAuth2 { + this := ErrorOAuth2{} return &this } -// NewOAuth2ApiErrorWithDefaults instantiates a new OAuth2ApiError object +// NewErrorOAuth2WithDefaults instantiates a new ErrorOAuth2 object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set -func NewOAuth2ApiErrorWithDefaults() *OAuth2ApiError { - this := OAuth2ApiError{} +func NewErrorOAuth2WithDefaults() *ErrorOAuth2 { + this := ErrorOAuth2{} return &this } // GetError returns the Error field value if set, zero value otherwise. -func (o *OAuth2ApiError) GetError() string { +func (o *ErrorOAuth2) GetError() string { if o == nil || o.Error == nil { var ret string return ret @@ -55,7 +57,7 @@ func (o *OAuth2ApiError) GetError() string { // GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OAuth2ApiError) GetErrorOk() (*string, bool) { +func (o *ErrorOAuth2) GetErrorOk() (*string, bool) { if o == nil || o.Error == nil { return nil, false } @@ -63,7 +65,7 @@ func (o *OAuth2ApiError) GetErrorOk() (*string, bool) { } // HasError returns a boolean if a field has been set. -func (o *OAuth2ApiError) HasError() bool { +func (o *ErrorOAuth2) HasError() bool { if o != nil && o.Error != nil { return true } @@ -72,12 +74,12 @@ func (o *OAuth2ApiError) HasError() bool { } // SetError gets a reference to the given string and assigns it to the Error field. -func (o *OAuth2ApiError) SetError(v string) { +func (o *ErrorOAuth2) SetError(v string) { o.Error = &v } // GetErrorDebug returns the ErrorDebug field value if set, zero value otherwise. -func (o *OAuth2ApiError) GetErrorDebug() string { +func (o *ErrorOAuth2) GetErrorDebug() string { if o == nil || o.ErrorDebug == nil { var ret string return ret @@ -87,7 +89,7 @@ func (o *OAuth2ApiError) GetErrorDebug() string { // GetErrorDebugOk returns a tuple with the ErrorDebug field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OAuth2ApiError) GetErrorDebugOk() (*string, bool) { +func (o *ErrorOAuth2) GetErrorDebugOk() (*string, bool) { if o == nil || o.ErrorDebug == nil { return nil, false } @@ -95,7 +97,7 @@ func (o *OAuth2ApiError) GetErrorDebugOk() (*string, bool) { } // HasErrorDebug returns a boolean if a field has been set. -func (o *OAuth2ApiError) HasErrorDebug() bool { +func (o *ErrorOAuth2) HasErrorDebug() bool { if o != nil && o.ErrorDebug != nil { return true } @@ -104,12 +106,12 @@ func (o *OAuth2ApiError) HasErrorDebug() bool { } // SetErrorDebug gets a reference to the given string and assigns it to the ErrorDebug field. -func (o *OAuth2ApiError) SetErrorDebug(v string) { +func (o *ErrorOAuth2) SetErrorDebug(v string) { o.ErrorDebug = &v } // GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise. -func (o *OAuth2ApiError) GetErrorDescription() string { +func (o *ErrorOAuth2) GetErrorDescription() string { if o == nil || o.ErrorDescription == nil { var ret string return ret @@ -119,7 +121,7 @@ func (o *OAuth2ApiError) GetErrorDescription() string { // GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OAuth2ApiError) GetErrorDescriptionOk() (*string, bool) { +func (o *ErrorOAuth2) GetErrorDescriptionOk() (*string, bool) { if o == nil || o.ErrorDescription == nil { return nil, false } @@ -127,7 +129,7 @@ func (o *OAuth2ApiError) GetErrorDescriptionOk() (*string, bool) { } // HasErrorDescription returns a boolean if a field has been set. -func (o *OAuth2ApiError) HasErrorDescription() bool { +func (o *ErrorOAuth2) HasErrorDescription() bool { if o != nil && o.ErrorDescription != nil { return true } @@ -136,12 +138,44 @@ func (o *OAuth2ApiError) HasErrorDescription() bool { } // SetErrorDescription gets a reference to the given string and assigns it to the ErrorDescription field. -func (o *OAuth2ApiError) SetErrorDescription(v string) { +func (o *ErrorOAuth2) SetErrorDescription(v string) { o.ErrorDescription = &v } +// GetErrorHint returns the ErrorHint field value if set, zero value otherwise. +func (o *ErrorOAuth2) GetErrorHint() string { + if o == nil || o.ErrorHint == nil { + var ret string + return ret + } + return *o.ErrorHint +} + +// GetErrorHintOk returns a tuple with the ErrorHint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorOAuth2) GetErrorHintOk() (*string, bool) { + if o == nil || o.ErrorHint == nil { + return nil, false + } + return o.ErrorHint, true +} + +// HasErrorHint returns a boolean if a field has been set. +func (o *ErrorOAuth2) HasErrorHint() bool { + if o != nil && o.ErrorHint != nil { + return true + } + + return false +} + +// SetErrorHint gets a reference to the given string and assigns it to the ErrorHint field. +func (o *ErrorOAuth2) SetErrorHint(v string) { + o.ErrorHint = &v +} + // GetStatusCode returns the StatusCode field value if set, zero value otherwise. -func (o *OAuth2ApiError) GetStatusCode() int64 { +func (o *ErrorOAuth2) GetStatusCode() int64 { if o == nil || o.StatusCode == nil { var ret int64 return ret @@ -151,7 +185,7 @@ func (o *OAuth2ApiError) GetStatusCode() int64 { // GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OAuth2ApiError) GetStatusCodeOk() (*int64, bool) { +func (o *ErrorOAuth2) GetStatusCodeOk() (*int64, bool) { if o == nil || o.StatusCode == nil { return nil, false } @@ -159,7 +193,7 @@ func (o *OAuth2ApiError) GetStatusCodeOk() (*int64, bool) { } // HasStatusCode returns a boolean if a field has been set. -func (o *OAuth2ApiError) HasStatusCode() bool { +func (o *ErrorOAuth2) HasStatusCode() bool { if o != nil && o.StatusCode != nil { return true } @@ -168,11 +202,11 @@ func (o *OAuth2ApiError) HasStatusCode() bool { } // SetStatusCode gets a reference to the given int64 and assigns it to the StatusCode field. -func (o *OAuth2ApiError) SetStatusCode(v int64) { +func (o *ErrorOAuth2) SetStatusCode(v int64) { o.StatusCode = &v } -func (o OAuth2ApiError) MarshalJSON() ([]byte, error) { +func (o ErrorOAuth2) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Error != nil { toSerialize["error"] = o.Error @@ -183,44 +217,47 @@ func (o OAuth2ApiError) MarshalJSON() ([]byte, error) { if o.ErrorDescription != nil { toSerialize["error_description"] = o.ErrorDescription } + if o.ErrorHint != nil { + toSerialize["error_hint"] = o.ErrorHint + } if o.StatusCode != nil { toSerialize["status_code"] = o.StatusCode } return json.Marshal(toSerialize) } -type NullableOAuth2ApiError struct { - value *OAuth2ApiError +type NullableErrorOAuth2 struct { + value *ErrorOAuth2 isSet bool } -func (v NullableOAuth2ApiError) Get() *OAuth2ApiError { +func (v NullableErrorOAuth2) Get() *ErrorOAuth2 { return v.value } -func (v *NullableOAuth2ApiError) Set(val *OAuth2ApiError) { +func (v *NullableErrorOAuth2) Set(val *ErrorOAuth2) { v.value = val v.isSet = true } -func (v NullableOAuth2ApiError) IsSet() bool { +func (v NullableErrorOAuth2) IsSet() bool { return v.isSet } -func (v *NullableOAuth2ApiError) Unset() { +func (v *NullableErrorOAuth2) Unset() { v.value = nil v.isSet = false } -func NewNullableOAuth2ApiError(val *OAuth2ApiError) *NullableOAuth2ApiError { - return &NullableOAuth2ApiError{value: val, isSet: true} +func NewNullableErrorOAuth2(val *ErrorOAuth2) *NullableErrorOAuth2 { + return &NullableErrorOAuth2{value: val, isSet: true} } -func (v NullableOAuth2ApiError) MarshalJSON() ([]byte, error) { +func (v NullableErrorOAuth2) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableOAuth2ApiError) UnmarshalJSON(src []byte) error { +func (v *NullableErrorOAuth2) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/jwk/handler.go b/jwk/handler.go index 2a9122fa4aa..2998d03264a 100644 --- a/jwk/handler.go +++ b/jwk/handler.go @@ -104,7 +104,7 @@ func (h *Handler) SetRoutes(admin *httprouterx.RouterAdmin, public *httprouterx. // // Responses: // 200: jsonWebKeySet -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) discoverJsonWebKeys(w http.ResponseWriter, r *http.Request) { var jwks jose.JSONWebKeySet @@ -160,7 +160,7 @@ type adminGetJsonWebKey struct { // // Responses: // 200: jsonWebKeySet -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminGetJsonWebKey(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var setName = ps.ByName("set") var keyName = ps.ByName("key") @@ -201,7 +201,7 @@ type adminGetJsonWebKeySet struct { // // Responses: // 200: jsonWebKeySet -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminGetJsonWebKeySet(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var setName = ps.ByName("set") @@ -265,7 +265,7 @@ type adminCreateJsonWebKeySetBody struct { // // Responses: // 201: jsonWebKeySet -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) Create(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var keyRequest adminCreateJsonWebKeySetBody var set = ps.ByName("set") @@ -311,7 +311,7 @@ type adminUpdateJsonWebKeySet struct { // // Responses: // 200: jsonWebKeySet -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminUpdateJsonWebKeySet(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var keySet jose.JSONWebKeySet var set = ps.ByName("set") @@ -364,7 +364,7 @@ type adminUpdateJsonWebKey struct { // // Responses: // 200: jsonWebKey -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminUpdateJsonWebKey(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var key jose.JSONWebKey var set = ps.ByName("set") @@ -408,7 +408,7 @@ type adminDeleteJsonWebKeySet struct { // // Responses: // 204: emptyResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminDeleteJsonWebKeySet(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var setName = ps.ByName("set") @@ -452,7 +452,7 @@ type adminDeleteJsonWebKey struct { // // Responses: // 204: emptyResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminDeleteJsonWebKey(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { var setName = ps.ByName("set") var keyName = ps.ByName("key") diff --git a/oauth2/handler.go b/oauth2/handler.go index d692d4b952a..b128a763370 100644 --- a/oauth2/handler.go +++ b/oauth2/handler.go @@ -371,7 +371,7 @@ type OIDCConfiguration struct { // // Responses: // 200: oidcConfiguration -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) discoverOidcConfiguration(w http.ResponseWriter, r *http.Request) { key, err := h.r.OpenIDJWTStrategy().GetPublicKey(r.Context()) if err != nil { @@ -494,7 +494,7 @@ type oidcUserInfo struct { // // Responses: // 200: oidcUserInfo -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) getOidcUserInfo(w http.ResponseWriter, r *http.Request) { ctx := r.Context() session := NewSessionWithCustomClaims("", h.c.AllowedTopLevelClaims(ctx)) @@ -601,7 +601,7 @@ type revokeOAuth2Token struct { // // Responses: // 200: emptyResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) revokeOAuth2Token(w http.ResponseWriter, r *http.Request) { var ctx = r.Context() @@ -651,7 +651,7 @@ type adminIntrospectOAuth2Token struct { // // Responses: // 200: introspectedOAuth2Token -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminIntrospectOAuth2Token(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { var session = NewSessionWithCustomClaims("", h.c.AllowedTopLevelClaims(r.Context())) var ctx = r.Context() @@ -812,7 +812,7 @@ type oAuth2TokenResponse struct { // // Responses: // 200: oAuth2TokenResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) performOAuth2TokenFlow(w http.ResponseWriter, r *http.Request) { var session = NewSessionWithCustomClaims("", h.c.AllowedTopLevelClaims(r.Context())) var ctx = r.Context() @@ -900,7 +900,7 @@ func (h *Handler) performOAuth2TokenFlow(w http.ResponseWriter, r *http.Request) // // Responses: // 302: emptyResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) performOAuth2AuthorizationFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { var ctx = r.Context() @@ -1028,7 +1028,7 @@ type adminDeleteOAuth2Token struct { // // Responses: // 204: emptyResponse -// default: oAuth2ApiError +// default: errorOAuth2 func (h *Handler) adminDeleteOAuth2Token(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { clientID := r.URL.Query().Get("client_id") if clientID == "" { diff --git a/spec/api.json b/spec/api.json index 9349581e129..a619b5a42f9 100644 --- a/spec/api.json +++ b/spec/api.json @@ -4,31 +4,31 @@ "emptyResponse": { "description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is\ntypically 201." }, - "errorBadRequest": { + "errorOAuth2BadRequest": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/errorBody" + "$ref": "#/components/schemas/errorOAuth2" } } }, "description": "Bad Request Error Response" }, - "errorDefault": { + "errorOAuth2Default": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/errorBody" + "$ref": "#/components/schemas/errorOAuth2" } } }, "description": "Default Error Response" }, - "errorNotFound": { + "errorOAuth2NotFound": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/errorBody" + "$ref": "#/components/schemas/errorOAuth2" } } }, @@ -305,101 +305,33 @@ ], "type": "object" }, - "error": { + "errorOAuth2": { "description": "Error", "properties": { - "code": { - "description": "HTTP Status Code", - "example": 404, - "format": "int64", - "type": "integer" - }, - "debug": { - "description": "Debug Details\n\nThis field is often not exposed to protect against leaking\nsensitive information.", - "example": "SQL field \"foo\" is not a bool.", - "type": "string" - }, - "details": { - "additionalProperties": {}, - "description": "Additional Error Details\n\nFurther error details", - "type": "object" - }, - "id": { - "description": "Error ID\n\nUseful when trying to identify various errors in application logic.", + "error": { + "description": "Error", "type": "string" }, - "message": { - "description": "Error Message\n\nThe error's message.", - "example": "The resource could not be found", + "error_debug": { + "description": "Error Debug Information\n\nOnly available in dev mode.", "type": "string" }, - "reason": { - "description": "Error Reason", - "example": "User with ID 1234 does not exist.", + "error_description": { + "description": "Error Description", "type": "string" }, - "request": { - "description": "HTTP Request ID\n\nThe request ID is often exposed internally in order to trace\nerrors across service architectures. This is often a UUID.", - "example": "d7ef54b1-ec15-46e6-bccb-524b82c035e6", + "error_hint": { + "description": "Error Hint\n\nHelps the user identify the error cause.", + "example": "The redirect URL is not allowed.", "type": "string" }, - "status": { - "description": "HTTP Status Description", - "example": "Not Found", - "type": "string" - } - }, - "required": [ - "message" - ], - "type": "object" - }, - "errorBody": { - "properties": { - "code": { + "status_code": { "description": "HTTP Status Code", - "example": 404, + "example": 401, "format": "int64", "type": "integer" - }, - "debug": { - "description": "Debug Details\n\nThis field is often not exposed to protect against leaking\nsensitive information.", - "example": "SQL field \"foo\" is not a bool.", - "type": "string" - }, - "details": { - "additionalProperties": {}, - "description": "Additional Error Details\n\nFurther error details", - "type": "object" - }, - "id": { - "description": "Error ID\n\nUseful when trying to identify various errors in application logic.", - "type": "string" - }, - "message": { - "description": "Error Message\n\nThe error's message.", - "example": "The resource could not be found", - "type": "string" - }, - "reason": { - "description": "Error Reason", - "example": "User with ID 1234 does not exist.", - "type": "string" - }, - "request": { - "description": "HTTP Request ID\n\nThe request ID is often exposed internally in order to trace\nerrors across service architectures. This is often a UUID.", - "example": "d7ef54b1-ec15-46e6-bccb-524b82c035e6", - "type": "string" - }, - "status": { - "description": "HTTP Status Description", - "example": "Not Found", - "type": "string" } }, - "required": [ - "message" - ], "type": "object" }, "genericError": { @@ -760,34 +692,6 @@ "title": "Requester is a token endpoint's request context.", "type": "object" }, - "oAuth2ApiError": { - "description": "An API error caused by Ory's OAuth 2.0 APIs.", - "properties": { - "error": { - "description": "Name is the error name.", - "example": "The requested resource could not be found", - "type": "string" - }, - "error_debug": { - "description": "Debug contains debug information. This is usually not available and has to be enabled.", - "example": "The database adapter was unable to find the element", - "type": "string" - }, - "error_description": { - "description": "Description contains further information on the nature of the error.", - "example": "Object with ID 12345 does not exist", - "type": "string" - }, - "status_code": { - "description": "Code represents the error status code (404, 403, 401, ...).", - "example": 404, - "format": "int64", - "type": "integer" - } - }, - "title": "OAuth2 API Error", - "type": "object" - }, "oAuth2Client": { "description": "OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", "properties": { @@ -1873,11 +1777,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Discover JSON Web Keys", @@ -1905,11 +1809,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "OpenID Connect Discovery", @@ -1967,7 +1871,7 @@ "$ref": "#/components/responses/listOAuth2Clients" }, "default": { - "$ref": "#/components/responses/errorDefault" + "$ref": "#/components/responses/errorOAuth2Default" } }, "summary": "List OAuth 2.0 Clients", @@ -2002,10 +1906,10 @@ "description": "oAuth2Client" }, "400": { - "$ref": "#/components/responses/errorBadRequest" + "$ref": "#/components/responses/errorOAuth2BadRequest" }, "default": { - "$ref": "#/components/responses/errorDefault" + "$ref": "#/components/responses/errorOAuth2Default" } }, "summary": "Create OAuth 2.0 Client", @@ -2075,7 +1979,7 @@ "description": "oAuth2Client" }, "default": { - "$ref": "#/components/responses/errorDefault" + "$ref": "#/components/responses/errorOAuth2Default" } }, "summary": "Get an OAuth 2.0 Client", @@ -2121,10 +2025,10 @@ "description": "oAuth2Client" }, "404": { - "$ref": "#/components/responses/errorNotFound" + "$ref": "#/components/responses/errorOAuth2NotFound" }, "default": { - "$ref": "#/components/responses/errorDefault" + "$ref": "#/components/responses/errorOAuth2Default" } }, "summary": "Patch OAuth 2.0 Client", @@ -2170,13 +2074,13 @@ "description": "oAuth2Client" }, "400": { - "$ref": "#/components/responses/errorBadRequest" + "$ref": "#/components/responses/errorOAuth2BadRequest" }, "404": { - "$ref": "#/components/responses/errorNotFound" + "$ref": "#/components/responses/errorOAuth2NotFound" }, "default": { - "$ref": "#/components/responses/errorDefault" + "$ref": "#/components/responses/errorOAuth2Default" } }, "summary": "Set OAuth 2.0 Client", @@ -2261,11 +2165,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Delete a JSON Web Key Set", @@ -2302,11 +2206,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Retrieve a JSON Web Key Set", @@ -2354,11 +2258,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Generate a New JSON Web Key", @@ -2405,11 +2309,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Update a JSON Web Key Set", @@ -2450,11 +2354,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Delete a JSON Web Key", @@ -2500,11 +2404,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Fetch a JSON Web Key", @@ -2560,11 +2464,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Update a JSON Web Key", @@ -2612,11 +2516,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Get OAuth 2.0 Consent Request Information", @@ -2664,11 +2568,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Accept an OAuth 2.0 Consent Request", @@ -2716,11 +2620,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Reject an OAuth 2.0 Consent Request", @@ -2768,11 +2672,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Get an OAuth 2.0 Login Request", @@ -2820,11 +2724,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Accept an OAuth 2.0 Login Request", @@ -2872,11 +2776,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Reject an OAuth 2.0 Login Request", @@ -2924,11 +2828,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Get an OAuth 2.0 Logout Request", @@ -2966,11 +2870,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Accept an OAuth 2.0 Logout Request", @@ -3016,11 +2920,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Reject an OAuth 2.0 Logout Request", @@ -3068,11 +2972,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Revokes OAuth 2.0 Consent Sessions of a Subject for a Specific OAuth 2.0 Client", @@ -3125,11 +3029,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "List OAuth 2.0 Consent Sessions of a Subject", @@ -3161,11 +3065,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Invalidates All OAuth 2.0 Login Sessions of a Certain User", @@ -3220,11 +3124,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Introspect OAuth2 Access or Refresh Tokens", @@ -3255,11 +3159,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "Delete OAuth2 Access Tokens from a Client", @@ -3552,11 +3456,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "summary": "The OAuth 2.0 Authorize Endpoint", @@ -3593,10 +3497,10 @@ "description": "oAuth2Client" }, "400": { - "$ref": "#/components/responses/errorBadRequest" + "$ref": "#/components/responses/errorOAuth2BadRequest" }, "default": { - "$ref": "#/components/responses/errorDefault" + "$ref": "#/components/responses/errorOAuth2Default" } }, "summary": "Register OAuth2 Client using OpenID Dynamic Client Registration", @@ -3671,7 +3575,7 @@ "description": "oAuth2Client" }, "default": { - "$ref": "#/components/responses/errorDefault" + "$ref": "#/components/responses/errorOAuth2Default" } }, "security": [ @@ -3722,10 +3626,10 @@ "description": "oAuth2Client" }, "404": { - "$ref": "#/components/responses/errorNotFound" + "$ref": "#/components/responses/errorOAuth2NotFound" }, "default": { - "$ref": "#/components/responses/errorDefault" + "$ref": "#/components/responses/errorOAuth2Default" } }, "security": [ @@ -3772,11 +3676,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "security": [ @@ -3864,11 +3768,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "security": [ @@ -3904,11 +3808,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/oAuth2ApiError" + "$ref": "#/components/schemas/errorOAuth2" } } }, - "description": "oAuth2ApiError" + "description": "errorOAuth2" } }, "security": [ diff --git a/spec/swagger.json b/spec/swagger.json index e9b86a3cd20..8a48e414c4f 100755 --- a/spec/swagger.json +++ b/spec/swagger.json @@ -44,9 +44,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -75,9 +75,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -138,7 +138,7 @@ "$ref": "#/responses/listOAuth2Clients" }, "default": { - "$ref": "#/responses/errorDefault" + "$ref": "#/responses/errorOAuth2Default" } } }, @@ -178,10 +178,10 @@ } }, "400": { - "$ref": "#/responses/errorBadRequest" + "$ref": "#/responses/errorOAuth2BadRequest" }, "default": { - "$ref": "#/responses/errorDefault" + "$ref": "#/responses/errorOAuth2Default" } } } @@ -221,7 +221,7 @@ } }, "default": { - "$ref": "#/responses/errorDefault" + "$ref": "#/responses/errorOAuth2Default" } } }, @@ -268,13 +268,13 @@ } }, "400": { - "$ref": "#/responses/errorBadRequest" + "$ref": "#/responses/errorOAuth2BadRequest" }, "404": { - "$ref": "#/responses/errorNotFound" + "$ref": "#/responses/errorOAuth2NotFound" }, "default": { - "$ref": "#/responses/errorDefault" + "$ref": "#/responses/errorOAuth2Default" } } }, @@ -359,10 +359,10 @@ } }, "404": { - "$ref": "#/responses/errorNotFound" + "$ref": "#/responses/errorOAuth2NotFound" }, "default": { - "$ref": "#/responses/errorDefault" + "$ref": "#/responses/errorOAuth2Default" } } } @@ -449,9 +449,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -497,9 +497,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -546,9 +546,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -584,9 +584,9 @@ "$ref": "#/responses/emptyResponse" }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -634,9 +634,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -689,9 +689,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -734,9 +734,9 @@ "$ref": "#/responses/emptyResponse" }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -782,9 +782,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -831,9 +831,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -880,9 +880,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -928,9 +928,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -977,9 +977,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1026,9 +1026,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1071,9 +1071,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1110,9 +1110,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1153,9 +1153,9 @@ "$ref": "#/responses/emptyResponse" }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1208,9 +1208,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1258,9 +1258,9 @@ "$ref": "#/responses/emptyResponse" }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1298,9 +1298,9 @@ "$ref": "#/responses/emptyResponse" }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1347,9 +1347,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1383,9 +1383,9 @@ "$ref": "#/responses/emptyResponse" }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1600,9 +1600,9 @@ } }, "500": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1655,9 +1655,9 @@ "$ref": "#/responses/emptyResponse" }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1700,10 +1700,10 @@ } }, "400": { - "$ref": "#/responses/errorBadRequest" + "$ref": "#/responses/errorOAuth2BadRequest" }, "default": { - "$ref": "#/responses/errorDefault" + "$ref": "#/responses/errorOAuth2Default" } } } @@ -1748,7 +1748,7 @@ } }, "default": { - "$ref": "#/responses/errorDefault" + "$ref": "#/responses/errorOAuth2Default" } } }, @@ -1800,10 +1800,10 @@ } }, "404": { - "$ref": "#/responses/errorNotFound" + "$ref": "#/responses/errorOAuth2NotFound" }, "default": { - "$ref": "#/responses/errorDefault" + "$ref": "#/responses/errorOAuth2Default" } } }, @@ -1884,9 +1884,9 @@ "$ref": "#/responses/emptyResponse" }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -1973,9 +1973,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -2009,9 +2009,9 @@ } }, "default": { - "description": "oAuth2ApiError", + "description": "errorOAuth2", "schema": { - "$ref": "#/definitions/oAuth2ApiError" + "$ref": "#/definitions/errorOAuth2" } } } @@ -2295,100 +2295,32 @@ } } }, - "error": { + "errorOAuth2": { "description": "Error", "type": "object", - "required": [ - "message" - ], "properties": { - "code": { - "description": "HTTP Status Code", - "type": "integer", - "format": "int64", - "example": 404 - }, - "debug": { - "description": "Debug Details\n\nThis field is often not exposed to protect against leaking\nsensitive information.", - "type": "string", - "example": "SQL field \"foo\" is not a bool." - }, - "details": { - "description": "Additional Error Details\n\nFurther error details", - "type": "object", - "additionalProperties": {} - }, - "id": { - "description": "Error ID\n\nUseful when trying to identify various errors in application logic.", + "error": { + "description": "Error", "type": "string" }, - "message": { - "description": "Error Message\n\nThe error's message.", - "type": "string", - "example": "The resource could not be found" + "error_debug": { + "description": "Error Debug Information\n\nOnly available in dev mode.", + "type": "string" }, - "reason": { - "description": "Error Reason", - "type": "string", - "example": "User with ID 1234 does not exist." + "error_description": { + "description": "Error Description", + "type": "string" }, - "request": { - "description": "HTTP Request ID\n\nThe request ID is often exposed internally in order to trace\nerrors across service architectures. This is often a UUID.", + "error_hint": { + "description": "Error Hint\n\nHelps the user identify the error cause.", "type": "string", - "example": "d7ef54b1-ec15-46e6-bccb-524b82c035e6" + "example": "The redirect URL is not allowed." }, - "status": { - "description": "HTTP Status Description", - "type": "string", - "example": "Not Found" - } - } - }, - "errorBody": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "code": { + "status_code": { "description": "HTTP Status Code", "type": "integer", "format": "int64", - "example": 404 - }, - "debug": { - "description": "Debug Details\n\nThis field is often not exposed to protect against leaking\nsensitive information.", - "type": "string", - "example": "SQL field \"foo\" is not a bool." - }, - "details": { - "description": "Additional Error Details\n\nFurther error details", - "type": "object", - "additionalProperties": {} - }, - "id": { - "description": "Error ID\n\nUseful when trying to identify various errors in application logic.", - "type": "string" - }, - "message": { - "description": "Error Message\n\nThe error's message.", - "type": "string", - "example": "The resource could not be found" - }, - "reason": { - "description": "Error Reason", - "type": "string", - "example": "User with ID 1234 does not exist." - }, - "request": { - "description": "HTTP Request ID\n\nThe request ID is often exposed internally in order to trace\nerrors across service architectures. This is often a UUID.", - "type": "string", - "example": "d7ef54b1-ec15-46e6-bccb-524b82c035e6" - }, - "status": { - "description": "HTTP Status Description", - "type": "string", - "example": "Not Found" + "example": 401 } } }, @@ -2743,34 +2675,6 @@ } } }, - "oAuth2ApiError": { - "description": "An API error caused by Ory's OAuth 2.0 APIs.", - "type": "object", - "title": "OAuth2 API Error", - "properties": { - "error": { - "description": "Name is the error name.", - "type": "string", - "example": "The requested resource could not be found" - }, - "error_debug": { - "description": "Debug contains debug information. This is usually not available and has to be enabled.", - "type": "string", - "example": "The database adapter was unable to find the element" - }, - "error_description": { - "description": "Description contains further information on the nature of the error.", - "type": "string", - "example": "Object with ID 12345 does not exist" - }, - "status_code": { - "description": "Code represents the error status code (404, 403, 401, ...).", - "type": "integer", - "format": "int64", - "example": 404 - } - } - }, "oAuth2Client": { "description": "OAuth 2.0 Clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are\ngenerated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.", "type": "object", @@ -3785,22 +3689,22 @@ "emptyResponse": { "description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is\ntypically 201." }, - "errorBadRequest": { + "errorOAuth2BadRequest": { "description": "Bad Request Error Response", "schema": { - "$ref": "#/definitions/errorBody" + "$ref": "#/definitions/errorOAuth2" } }, - "errorDefault": { + "errorOAuth2Default": { "description": "Default Error Response", "schema": { - "$ref": "#/definitions/errorBody" + "$ref": "#/definitions/errorOAuth2" } }, - "errorNotFound": { + "errorOAuth2NotFound": { "description": "Not Found Error Response", "schema": { - "$ref": "#/definitions/errorBody" + "$ref": "#/definitions/errorOAuth2" } }, "listOAuth2Clients": { diff --git a/x/doc_swagger.go b/x/doc_swagger.go index 268b199099f..f7324e0054e 100644 --- a/x/doc_swagger.go +++ b/x/doc_swagger.go @@ -20,33 +20,6 @@ package x -// OAuth2 API Error -// -// An API error caused by Ory's OAuth 2.0 APIs. -// -// swagger:model oAuth2ApiError -type oAuth2ApiError struct { - // Name is the error name. - // - // example: The requested resource could not be found - Name string `json:"error"` - - // Description contains further information on the nature of the error. - // - // example: Object with ID 12345 does not exist - Description string `json:"error_description"` - - // Code represents the error status code (404, 403, 401, ...). - // - // example: 404 - Code int `json:"status_code"` - - // Debug contains debug information. This is usually not available and has to be enabled. - // - // example: The database adapter was unable to find the element - Debug string `json:"error_debug"` -} - // Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is // typically 201. // @@ -55,83 +28,52 @@ type emptyResponse struct{} // Error // -// swagger:model error -type errorModel struct { - // Error ID - // - // Useful when trying to identify various errors in application logic. - ID string `json:"id,omitempty"` - - // HTTP Status Code - // - // example: 404 - StatusCode int `json:"code,omitempty"` - - // HTTP Status Description - // - // example: Not Found - Status string `json:"status,omitempty"` - - // HTTP Request ID - // - // The request ID is often exposed internally in order to trace - // errors across service architectures. This is often a UUID. - // - // example: d7ef54b1-ec15-46e6-bccb-524b82c035e6 - RIDField string `json:"request,omitempty"` +// swagger:model errorOAuth2 +type errorOAuth2 struct { + // Error + Name string `json:"error"` - // Error Reason - // - // example: User with ID 1234 does not exist. - ReasonField string `json:"reason,omitempty"` + // Error Description + Description string `json:"error_description"` - // Debug Details + // Error Hint // - // This field is often not exposed to protect against leaking - // sensitive information. + // Helps the user identify the error cause. // - // example: SQL field "foo" is not a bool. - DebugField string `json:"debug,omitempty"` + // Example: The redirect URL is not allowed. + Hint string `json:"error_hint"` - // Additional Error Details + // HTTP Status Code // - // Further error details - DetailsField map[string]interface{} `json:"details,omitempty"` + // Example: 401 + Code int `json:"status_code"` - // Error Message + // Error Debug Information // - // The error's message. - // - // example: The resource could not be found - // required: true - ErrorField string `json:"message"` -} - -// swagger:model errorBody -type errorBody struct { - errorModel + // Only available in dev mode. + Debug string `json:"error_debug,omitempty"` } // Default Error Response // -// swagger:response errorDefault -type errorDefault struct { +// swagger:response errorOAuth2Default +type errorOAuth2Default struct { // in: body - Body errorBody + Body errorOAuth2 } // Bad Request Error Response // -// swagger:response errorBadRequest -type errorBadRequest struct { +// swagger:response errorOAuth2BadRequest +type errorOAuth2BadRequest struct { // in: body - Body errorBody + Body errorOAuth2 } // Not Found Error Response // -// swagger:response errorNotFound -type errorNotFound struct { +// swagger:response errorOAuth2NotFound +type errorOAuth2NotFound struct { // in: body - Body errorBody + Body errorOAuth2 }