-
-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hoist enum values from subschemas #1051
Conversation
Fixes kube-rs#1047 Signed-off-by: Teo Klestrup Röijezon <[email protected]>
Signed-off-by: Teo Klestrup Röijezon <[email protected]>
Signed-off-by: Teo Klestrup Röijezon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏼 Used this patch off of my code mentioned in #1047 and it solves my usecase - thanks!
"type": "string", | ||
"enum": ["Female", "Male", "Other"], | ||
"description": "Sex of the person" | ||
"description": "Gender of the person" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this drops variant-level documentation, do we want to include it in the enum property's documentation instead?
Do you mean something like this?
"description": "Gender of the person\n\nOther - This variant has a comment!"
I think it's better to keep the current version because users can still add variant-level documentation manually if they'd like. Automatically including them will be a nice opt-in feature, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, basically.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1051 +/- ##
==========================================
+ Coverage 72.24% 72.32% +0.07%
==========================================
Files 65 65
Lines 4687 4704 +17
==========================================
+ Hits 3386 3402 +16
- Misses 1301 1302 +1
|
Since kube fix it in kube-rs/kube#1051, we can use doc comment on variants
Since kube fix it in kube-rs/kube#1051, we can use doc comment on variants
Fixes #1047
Currently this drops variant-level documentation, do we want to include it in the enum property's documentation instead?