Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify message tag
simple replace on word in string.
  • Loading branch information
anakhalil committed Dec 21, 2022
commit 0f55cfde39b8bbf41ebeec654f37d7266402120c
3 changes: 1 addition & 2 deletions schema_enforcer/schemas/jsonschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import copy
import pkgutil
import json
import re

from jsonschema import Draft7Validator, draft7_format_checker # pylint: disable=import-self
from schema_enforcer.schemas.validator import BaseValidation
Expand Down Expand Up @@ -62,7 +61,7 @@ def validate(self, data, strict=False):

if 'errMessage' in err.schema:
message = err.schema['errMessage']
message = re.sub(r'[s]\w+', str(err.instance), message)
message = message.replace("$iData", str(err.instance))
else:
message = err.message

Expand Down