-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
Hi. Noticed an issue with a regex I'm using.
Example struct:
type Foo struct {
BusinessRegistrationNumber string `json:"businessRegistrationNumber" jsonschema:"title=Business Registration Number,description=Official business registration number (BRN),minLength=5,maxLength=20,pattern=^[A-Z]{0,2}[0-9A-Z\\-\\.\\/]+$"`
}Generated schema (Copy pasted and removed unrelated things so might not be right:
{
"$schema": "http://json-schema.org/draft-07/schema",
"properties": {
"businessRegistrationNumber": {
"type": "string",
"maxLength": 20,
"minLength": 5,
"pattern": "^[A-Z]{0",
"title": "Business Registration Number",
"description": "Official business registration number (BRN)"
},
"additionalProperties": false,
"type": "object",
"description": "The merchants business details"
}
},
"additionalProperties": false,
}Note the pattern:
"pattern": "^[A-Z]{0",
which is cuf-off.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels