JAFLabs / wa.dev-issues

File an issue about wa.dev
3 stars 0 forks source link

Variant cases with payloads don't show labels #1

Closed lann closed 3 months ago

lann commented 3 months ago

For example, the fermyon:spin/rdbms-types error type shows all variants as just string:

error: variant {
    string,
    string,
    string,
    string,
    string,
}

This leaves off the variant labels from the source WIT:

variant error {
    connection-failed(string),
    bad-parameter(string),
    query-failed(string),
    value-conversion-failed(string),
    other(string)
}

(https://github.com/fermyon/spin/blob/35c92cb5a7c32935956f98166cded23e556a84d4/wit/rdbms-types.wit#L3-L9)

Variants without payloads like fermyon:spin/redis's error do show the label.

macovedj commented 3 months ago

Fantastic Wit interface. So cool!

We fixed this issue but discovered a number of other ones. Having a sufficiently complex Wit package is invaluable for testing.

Now that we are on the other side of the push to get online, we are going to refactor the whole doc gen. Necessary to fix the remaining issues and get the functionality/info we want to display.