You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just noticed that when adding properties with primitive types (boolean, int, etc.) to a class, they don't get marked as required, although they will definitely always have a value.
I notice this especially because I'm working with Kotlin and for non-primitive types, the Kotlin nullability is automatically and correctly applied. But when I use non-nullable Booleans or Ints, they're still optional in the api docs. I verified that the same thing happens for primitives in Java classes.
My expectation would be that primitives are always required. I understand that this would be a breaking change and that some people might prefer this behavior for input types, as primitive types have implicit default values. Therefore I'd be fine with it being an opt-in feature that I need to enable via config.
Does this feature already exist somehow (I might have just missed it)? Could it be implemented?
If someone can point me at the right part of the code, I could also have a go at an implementation myself.
The text was updated successfully, but these errors were encountered:
I know I can do it manually, but I'd much prefer to have it done automatically, so it works like other, non primitive types (at least in Kotlin, where the type system holds nullability information) and I don't have to add boilerplate code for something that should be obvious.
I just noticed that when adding properties with primitive types (
boolean
,int
, etc.) to a class, they don't get marked as required, although they will definitely always have a value.I notice this especially because I'm working with Kotlin and for non-primitive types, the Kotlin nullability is automatically and correctly applied. But when I use non-nullable
Boolean
s orInt
s, they're still optional in the api docs. I verified that the same thing happens for primitives in Java classes.My expectation would be that primitives are always required. I understand that this would be a breaking change and that some people might prefer this behavior for input types, as primitive types have implicit default values. Therefore I'd be fine with it being an opt-in feature that I need to enable via config.
Does this feature already exist somehow (I might have just missed it)? Could it be implemented?
If someone can point me at the right part of the code, I could also have a go at an implementation myself.
The text was updated successfully, but these errors were encountered: