Skip to content
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

All examples that are a composite type (array, object) should be quoted, to avoid YAML interpreting them #781

Closed
1 of 3 tasks
webmat opened this issue Mar 11, 2020 · 2 comments · Fixed by #966
Closed
1 of 3 tasks
Assignees
Labels
1.7.0 ready Issues we'd like to address in the future.

Comments

@webmat
Copy link
Contributor

webmat commented Mar 11, 2020

This issue mostly affects objects (like the example for labels). But it could also affect arrays, if for example we have an array that contains an unquoted NO, which would be interpreted by YAML as False, rather than the string "NO".

This issue not only affects the generated artifacts in the ECS repo, but also artifacts down the line, e.g. Beats starting from generated/beats/fields.ecs.yml and in turn generating various other artifacts.

@codebrain
Copy link
Contributor

++ this would also help the .NET client where I have had to handle examples by "santizing" them so they can be safely written into XML comments:

https://github.com/elastic/ecs-dotnet/blob/dc0d44fe1b0b3028a6a1cec044c7d8b30d4423a7/src/Generator/SchemaExtensionMethods.cs#L18-L23

@gen0cide
Copy link

This definitely has created issues with trying to parse ECS YAML (both the source schema, as well as the generated).

Basically, the field has to get specified as:

type Definition struct {
  // ... other fields
  Example          interface{}     `config:"example"`
}

So normalizing this certainly removes that ugly workaround. Thanks!

@webmat webmat added the 1.6.0 label Mar 25, 2020
@ebeahan ebeahan added the ready Issues we'd like to address in the future. label Jul 20, 2020
@webmat webmat self-assigned this Aug 11, 2020
@webmat webmat added 1.7.0 and removed 1.6.0 labels Aug 18, 2020
@ebeahan ebeahan self-assigned this Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.0 ready Issues we'd like to address in the future.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants