Seems like the string format validation does not seem to work in path
paths:
/uuid-pattern/{param}:
get:
parameters:
- in: path
name: param
required: true
schema:
type: string
pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
minLength: 36
maxLength: 36
responses:
'200':
description: success
/uuid-format/{param}:
get:
parameters:
- in: path
name: param
required: true
schema:
type: string
format: uuid
responses:
'200':
description: success
In the previous example /uuid-pattern/foobar returns properly an error, which can be casted as multierror with 2 errors but the uuid-format/foobar passes the validation.
Seems like the format is handled in the codebase:
|
func NewUUIDSchema() *Schema { |
|
return &Schema{ |
|
Type: TypeString, |
|
Format: "uuid", |
|
} |
|
} |
Is there a miss somewhere?
Seems like the string format validation does not seem to work in
pathIn the previous example
/uuid-pattern/foobarreturns properly an error, which can be casted as multierror with 2 errors but theuuid-format/foobarpasses the validation.Seems like the format is handled in the codebase:
kin-openapi/openapi3/schema.go
Lines 373 to 378 in 46e0df8
Is there a miss somewhere?