docsonnet icon indicating copy to clipboard operation
docsonnet copied to clipboard

Confusing output for keys with periods in them

Open jdbaldry opened this issue 4 years ago • 1 comments

Both docsonnet documentation fields below are rendered similarly such that I imagine a user could easily be confused by the structure of the data when seeing the Markdown documentation for a key with periods . in it.

{
  '#has.a.period': d.val('help'),
  'has.a.period': null,
  has: {
    a: {
      '#period': d.val('help'),
      period: null,
    },
  },
}

I guess keys that require quoting in Jsonnet should be enclosed in square brackets, the same as in Jsonnet so that the first key becomes ['has.a.period'] in the rendered documentation and the second key stays as has.a.period.

jdbaldry avatar Mar 02 '21 09:03 jdbaldry

I've made an attempt to fix this in the jsonnet renderer, it is more complex than I anticipated so I haven't looked at the golang version yet.

Duologic avatar Oct 24 '22 07:10 Duologic