evanw / kiwi

A schema-based binary format for efficiently encoding trees of data

Home Page:http://evanw.github.io/kiwi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I make a field in a `struct` optional?

hamirmahal opened this issue · comments

Some struct MarkerSchemas have the optional string tooltipLabel field, and others don't.

How do I indicate to kiwi that the string tooltipLabel field is optional?

image

You can’t do that. The point of using a struct is to avoid unnecessary overhead when you know all fields are non-optional. You should be using message instead. This is documented here: https://github.com/evanw/kiwi#user-types.

Ah, that helped me get things working at http://evanw.github.io/kiwi/.

Thank you for your response!