Skip to content

Commit

Permalink
Remove link annotation from the error message string
Browse files Browse the repository at this point in the history
This removes the annotation [link] and [/link] from the code that is
supposed to clean the JSON schema error messages. However, while these
annotations might improve the readability of the URL to the JSON schema,
they are wrongly displayed on GitHub when running amdirt validate as
part of the GitHub workflow.
  • Loading branch information
alexhbnr committed Feb 7, 2025
1 parent 37e3c75 commit 37eaf18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion amdirt/validate/domain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def cleanup_errors(self, error: json_exceptions.ValidationError) -> DFError:
err_column = list(error.path)[-1]
if "enum" in error.schema:
if len(error.schema["enum"]) > 3:
error.message = f"'{error.instance}' is not an accepted value.\nPlease check [link={self.schema['items']['properties'][err_column]['$ref']}]{self.schema['items']['properties'][err_column]['$ref']}[/link]"
error.message = f"'{error.instance}' is not an accepted value.\nPlease check {self.schema['items']['properties'][err_column]['$ref']}"
err_line = str(error.path[0])
return DFError(
"Schema Validation Error",
Expand Down

0 comments on commit 37eaf18

Please sign in to comment.