When guards are enabled, there is a check for x-nullable in determineResponseType; however, this only applies only to the outermost object of the response; in reality, fields nested inside of this object could also be marked as x-nullable. In this case, the generated code will throw an error if null is returned in the response.
What I suggest is to add something like the following (works for my use case, but I haven't yet verified this for all possible value types since I wanted to get feedback here before):
When guards are enabled, there is a check for
x-nullable
indetermineResponseType
; however, this only applies only to the outermost object of the response; in reality, fields nested inside of this object could also be marked asx-nullable
. In this case, the generated code will throw an error if null is returned in the response.What I suggest is to add something like the following (works for my use case, but I haven't yet verified this for all possible value types since I wanted to get feedback here before):