Skip to content

Commit

Permalink
#26 change pattern regexps to match entire strings
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdbosch committed Feb 12, 2020
1 parent 824b187 commit 70fe2fc
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/main/asciidoc/schemas/common/v1/common-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ definitions:
Uuid:
description: Universally Unique Identifier, as standardized in RFC 4122 and ISO/IEC 9834-8
type: string
pattern: '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}'
pattern: '^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$'
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ definitions:
EmployerId:
description: Identifier issued by NSSO (RSZ/NSSO) for an employer
type: string
pattern: [0,5]{0-1}\d{9} #TODO: verify. String with leading zeros or integer type? If integer, can pattern be applied?
pattern: '^[0,5]{0-1}\d{9}$' #TODO: verify. String with leading zeros or integer type? If integer, can pattern be applied?
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ definitions:
description: Country represented by an ISO 3166-1 alpha-2 code
#TODO: add another type including ISO 3166-3 codes as well for former countries, and one combining both?
type: string
pattern: "[A-Z]{2}"
pattern: "^[A-Z]{2}$"
# TODO: other location types ~ BEST format and NR format
4 changes: 2 additions & 2 deletions src/main/asciidoc/schemas/money/v1beta/money-v1beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ definitions:
Iban:
description: International Bank Account Number, as defined in ISO 13616:2007
type: string
pattern: "[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}"
pattern: "^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$"
# consists of:
# country code (two letters - ISO 3166-1 alpha-2)
# two check digits
# up to 30 alphanumeric characters that are country-specific
Bic:
description: Business Identifier Code, also known as Swift Code. International identifier for financial and non-financial institutions, commonly used for international bank transfers.
type: string
pattern: "[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?"
pattern: "^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$"
# consists of:
# institution code (4 letters)
# country code (2 letters - ISO 3166-1 alpha-2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ definitions:
CbeNumber:
description: Identifier issued by CBE for either a site (establishment unit) or a registered organization
type: string
pattern: '[0-8]\d{9}'
pattern: '^[0-8]\d{9}$'
#TODO: synchronize descriptions with vocabularies
EnterpriseNumber:
description: Identifier issued by CBE for a registered organization
type: string
pattern: '[0|1]\d{9}'
pattern: '^[0|1]\d{9}$'
EstablishmentUnitNumber:
description: Identifier issued by CBE for a site (establishment) of an organization
type: string
pattern: '[2-8]\d{9}'
pattern: '^[2-8]\d{9}$'
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ parameters:
name: ssin
required: true
type: string
pattern: '\d{11}'
pattern: '^\d{11}$'
SsinQueryParameter:
description: "Social Security Identification Number issued by the National Register or CBSS"
in: query
name: ssin
type: string
pattern: '\d{11}'
pattern: '^\d{11}$'
definitions:
Ssin:
description: "Social Security Identification Number issued by the National Register or CBSS"
type: string
pattern: '\d{11}'
pattern: '^\d{11}$'
4 changes: 2 additions & 2 deletions src/main/asciidoc/schemas/time/v1/time-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ paths: {}
definitions:
YearQuarter:
type: string
pattern: '[0-9]{4}Q(1|2|3|4)'
pattern: '^[0-9]{4}Q(1|2|3|4)$'
description: '[quarter in a Gregorian Calendar Year](https://en.wikipedia.org/wiki/Calendar_year#Quarters) with the year included'
example: '2020Q1'
Quarter:
Expand All @@ -17,7 +17,7 @@ definitions:
IncompleteDate:
description: Flexible date type that allows the absence of an exact day or month. Format yyyy-mm-dd, yyyy-mm-00 or yyyy-00-00
type: string
pattern: '[0-9]{4}-[0-1][0-9]-[0-3][0-9]'
pattern: '^[0-9]{4}-[0-1][0-9]-[0-3][0-9]$'
Period:
description: period from start to end date. Both start and end dates are mandatory.
type: object
Expand Down
2 changes: 1 addition & 1 deletion src/main/asciidoc/schemas/time/v1beta/time-v1beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ definitions:
YearMonth:
description: A month of a year, e.g. 2020-01
type: string
pattern: '[0-9]{4}-[0-1][0-9]'
pattern: '^[0-9]{4}-[0-1][0-9]$'

0 comments on commit 70fe2fc

Please sign in to comment.