Skip to content

Commit 0f6aa2e

Browse files
author
Tomáš Kocman
authored
Merge pull request #26 from strvcom/refactor/error-camel-case
refactor: JSON tags in ErrorResponseOptions
2 parents e78b5a6 + 578fd87 commit 0f6aa2e

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ How to release a new version:
55

66
## [Unreleased]
77

8+
## [0.4.0] - 2022-01-12
9+
### Changed
10+
- JSON tags in `ErrorResponseOptions`.
11+
12+
### Fixed
13+
- JSON tag for `MaxHeaderBytes` field in `Limits` configuration.
14+
815
## [0.3.0] - 2023-01-09
916
### Added
1017
- HTTP response writer contains error field.
@@ -25,7 +32,8 @@ How to release a new version:
2532
### Added
2633
- Added Changelog.
2734

28-
[Unreleased]: https://github.com/strvcom/strv-backend-go-net/compare/v0.3.0...HEAD
29-
[0.3.0]: https://github.com/strvcom/strv-backend-go-net/releases/tag/v0.3.0
30-
[0.2.0]: https://github.com/strvcom/strv-backend-go-net/releases/tag/v0.2.0
35+
[Unreleased]: https://github.com/strvcom/strv-backend-go-net/compare/v0.4.0...HEAD
36+
[0.4.0]: https://github.com/strvcom/strv-backend-go-net/compare/v0.3.0...v0.4.0
37+
[0.3.0]: https://github.com/strvcom/strv-backend-go-net/compare/v0.2.0...v0.3.0
38+
[0.2.0]: https://github.com/strvcom/strv-backend-go-net/compare/v0.1.0...v0.2.0
3139
[0.1.0]: https://github.com/strvcom/strv-backend-go-net/releases/tag/v0.1.0

http/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type Limits struct {
3333

3434
// MaxHeaderBytes is part of http.Server.
3535
// See http.Server for more details.
36-
MaxHeaderBytes int `json:"maxHeaderBytes"`
36+
MaxHeaderBytes int `json:"max_header_bytes"`
3737
}
3838

3939
// Timeouts represents configuration for HTTP server timeouts.

http/response.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ type ErrorResponseOptions struct {
9090
ResponseOptions `json:"-"`
9191

9292
Err error `json:"-"`
93-
ErrCode string `json:"error_code"`
94-
ErrData any `json:"error_data,omitempty"`
93+
ErrCode string `json:"errorCode"`
94+
ErrData any `json:"errorData,omitempty"`
9595
}
9696

9797
type ErrorResponseOption func(*ErrorResponseOptions)

0 commit comments

Comments
 (0)