oxidecomputer / oxide.rs

The Oxide Rust SDK and CLI
Mozilla Public License 2.0
37 stars 12 forks source link

Add `required` field to generated CLI schema #725

Closed david-crespo closed 1 week ago

david-crespo commented 2 months ago

Closes #724

Draft because the results seem a little weird, need to look into that. Mostly path params and parent specifiers are required, but I think there are a lot more args that are required that are not being marked as such.

wfchandler commented 1 week ago

Part of the problem is that many fields are set as required_unless in the CLI, which doesn't return true for is_required_set. There's also no way to inspect an Arg to determine if it has required_unless set, so I think we're out of luck with those.

david-crespo commented 1 week ago

Blurg. Thanks for figuring that out. I think it would be pretty confusing to say some items are required but have it not be comprehensive. Probably worse than saying nothing. So I'm going to close this for now.