You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been attempting to migrate from my own openapi validation package to this one. It took some time, but it looks like I've got most things working now.
A notable exception is that I would like human-readable error messages by using better-ajv-errors. https://www.npmjs.com/package/better-ajv-errors. This requires the following to be passed to AJV:
constajv=newAjv({jsonPointers: true});
I think the cleanest way to do this is to allow the user to pass AJV config to the AJV instance inside openapi-request-validator, openapi-response-validator, and possibly openapi-schema-validator. I'm not too bothered about the schema validator myself.
This would also allow the user to make AJV more strict if that's what their use case calls for. For example setting unknownFormats: true instead of 'ignore', or setting format: 'full' instead of 'fast'.
Edit: This is how it looks when I set jsonPointers: true in my node_modules:
The text was updated successfully, but these errors were encountered:
the other use case I've just faced is a need to pass multipleOfPrecision option. Without it AJV just isn't able to handle the multipleOf properly(ajv-validator/ajv#84).
I doubt if hardcoding any specific multipleOfPrecision value inside the "openapi-response-validator" makes sense for everyone, so it seems reasonable to defer the decision to the user of the "openapi-response-validator".
I've been attempting to migrate from my own openapi validation package to this one. It took some time, but it looks like I've got most things working now.
A notable exception is that I would like human-readable error messages by using
better-ajv-errors
. https://www.npmjs.com/package/better-ajv-errors. This requires the following to be passed to AJV:I think the cleanest way to do this is to allow the user to pass AJV config to the AJV instance inside
openapi-request-validator
,openapi-response-validator
, and possiblyopenapi-schema-validator
. I'm not too bothered about the schema validator myself.This would also allow the user to make AJV more strict if that's what their use case calls for. For example setting
unknownFormats: true
instead of'ignore'
, or settingformat: 'full'
instead of'fast'
.Edit: This is how it looks when I set
jsonPointers: true
in my node_modules:The text was updated successfully, but these errors were encountered: