Skip to content

Cannot specify null as DefaultValue in CSDL XML #392

@ralfhandl

Description

@ralfhandl

To be able to omit a nullable property, it must be given a DefaultValue of null, because the client SHOULD NOT assume a DefaultValue otherwise (OData-CSDL, section 7.2.7).

In CSDL JSON, this can be expressed as

{"PropertyName": {"$Nullable": true, "$DefaultValue": null}}

But in CSDL XML, it cannot be expressed:

<Property Name="PropertyName" Type="Edm.String" Nullable="true"
  DefaultValue="null" />

would mean the string "null" as DefaultValue.

Questions:

  • Can the server assume a DefaultValue if none is specified?
  • OData-Protocol, section 8.2.8.6 instructs the client to interpret a missing property without DefaultValue as having null value. Does the "SHOULD NOT" rule above apply only to the case without omit-values preference?

Imported from ODATA-1625

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions