-
Notifications
You must be signed in to change notification settings - Fork 4
Scalar collections fixes #42
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
Conversation
e368341
to
f1c9049
Compare
f1c9049
to
aa8c3da
Compare
222513f
to
c2aaa93
Compare
# | ||
# It will be converted to: | ||
# | ||
# [{ "$key" => "vers", "$value" => "4" }, { "$key" => "timeout", "$value" => "0" }] |
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 in the pillar, I see 4 possibilities along 2 axes:
Outside, the collection is one of
- Hash
- Array
Inside, its elements are one of
- scalar
- group (hash)
How do we represent that in FormData?
For the "outside" axis, we always use an array, and represent a hash by embedding "$key" inside.
For the "inside", we either put plain scalars (for an array of scalars), or if we have a hash on the outside, then we use a hash which always has a "$key" element and then either the other elements, or a "$value" element if it is a hash of scalars.
Is that right?
It seems to me that we could simplify this by always having a hash at the inside, with an array of scalars being represented as [{ "$value" => "one" }, { "$value" => "two" }, ...]
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.
Yes, you are right. I will try that approach.
Formula:
Pillar:
By now we are only supporting "text" ones
Pending: Reading and writing the pillar data