-
Notifications
You must be signed in to change notification settings - Fork 187
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
Add support for arbitrary JSON in attachments #259
Conversation
Codecov Report
@@ Coverage Diff @@
## master #259 +/- ##
==========================================
- Coverage 81.89% 81.87% -0.03%
==========================================
Files 26 26
Lines 1530 1528 -2
==========================================
- Hits 1253 1251 -2
+ Misses 209 208 -1
- Partials 68 69 +1
Continue to review full report at Codecov.
|
ec1deba
to
e979450
Compare
@zhouzhuojie Thanks for the feedback. |
pkg/mapper/entity_restapi/r2e/r2e.go
Outdated
return e, fmt.Errorf("all key/value pairs should be string/string. invalid attachment format %s", spew.Sdump(a)) | ||
} | ||
e[k] = s | ||
return e, fmt.Errorf("Make sure JSON is properly formatted. Invalid attachment format %s", spew.Sdump(a)) |
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.
one last nit, JSON format actually supports things like naked string, number, or null. here we may want to say:
"Make sure JSON is properly formatted into key/value pairs."
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.
No problem, pushing a fix now if you want to take a quick look
Update Dynamic Configuration section to match the variant attachment format updates introduced in openflagr#259.
Update Dynamic Configuration section to match the variant attachment format updates introduced in openflagr#259.
Allow storing arbitrary JSON structures within variants' attachment field
Description
Update the Attachment field type from map[string]string to map[string]interface{}
Motivation and Context
Enable using flagr as a smart general configuration store and remove hacks that use strings in order to store structured data
How Has This Been Tested?
The existing tests were updated to accommodate for this change
Types of changes
Checklist: