diff --git a/docs/apis/http/graph/spaces.md b/docs/apis/http/graph/spaces.md index 33ae6c505da..a44d7f7f61c 100644 --- a/docs/apis/http/graph/spaces.md +++ b/docs/apis/http/graph/spaces.md @@ -102,7 +102,7 @@ Create a new space with properties. curl -L -X POST 'https://localhost:9200/graph/v1.0/drives/' \ -H 'Content-Type: application/json' \ --data-raw '{ - "Name": "Marketing", + "name": "Marketing", "description": "Marketing team resources", "quota": { "total": 5368709120 diff --git a/services/graph/pkg/service/v0/graph_test.go b/services/graph/pkg/service/v0/graph_test.go index 7468db84977..fc8ec5eb46e 100644 --- a/services/graph/pkg/service/v0/graph_test.go +++ b/services/graph/pkg/service/v0/graph_test.go @@ -575,7 +575,7 @@ var _ = Describe("Graph", func() { Constraint: v0.Permission_CONSTRAINT_ALL, }, }, nil) - jsonBody := []byte(`{"Name": "Test Space"`) + jsonBody := []byte(`{"name": "Test Space"`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) @@ -596,7 +596,7 @@ var _ = Describe("Graph", func() { }, }, nil) gatewayClient.On("CreateStorageSpace", mock.Anything, mock.Anything).Return(&provider.CreateStorageSpaceResponse{}, errors.New("transport error")) - jsonBody := []byte(`{"Name": "Test Space"}`) + jsonBody := []byte(`{"name": "Test Space"}`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) @@ -620,7 +620,7 @@ var _ = Describe("Graph", func() { Status: status.NewPermissionDenied(ctx, nil, "grpc permission denied"), }, nil) - jsonBody := []byte(`{"Name": "Test Space"}`) + jsonBody := []byte(`{"name": "Test Space"}`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) @@ -644,7 +644,7 @@ var _ = Describe("Graph", func() { Status: status.NewInternal(ctx, "grpc error"), }, nil) - jsonBody := []byte(`{"Name": "Test Space"}`) + jsonBody := []byte(`{"name": "Test Space"}`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) @@ -664,7 +664,7 @@ var _ = Describe("Graph", func() { Constraint: v0.Permission_CONSTRAINT_ALL, }, }, nil) - jsonBody := []byte(`{"Name": ""}`) + jsonBody := []byte(`{"name": ""}`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) @@ -684,7 +684,7 @@ var _ = Describe("Graph", func() { Constraint: v0.Permission_CONSTRAINT_ALL, }, }, nil) - jsonBody := []byte(`{"Name": "uufZ2MEUjUMJa84RkPsjJ1zf4XXRTdVMxRsJGfevwHuUBojo5JEdNU22O1FGgzXXTi9tl5ZKWaluIef8pPmEAxn9lHGIjyDVYeRQPiX5PCAZ7rVszrpLJryY5x1p6fFGQ6WQsPpNaqnKnfMliJDsbkAwMf7rCpzo0GUuadgHY9s2mfoXHDnpxqEmDsheucqVAFcNlFZNbNHoZAebHfv78KYc8C0WnhWvqvSPGBkNPQbZUkFCOAIlqpQ2Q3MubgI2"}`) + jsonBody := []byte(`{"name": "uufZ2MEUjUMJa84RkPsjJ1zf4XXRTdVMxRsJGfevwHuUBojo5JEdNU22O1FGgzXXTi9tl5ZKWaluIef8pPmEAxn9lHGIjyDVYeRQPiX5PCAZ7rVszrpLJryY5x1p6fFGQ6WQsPpNaqnKnfMliJDsbkAwMf7rCpzo0GUuadgHY9s2mfoXHDnpxqEmDsheucqVAFcNlFZNbNHoZAebHfv78KYc8C0WnhWvqvSPGBkNPQbZUkFCOAIlqpQ2Q3MubgI2"}`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) @@ -704,7 +704,7 @@ var _ = Describe("Graph", func() { Constraint: v0.Permission_CONSTRAINT_ALL, }, }, nil) - jsonBody := []byte(`{"Name": "Test", "DriveType": "media"}`) + jsonBody := []byte(`{"name": "Test", "DriveType": "media"}`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) @@ -724,7 +724,7 @@ var _ = Describe("Graph", func() { Constraint: v0.Permission_CONSTRAINT_ALL, }, }, nil) - jsonBody := []byte(`{"Name": "Space / Name"}`) + jsonBody := []byte(`{"name": "Space / Name"}`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) @@ -770,7 +770,7 @@ var _ = Describe("Graph", func() { TotalBytes: 500, }, nil) - jsonBody := []byte(`{"Name": "Test Space", "DriveType": "project", "Description": "This space is for testing", "DriveAlias": "project/testspace"}`) + jsonBody := []byte(`{"name": "Test Space", "driveType": "project", "description": "This space is for testing", "DriveAlias": "project/testspace"}`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) @@ -801,7 +801,7 @@ var _ = Describe("Graph", func() { Constraint: v0.Permission_CONSTRAINT_ALL, }, }, nil) - jsonBody := []byte(`{"Name": "Test Space"}`) + jsonBody := []byte(`{"name": "Test Space"}`) r := httptest.NewRequest(http.MethodPost, "/graph/v1.0/drives", bytes.NewBuffer(jsonBody)).WithContext(ctx) rr := httptest.NewRecorder() svc.CreateDrive(rr, r) diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index a8edbf8e961..d6f96c55b94 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -701,7 +701,7 @@ public function theUserCreatesASpaceWithQuotaUsingTheGraphApi( string $spaceType, ?int $quota = null ): void { - $space = ["Name" => $spaceName, "driveType" => $spaceType, "quota" => ["total" => $quota]]; + $space = ["name" => $spaceName, "driveType" => $spaceType, "quota" => ["total" => $quota]]; $body = json_encode($space); $response = GraphHelper::createSpace( $this->featureContext->getBaseUrl(), @@ -1657,7 +1657,7 @@ public function userHasCreatedSpace( string $spaceType, int $quota ): void { - $space = ["Name" => $spaceName, "driveType" => $spaceType, "quota" => ["total" => $quota]]; + $space = ["name" => $spaceName, "driveType" => $spaceType, "quota" => ["total" => $quota]]; $response = $this->createSpace($user, $space); $this->addCreatedSpace($user, $response); $this->featureContext->theHTTPStatusCodeShouldBe( @@ -1682,7 +1682,7 @@ public function theUserHasCreatedASpaceByDefaultUsingTheGraphApi( string $user, string $spaceName ): void { - $space = ["Name" => $spaceName]; + $space = ["name" => $spaceName]; $response = $this->createSpace($user, $space); $this->addCreatedSpace($user, $response); $this->featureContext->theHTTPStatusCodeShouldBe(