Skip to content

Commit

Permalink
DGS-7866: Use 35742 instead of $ as the prefix for reserved fields
Browse files Browse the repository at this point in the history
  • Loading branch information
akhileshm1 committed Nov 9, 2023
1 parent 69b6a68 commit 4aa97bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -408,11 +408,11 @@ public void validate(boolean strict) {
Optional<String> restrictedField = schema.getPropertySchemas()
.keySet()
.stream()
.filter(field -> field.startsWith("$"))
.filter(field -> field.startsWith("$$"))
.findAny();
if (restrictedField.isPresent()) {
throw new ValidationException(schema,
"Field names cannot start with $ symbol",
"Field names cannot start with $$ prefix",
"properties",
String.format("#/properties/%s", restrictedField.get()));
}
Expand Down
Expand Up @@ -949,7 +949,7 @@ public void testRestrictedFields() {
+ " \"$id\": {\n"
+ " \"type\": \"string\"\n"
+ " }, \n"
+ " \"$title\": {\n"
+ " \"$$title\": {\n"
+ " \"description\": \"Task title\",\n"
+ " \"type\": \"string\"\n"
+ " }, \n"
Expand All @@ -968,7 +968,7 @@ public void testRestrictedFields() {
+ " \"description\": \"A task\",\n"
+ " \"type\": \"object\",\n"
+ " \"properties\": {\n"
+ " \"id\": {\n"
+ " \"$id\": {\n"
+ " \"type\": \"string\"\n"
+ " }, \n"
+ " \"title\": {\n"
Expand Down

0 comments on commit 4aa97bb

Please sign in to comment.