openapi-spec-validator icon indicating copy to clipboard operation
openapi-spec-validator copied to clipboard

draft4_format_checker checkers removed

Open lucas03 opened this issue 3 years ago • 0 comments

Hey, we are using custom checkers, as connexion suggests here. For example, this is our currency checker:

@draft4_format_checker.checks("iso-4217")
def validate_currency(to_validate: Optional[str]) -> bool:
    """Validation for iso-4217 currency."""
    return to_validate is None or to_validate in locale.currencies

But since version openapi-spec-validator-0.2.10 this no longer works. I noticed it's removed in this commit. Is there a suggestion what should be used instead?

Error message: prance.ValidationError: ("Format checker for 'iso-4217' format not found", 'format', deque([]), None, [], 'iso-4217', 'EUR', {'type': 'string', 'default': 'EUR', 'format': 'iso-4217', 'nullable': False}, deque(['format']), None)

lucas03 avatar Jan 31 '22 11:01 lucas03