Skip to content

Commit 755d1b4

Browse files
committed
clinic sites cleanups requested in code review
BACK-3632
1 parent 139f95e commit 755d1b4

File tree

7 files changed

+17
-45
lines changed

7 files changed

+17
-45
lines changed

reference/clinic.v1.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,8 +2664,7 @@ components:
26642664
in: path
26652665
required: true
26662666
schema:
2667-
type: string
2668-
pattern: '^[a-f0-9]{24}$'
2667+
$ref: ./clinic/models/siteId.v1.yaml
26692668
userId:
26702669
name: userId
26712670
in: path

reference/clinic/models/site.v1.yaml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@ title: Site
33
description: "A clinic's physical or logical location."
44
properties:
55
id:
6-
title: Object Id
7-
type: string
8-
x-go-type-skip-optional-pointer: true
9-
description: String representation of a resource id
10-
minLength: 24
11-
maxLength: 24
12-
pattern: '^[a-f0-9]{24}$'
6+
$ref: ./siteId.v1.yaml
137
name:
14-
type: string
15-
x-go-type-skip-optional-pointer: true
16-
description: The site description.
17-
minLength: 1
18-
maxLength: 200
19-
pattern: '^[[:graph:]\p{L}\p{N}][[:graph:]\p{L}\p{N} ]*$'
8+
$ref: ./siteName.v1.yaml
209
required:
2110
- id
2211
- name

reference/clinic/models/siteCreation.v1.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ title: Site
33
description: "A clinic's physical or logical location."
44
properties:
55
name:
6-
type: string
7-
x-go-type-skip-optional-pointer: true
8-
description: The site description.
9-
minLength: 1
10-
maxLength: 200
11-
pattern: '^[[:graph:]\p{L}\p{N}][[:graph:]\p{L}\p{N} ]*$'
6+
$ref: ./siteName.v1.yaml
127
required:
138
- name
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
title: Site ID
2-
description: >-
3-
Site identifier.
4-
type: string
5-
minLength: 24
6-
maxLength: 24
7-
pattern: '^[a-f0-9]{24}$'
8-
readOnly: true
9-
example: 2fe2488217ee43e1b2e83c2f
1+
# Site id is a mongodb objectid, but not a pointer (like objectid.v1.yaml).
2+
allOf:
3+
- $ref: ../../common/models/objectid.v1.yaml
4+
- x-go-type-skip-optional-pointer: true
5+
x-go-type: string # otherwise oapi-codegen will generate interface{}
6+
readOnly: true # can't merge with objectid without this matching

reference/clinic/models/siteIds.v1.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,4 @@ title: Site ID List
33
uniqueItems: true
44
nullable: true
55
items:
6-
title: Site ID
7-
description: >-
8-
Site identifier.
9-
type: string
10-
minLength: 24
11-
maxLength: 24
12-
pattern: '^[a-f0-9]{24}$'
13-
readOnly: true
6+
$ref: ./siteId.v1.yaml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type: string
2+
x-go-type-skip-optional-pointer: true
3+
description: The site's name.
4+
minLength: 1
5+
maxLength: 200
6+
pattern: '^[[:graph:]\p{L}\p{N}][[:graph:]\p{L}\p{N} ]*$'

reference/clinic/parameters/siteId.v1.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)