Skip to content

Commit

Permalink
dont use existing struct
Browse files Browse the repository at this point in the history
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
arkodg committed Oct 16, 2024
1 parent 05414ce commit 75f7d57
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
15 changes: 14 additions & 1 deletion api/v1alpha1/httproutefilter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,20 @@ type HTTPURLRewriteFilter struct {

// HTTPDirectResponseFilter defines the configuration to return a fixed response.
type HTTPDirectResponseFilter struct {
CustomResponse `json:",inline"`
// Content Type of the response. This will be set in the Content-Type header.
//
// +optional
ContentType *string `json:"contentType,omitempty"`

// Body of the Response
//
// +optional
Body *CustomResponseBody `json:"body,omitempty"`

// Status Code of the HTTP response
// If unset, defaults to 200.
// +optional
StatusCode *string `json:"statusCode,omitempty"`
}

// HTTPPathModifierType defines the type of path redirect or rewrite.
Expand Down
16 changes: 15 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

5 changes: 2 additions & 3 deletions site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,6 @@ _Appears in:_
CustomResponse defines the configuration for returning a custom response.

_Appears in:_
- [HTTPDirectResponseFilter](#httpdirectresponsefilter)
- [ResponseOverride](#responseoverride)

| Field | Type | Required | Description |
Expand Down Expand Up @@ -1936,8 +1935,8 @@ _Appears in:_
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contentType` | _string_ | false | Content Type of the response. This will be set in the Content-Type header. |
| `body` | _[CustomResponseBody](#customresponsebody)_ | false | Body of the Custom Response |
| `statusCode` | _string_ | false | Status Code of the HTTP response |
| `body` | _[CustomResponseBody](#customresponsebody)_ | false | Body of the Response |
| `statusCode` | _string_ | false | Status Code of the HTTP response<br />If unset, defaults to 200. |


#### HTTPExtAuthService
Expand Down
5 changes: 2 additions & 3 deletions site/content/zh/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,6 @@ _Appears in:_
CustomResponse defines the configuration for returning a custom response.

_Appears in:_
- [HTTPDirectResponseFilter](#httpdirectresponsefilter)
- [ResponseOverride](#responseoverride)

| Field | Type | Required | Description |
Expand Down Expand Up @@ -1936,8 +1935,8 @@ _Appears in:_
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contentType` | _string_ | false | Content Type of the response. This will be set in the Content-Type header. |
| `body` | _[CustomResponseBody](#customresponsebody)_ | false | Body of the Custom Response |
| `statusCode` | _string_ | false | Status Code of the HTTP response |
| `body` | _[CustomResponseBody](#customresponsebody)_ | false | Body of the Response |
| `statusCode` | _string_ | false | Status Code of the HTTP response<br />If unset, defaults to 200. |


#### HTTPExtAuthService
Expand Down

0 comments on commit 75f7d57

Please sign in to comment.