restate icon indicating copy to clipboard operation
restate copied to clipboard

Schemars of enum variants is not really helpful

Open tillrohrmann opened this issue 2 months ago • 4 comments

Looking at our configuration specification, schemars does not generate helpful output when it comes to specifying the different variants. For example, it is not clear from this description that one needs to put type = "replicated" in order to select the replicated metadata client.

Image

tillrohrmann avatar Oct 17 '25 20:10 tillrohrmann

Good part of this was fixed in schemars 1.0, see #3766

slinkydeveloper avatar Oct 18 '25 18:10 slinkydeveloper

As reported by a community member (https://discord.com/channels/1128210118216007792/1434972333122261003/1434972333122261003):

Another example are https://docs.restate.dev/references/server-config#param-on-max-attempts where the docs don't show the values one can select.

Image

The item just above it on max-attempts has an additional issue, that it appears to take an object containing the key Bounded, like { Bounded: 5 }. But in actuality this Rust enum is using serde untagged mode and so the correct configuration method is just to pass a number.

Finally, there seem to be duplicate anchors. If you click the max-attempts link it actually goes to a different max_attempts elsewhere in the page.

Image

tillrohrmann avatar Nov 03 '25 20:11 tillrohrmann

This problem is purely on the side of the docs. Mintlify doesn't have any plugin for visualizing the configuration schema well, so we had to manually write something, and I think a few things don't show correctly. I will have a look.

gvdongen avatar Nov 04 '25 07:11 gvdongen

all issues were solved on the side of the docs.

Except for these two:

The item just above it on max-attempts has an additional issue, that it appears to take an object containing the key Bounded, like { Bounded: 5 }. But in actuality this Rust enum is using serde untagged mode and so the correct configuration method is just to pass a number.

--> this requires changes on the runtime side

Finally, there seem to be duplicate anchors. If you click the max-attempts link it actually goes to a different max_attempts elsewhere in the page.

--> this is not easily fixable because it is embedded within the mintlify ResponseField component.

gvdongen avatar Nov 06 '25 19:11 gvdongen