Open rohaldb opened 4 years ago
Fwiw, I don't think Dredd ever supported byte format. It's just that in prior versions of Dredd there wasn't any validation in place so Dredd didn't error out when encountering unsupported formats.
I think we can restore this behaviour by passing the unknownFormats
option to AJV (the JSON Schema validation library) in Gavel (the validation library Dredd uses), as per Ajv docs:
The option unknownFormats allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can whitelist specific format(s) to be ignored. See Options for details.
I think this would go into https://github.com/apiaryio/gavel.js/blob/a7d1b5352291c3b360df9df5218d53c86c8b02e2/lib/validators/json-schema-next.js#L174
Describe the bug Certain string formats are no longer supported in 13.0.0. Still working:
date
,date-time
No longer working:byte
,password
,binary
To Reproduce I have a simple express server:
Swagger 2.0 file
api-description.yml
:Running
./node_modules/.bin/dredd
with ^13.0.0 fails validation with errorError: unknown format "byte" is used in schema at path "#/properties/message"
Expected behavior It should validate successfully, which it does in 12.2.0
What is in your
dredd.yml
?What's your
dredd --version
output? 13.0.2Does
dredd --loglevel=debug
uncover something? Nothing I can see