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
The following code is used to parse 'nullable' parameter from metadata: self._nullable = bool(nullable) (VariableDeclaration line #606)
The problem is that 'nullable' parameter is passed as a string value ("true" or "false") or None. So bool(nullable) treats both "true" and "false" values as True. Moreover, the default or missing value (None) should be treated as nullable, but it's not.
@filak-sap I haven't noticed that you've created already a PR and created another one.
There're some differences between your fix and mine:
After some research I think that 'VariableDeclaration' is not the right place to parse string values. Moved it to a different place also to make consistent with other bool attributes.
I use different default values for 'Nullable' attribute in properties and parameters (function imports). Not sure it's the right thing to do (cannot find the specification for Parameters in the OData protocol specification), but it keeps my changes compatible with the existing tests.
I was not sure about the FunctionImport parameters. The documentation is not clear and contains the information that "Nullable" is described elsewhere, so I decided to change the behaviour.
Anyways, I'll use your patch - I already dropped my patch from the PR.
Activity
filak-sap commentedon Apr 27, 2020
Yay, that's embarrassing. Are you going to open a PR?
model: correctly parse Nullable attribute values
model: correctly parse Nullable attribute values
model: correctly parse Nullable attribute values
'Nullable' attributes are correctly parsed and reviewed.
homutov commentedon Apr 29, 2020
@filak-sap I haven't noticed that you've created already a PR and created another one.
There're some differences between your fix and mine:
Could you please take a look?
filak-sap commentedon Apr 29, 2020
I was not sure about the FunctionImport parameters. The documentation is not clear and contains the information that "Nullable" is described elsewhere, so I decided to change the behaviour.
Anyways, I'll use your patch - I already dropped my patch from the PR.
Just sign the CLA, please.
'Nullable' attributes are correctly parsed and reviewed.
'Nullable' attributes are correctly parsed and reviewed.
homutov commentedon Apr 29, 2020
@filak-sap signed CLA (took some time - had a type and my email and could not sign) and fixed the comment.
'Nullable' attributes are correctly parsed and reviewed.