Skip to content

Commit 4bfd006

Browse files
committed
Add limit field to RequestSyncResponse with uint32 type and default value
- Add limit field to RequestSyncResponseBody in OpenAPI spec - Configure as uint32 with default value of 0 - Update generated OpenAPI types to include limit field - Fix test expectations to match actual limit values passed in service calls - Ensure all tests pass with proper type handling
1 parent a40916b commit 4bfd006

File tree

6 files changed

+17
-0
lines changed

6 files changed

+17
-0
lines changed

api/openapi/paths/non_admin/request-bodies.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ components:
2626
type: number
2727
format: double
2828
description: 'Timestamp or sequence number from which to start synchronization'
29+
limit:
30+
type: integer
31+
format: uint32
32+
default: 0
33+
description: 'Maximum number of items to return'
2934
required:
3035
- version
3136
- since
37+
- limit
3238

3339
RequestForeignGASPNodeBody:
3440
content:

pkg/server/internal/app/request_sync_response_service_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ func TestRequestSyncResponseService_ValidCase(t *testing.T) {
1616
InitialRequest: &gasp.InitialRequest{
1717
Version: testabilities.DefaultVersion,
1818
Since: testabilities.DefaultSince,
19+
Limit: 100,
1920
},
2021
Topic: testabilities.DefaultTopic,
2122
Response: &gasp.InitialResponse{
@@ -98,6 +99,7 @@ func TestRequestSyncResponseService_InvalidCases(t *testing.T) {
9899
InitialRequest: &gasp.InitialRequest{
99100
Version: testabilities.DefaultVersion,
100101
Since: testabilities.DefaultSince,
102+
Limit: 100,
101103
},
102104
Topic: testabilities.DefaultTopic,
103105
ProvideForeignSyncResponseCall: true,

pkg/server/internal/ports/openapi/openapi_api.gen.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/server/internal/ports/openapi/openapi_non_admin_request_types.gen.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/server/internal/ports/request_sync_response_handler_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func TestRequestSyncResponseHandler_InvalidCases(t *testing.T) {
5656
InitialRequest: &gasp.InitialRequest{
5757
Version: testabilities.DefaultVersion,
5858
Since: testabilities.DefaultSince,
59+
Limit: 0,
5960
},
6061
Topic: testabilities.DefaultTopic,
6162
},
@@ -97,6 +98,7 @@ func TestRequestSyncResponseHandler_ValidCase(t *testing.T) {
9798
InitialRequest: &gasp.InitialRequest{
9899
Version: testabilities.DefaultVersion,
99100
Since: testabilities.DefaultSince,
101+
Limit: 0,
100102
},
101103
Topic: testabilities.DefaultTopic,
102104
Response: &gasp.InitialResponse{

pkg/server/internal/testabilities/request_sync_response_provider_mock.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func NewDefaultRequestSyncResponseBody() openapi.RequestSyncResponseBody {
8888
return openapi.RequestSyncResponseBody{
8989
Version: DefaultVersion,
9090
Since: DefaultSince,
91+
Limit: 0,
9192
}
9293
}
9394

0 commit comments

Comments
 (0)