Skip to content

Commit cb3c768

Browse files
committed
Add constraints on WorkspaceCreateRequest, WorkspaceUpdateRequest
1 parent 16b2fc2 commit cb3c768

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

workspace/src/main/openapi/workspace.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,21 +674,27 @@ components:
674674
x-field-extra-annotation: "@org.springframework.data.annotation.Id"
675675
readOnly: true
676676
description: Workspace unique identifier generated by the API
677+
pattern: '^w-\w{10,20}'
677678
example: "w-0123456789ab"
678679
organizationId:
679680
x-field-extra-annotation: "@com.redis.om.spring.annotations.Indexed"
680681
type: string
681682
readOnly: true
682683
description: Organization unique identifier under which the workspace resides
684+
pattern: '^o-\w{10,20}'
683685
example: "o-0123456789ab"
684686
key:
685687
type: string
686688
description: technical key for resource name convention and version grouping. Must be unique
689+
minLength: 1
690+
maxLength: 50
687691
example: "MyKey"
688692
name:
689693
type: string
690694
x-field-extra-annotation: "@com.redis.om.spring.annotations.Searchable"
691695
description: Workspace name. This name is display in the sample webApp
696+
minLength: 1
697+
maxLength: 50
692698
example: "FranceOffice"
693699
description:
694700
type: string
@@ -741,10 +747,14 @@ components:
741747
key:
742748
type: string
743749
description: technical key for resource name convention and version grouping. Must be unique
750+
minLength: 1
751+
maxLength: 50
744752
name:
745753
type: string
746754
description: Workspace name. This name is display in the sample webApp
747755
example: "FranceOffice"
756+
minLength: 1
757+
maxLength: 50
748758
description:
749759
type: string
750760
description: the Workspace description
@@ -779,9 +789,13 @@ components:
779789
key:
780790
type: string
781791
description: technical key for resource name convention and version grouping. Must be unique
792+
minLength: 1
793+
maxLength: 50
782794
name:
783795
type: string
784796
description: Workspace name
797+
minLength: 1
798+
maxLength: 50
785799
description:
786800
type: string
787801
description: the Workspace description
@@ -894,6 +908,7 @@ components:
894908
solutionId:
895909
type: string
896910
description: the Solution Id attached to this workspace
911+
pattern: '^sol-\w{10,20}'
897912
runTemplateFilter:
898913
type: array
899914
description: the list of Solution Run Template Id to filter

workspace/src/test/kotlin/com/cosmotech/workspace/service/WorkspaceServiceImplTests.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ import org.junit.jupiter.api.extension.ExtendWith
6767
import org.springframework.core.io.Resource
6868
import org.springframework.data.repository.findByIdOrNull
6969

70-
const val ORGANIZATION_ID = "O-AbCdEf123"
71-
const val WORKSPACE_ID = "W-BcDeFg123"
70+
const val ORGANIZATION_ID = "o-AbCdEf1234"
71+
const val WORKSPACE_ID = "w-BcDeFg1234"
7272
const val CONNECTED_ADMIN_USER = "[email protected]"
7373
const val CONNECTED_DEFAULT_USER = "[email protected]"
7474

0 commit comments

Comments
 (0)