-
Notifications
You must be signed in to change notification settings - Fork 75
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
[Discuss] Usage of yaml
field type / multiline text fields
#280
Comments
One challenge with unmarshaling
but if the YAML value becomes a string then the template is no longer valid because it needs to be formed as
We solved this in the Beat module templates by including a |
Also I think we need documentation to explain how the different data types defined in the specification are supposed to behave. Developers (and implementors of the spec) need to know things like what validation is associated with each type, if there is any special rendering applied in handlebar templates. I could try to explain this in spec based on my observations of the behavior. |
Should we enforce more validation on the |
One of the valid user configuration variable types is
yaml
:package-spec/versions/1/data_stream/manifest.spec.yml
Line 58 in 1cd07c6
I do not recall much discussion during the original implementation of this type, but the intention was for Fleet UI to display a code editor with YAML syntax highlighting when this variable type is encountered:
https://github.com/elastic/kibana/blob/77636e73a918b0946ec3fda0b67745663e3498a5/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_var_field.tsx#L64
We assumed that authors would use this field to allow users to input yaml configuration, i.e. key-value pairs (agnostic of nesting levels, or types of values).
In the Crowdstrike integration, there is one field that expects multiline text input. Originally this field was set to
type: text
which causes Fleet to render a simple one-line input field, which is not a great UX for multiline content, and there was an issue with saving the value due to that. A fix (elastic/integrations#2701) was made by changing it totype: yaml
. While this works, I'm not sure thatyaml
should be used in this manner for values that are not key-value pairs. Might we consider a different spec for non-yaml, multiline text?This issue is intended to continue the discussion outside of where the original issue was found.
The text was updated successfully, but these errors were encountered: