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.
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.
This seems like an implementation detail / something the exporter should do if required. If I have an exporter that supports arbitrary strings as keys and values then I don't want to urlencode -- I might even have to urldecode in the exporter.
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.
It is also important for when reading in from the environment, or other sources.
If the value is simply defined as urlencoded then it makes dealing with these simpler and defined all at once.
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.
Well, not really IMHO. If we just define that values are URL-encoded then I will still need to urldecode the environment variable to avoid double-encoding when I pass the parsed values to the resource constructor.
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.
If it is defined as url-encoded then you know not to do an encoding so there is no need to decode.
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.
So who is responsible for doing the encoding?
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.
Ok, so just adding a
MUST be url encoded strings
?--
Edited to fix
SHOULD
toMUST
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 agree with @Oberon00 , this seems misplaced. In most cases the attributes will be transmitted either via proto or via JSON, neither of which require URL encoding, which only increases the size. The situation with reading ENV vars is an example of another externalized representation, which also happens to have other rules (like it's a comma-separated list). So URL-encoding may be applied to the definition of that externalized representation, not to the API or how the values are represented internally.
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.
"SHOULD be" is still bad. If that is true, then nothing changes, i.e. that statement has no effect. The question the spec should answer is who (implementation? caller?) should do what (encode? decode?) and when (at export? when creating resources? at the backend?).
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.
oops. I meant
MUST
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.
My reply is about the "be" though, should vs must is not my issue.