Skip to content

Commit

Permalink
fix: implement proper error responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Leaseweb CI committed Nov 4, 2024
1 parent cd8fd7b commit ed0bdac
Show file tree
Hide file tree
Showing 25 changed files with 1,859 additions and 195 deletions.
2 changes: 2 additions & 0 deletions abuse/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ docs/GetReportResolutionListResult.md
docs/GetReportResult.md
docs/Message.md
docs/Metadata.md
docs/Model400ErrorResult.md
docs/Report.md
docs/ResolutionList.md
docs/ResolveReportResult.md
git_push.sh
go.mod
go.sum
model_400_error_result.go
model__metadata.go
model_attachment.go
model_create_report_message_opts.go
Expand Down
1 change: 1 addition & 0 deletions abuse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Class | Method | HTTP request | Description
- [GetReportResult](docs/GetReportResult.md)
- [Message](docs/Message.md)
- [Metadata](docs/Metadata.md)
- [Model400ErrorResult](docs/Model400ErrorResult.md)
- [Report](docs/Report.md)
- [ResolutionList](docs/ResolutionList.md)
- [ResolveReportResult](docs/ResolveReportResult.md)
Expand Down
31 changes: 29 additions & 2 deletions abuse/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ paths:
errorDetails: {}
errorMessage: The API could not interpret your request correctly.
schema:
$ref: '#/components/schemas/errorResult'
$ref: '#/components/schemas/400ErrorResult'
description: Bad Request.
"401":
content:
Expand Down Expand Up @@ -868,7 +868,7 @@ components:
errorDetails: {}
errorMessage: The API could not interpret your request correctly.
schema:
$ref: '#/components/schemas/errorResult'
$ref: '#/components/schemas/400ErrorResult'
description: Bad Request.
"401":
content:
Expand Down Expand Up @@ -1283,6 +1283,33 @@ components:
required:
- resolutions
type: object
"400ErrorResult":
example:
errorMessage: errorMessage
errorCode: errorCode
correlationId: correlationId
errorDetails:
key:
- errorDetails
- errorDetails
properties:
correlationId:
description: The correlation ID of the current request.
type: string
errorCode:
description: The error code.
type: string
errorMessage:
description: A human friendly description of the error.
type: string
errorDetails:
additionalProperties:
items:
type: string
type: array
title: errorDetails
type: object
type: object
report:
example:
reportedAt: 2015-01-01T00:00:00+00:00
Expand Down
2 changes: 1 addition & 1 deletion abuse/api_abuse.go

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

2 changes: 1 addition & 1 deletion abuse/configuration.go

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

134 changes: 134 additions & 0 deletions abuse/docs/Model400ErrorResult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Model400ErrorResult

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**CorrelationId** | Pointer to **string** | The correlation ID of the current request. | [optional]
**ErrorCode** | Pointer to **string** | The error code. | [optional]
**ErrorMessage** | Pointer to **string** | A human friendly description of the error. | [optional]
**ErrorDetails** | Pointer to **map[string][]string** | | [optional]

## Methods

### NewModel400ErrorResult

`func NewModel400ErrorResult() *Model400ErrorResult`

NewModel400ErrorResult instantiates a new Model400ErrorResult 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

### NewModel400ErrorResultWithDefaults

`func NewModel400ErrorResultWithDefaults() *Model400ErrorResult`

NewModel400ErrorResultWithDefaults instantiates a new Model400ErrorResult 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

### GetCorrelationId

`func (o *Model400ErrorResult) GetCorrelationId() string`

GetCorrelationId returns the CorrelationId field if non-nil, zero value otherwise.

### GetCorrelationIdOk

`func (o *Model400ErrorResult) GetCorrelationIdOk() (*string, bool)`

GetCorrelationIdOk returns a tuple with the CorrelationId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetCorrelationId

`func (o *Model400ErrorResult) SetCorrelationId(v string)`

SetCorrelationId sets CorrelationId field to given value.

### HasCorrelationId

`func (o *Model400ErrorResult) HasCorrelationId() bool`

HasCorrelationId returns a boolean if a field has been set.

### GetErrorCode

`func (o *Model400ErrorResult) GetErrorCode() string`

GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise.

### GetErrorCodeOk

`func (o *Model400ErrorResult) GetErrorCodeOk() (*string, bool)`

GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetErrorCode

`func (o *Model400ErrorResult) SetErrorCode(v string)`

SetErrorCode sets ErrorCode field to given value.

### HasErrorCode

`func (o *Model400ErrorResult) HasErrorCode() bool`

HasErrorCode returns a boolean if a field has been set.

### GetErrorMessage

`func (o *Model400ErrorResult) GetErrorMessage() string`

GetErrorMessage returns the ErrorMessage field if non-nil, zero value otherwise.

### GetErrorMessageOk

`func (o *Model400ErrorResult) GetErrorMessageOk() (*string, bool)`

GetErrorMessageOk returns a tuple with the ErrorMessage field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetErrorMessage

`func (o *Model400ErrorResult) SetErrorMessage(v string)`

SetErrorMessage sets ErrorMessage field to given value.

### HasErrorMessage

`func (o *Model400ErrorResult) HasErrorMessage() bool`

HasErrorMessage returns a boolean if a field has been set.

### GetErrorDetails

`func (o *Model400ErrorResult) GetErrorDetails() map[string][]string`

GetErrorDetails returns the ErrorDetails field if non-nil, zero value otherwise.

### GetErrorDetailsOk

`func (o *Model400ErrorResult) GetErrorDetailsOk() (*map[string][]string, bool)`

GetErrorDetailsOk returns a tuple with the ErrorDetails field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetErrorDetails

`func (o *Model400ErrorResult) SetErrorDetails(v map[string][]string)`

SetErrorDetails sets ErrorDetails field to given value.

### HasErrorDetails

`func (o *Model400ErrorResult) HasErrorDetails() bool`

HasErrorDetails 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)


Loading

0 comments on commit ed0bdac

Please sign in to comment.