Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdateList REST Documentation is for Local SDK Server not SDK Server #3874

Closed
igooch opened this issue Jun 17, 2024 · 0 comments · Fixed by #3878
Closed

UpdateList REST Documentation is for Local SDK Server not SDK Server #3874

igooch opened this issue Jun 17, 2024 · 0 comments · Fixed by #3878
Assignees
Labels
kind/cleanup Refactoring code, fixing up documentation, etc kind/documentation Documentation for Agones

Comments

@igooch
Copy link
Collaborator

igooch commented Jun 17, 2024

In #3870 we found that the REST documentation for UpdateList:

##### Beta: UpdateList
This function updates the list's properties with the key `players`, such as its capacity and values, returns the updated list details. This will overwrite all existing List.Values with the update list request values. Use addValue or removeValue for modifying the List.Values field.
###### Example
```bash
curl -d '{"capacity": "120", "values": ["player3", "player4"]}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1beta1/lists/players
```
follows the Local SDK Server behavior (overwrites both capacity and values):
// UpdateList returns the updated List. Returns not found if the List does not exist (name cannot be updated).
// **THIS WILL OVERWRITE ALL EXISTING LIST.VALUES WITH ANY REQUEST LIST.VALUES**
// Use AddListValue() or RemoveListValue() for modifying the List.Values field.
// Returns invalid argument if the field mask path(s) are not field(s) of the List.
// If a field mask path(s) is specified, but the value is not set in the request List object,
// then the default value for the variable will be set (i.e. 0 for "capacity", empty list for "values").
// [Stage:Beta]
// [FeatureFlag:CountsAndLists]
func (l *LocalSDKServer) UpdateList(ctx context.Context, in *beta.UpdateListRequest) (*beta.List, error) {
, and not the SDK Server behavior (only overwrites capacity):
// UpdateList collapses all update capacity requests for a given List into a single UpdateList request.
// This function currently only updates the Capacity of a List.
// Returns error if the List does not exist (name cannot be updated).
// Returns error if the List update capacity is out of range [0,1000].
// [Stage:Beta]
// [FeatureFlag:CountsAndLists]
func (s *SDKServer) UpdateList(ctx context.Context, in *beta.UpdateListRequest) (*beta.List, error) {
.

We should update the documentation to make clear the behavior when developing in Local mode is different from the behavior in the SDK Server.

@igooch igooch added kind/documentation Documentation for Agones kind/cleanup Refactoring code, fixing up documentation, etc labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Refactoring code, fixing up documentation, etc kind/documentation Documentation for Agones
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants