Skip to content

Lists disappear from typescript docs #6

Description

@edsko

If I have

data RequestSessionUpdate =
    RequestUpdateSourceFileFromFile RequestFilePath
  | RequestUpdateGhcOpts RequestGhcOption

with corresponding grammar

instance Json RequestSessionUpdate where
  grammar = label "SessionUpdate" $
    object $ mconcat [
          property "sessionUpdate" "updateSourceFileFromFile"
        . fromPrism requestUpdateSourceFileFromFile . prop "filePath"
      ,   property "sessionUpdate" "updateGhcOpts"
        . fromPrism requestUpdateGhcOpts . prop "options"
      ]

the documentation looks like

interface SessionUpdate {filePath ? : FilePath ;sessionUpdate ? : string ;options ? : GhcOption ;}

This is not ideal (see #5), but at least it lists all fields. However, once I change the type to use a list

data RequestSessionUpdate =
    RequestUpdateSourceFileFromFile RequestFilePath
  | RequestUpdateGhcOpts [RequestGhcOption]

the documentation suddenly doesn't list the options field at all anymore:

interface SessionUpdate {filePath ? : FilePath ;sessionUpdate ? : string ;}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions