Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Issue #9364 JSON config validation #10679
fix: Issue #9364 JSON config validation #10679
Changes from 31 commits
c5649c2
b69676b
42692c6
f589555
c35ee66
dd9627e
f7b44d0
11f7f06
ef3ff89
7b88c81
2765ec0
354256a
12a0185
c546382
a091fbe
ab2657e
af0c5c6
7a3732f
9086971
564d9dd
c34c068
44fbd88
8a669cd
0a25331
eae4382
7e8d3ca
db3cd49
bed120f
69235e2
8e72a65
87e42d8
7d7633e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 182 in config/config.go
config/config.go#L178-L182
Check warning on line 194 in config/config.go
config/config.go#L193-L194
Check warning on line 202 in config/config.go
config/config.go#L202
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gsergey418alt would that work? Using
"any"
as key seems strange.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm using it as a value here, try printing json.Marshal(confmap)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean?
I just think using the string "any" is strange. Would it work to test for a nil pointer or empty string instead? And adapting
ReflectToMap
accordingly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other empty strings in the output of ReflectToMap. Nil pointer could work, but "any" is perhaps more expressive e. g. this key contain anything, stop validating. I can change it to nil ptr if you want to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM, empty strings and nil values would also work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM, It wouldn't work with empty strings, but it would still fail at a later stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed "any" to nil
Check warning on line 241 in config/config.go
config/config.go#L240-L241
Check warning on line 683 in repo/fsrepo/fsrepo.go
repo/fsrepo/fsrepo.go#L682-L683