2.2.6.3.1 Common Verbose JSON Serialization Rules for All EDM Constructs

Literal values of the Entity Data Model (EDM) primitive types are represented as Verbose JSON literal values, as defined by the rules in the following Common Verbose JSON Serialization Rules for All EDM Constructs table. Grammar rules not defined here are specified in [RFC5234], [RFC4627], or both.

EDM primitive type

ABNF rule for primitive type representation in Verbose JSON payloads

Verbose JSON serialization format (ABNF grammar)

null

nullLiteral

nullLiteral        =   "null"

Edm.Binary

VJsonBinary

VJsonBinary =   quotation-mark 
<Base64 encoded   value of the EDM.Binary  
                property represented as a JSON string.   
              See   [RFC4627] for further details> 
quotation-mark

Edm.Boolean

VJsonBoolean

VJsonBoolean = false   / true 
 
false       = ; see   [RFC4627] section 2.1 
 
true        = ; see   [RFC4627] section 2.1

Edm.Byte

VJsonByte

VJsonByte    = ; see   the byteLiteral rule in  
              ;   section 2.2.2 

Edm.DateTime

VJsonDateTime

VJsonDateTime=   quotation-mark  
                "\/Date(" 
              ticks
                [("+" / "-") offset]
                ")\/" 
                quotation-mark 
 
ticks       = *DIGIT   
 
; ticks is the   number of milliseconds since midnight  
; January 1, 1970 
                 
offset      = 4DIGIT
; offset represents   the number of minutes to add (if preceded by "+") or substract
(if preceded by   "-") from the time value represented by ticks
; if no offset is   specified, the value MUST be interpreted as UTC.
                 
;Note: This format   is the same used by the ASP.NET 
;AJAX framework,   described in http://msdn2.microsoft.com/en-;us/library/bb299886.aspx

Edm.Decimal

VJsonDecimal

VJsonDecimal     =   quotation-mark  
                    decimalLiteral  
                    quotation-mark 
 
decimalLiteral  = ;   see section 2.2.2    
                 
quotation-mark  = ;   see [RFC4627] section 2.5

Edm.Double

VJsonDouble

VJsonDouble      =   doubleLiteral
 
doubleLiteral   = ;   see section 2.2.2

Edm.Guid

VJsonGuid

VJsonGuid        =   quotation-mark  
                    guidLiteral
                    quotation-mark            
 
guidLiteral    = ;   see section 2.2.2

Edm.Int16

VJsonInt16

VJsonInt16    = ; see   int16Literal in section 2.2.2

Edm.Int32

VJsonInt32

VJsonInt32    = ; see   int32Literal in section 2.2.2

Edm.Int64

VJsonInt64

VJsonInt64    =   quotation-mark  
                 int64Literal  
                 quotation-mark   
 
int64Literal = ; see   section 2.2.2

Edm.SByte

VJsonSByte

VJsonSByte    = ; see sByteLiteral   in section 2.2.2

Edm.Single

VJsonSingle

VJsonSingle      =   singleLiteral
 
singleLiteral   = ;   see section 2.2.2

Edm.String

VJsonString

VJsonString =   string  
 
string     =  ; see   [RFC4627] section 2.5

Edm.Time

VJsonTime

VJsonTime        =   quotation-mark
                    timeLiteral
                    quotation-mark
                 
timeLiteral     = ;   see section 2.2.2

Edm.DateTimeOffset

VJsonDateTimeOffset

VJsonDateTimeOffset   =  VJsonDateTime
; offset is required

Edm.Stream

N/A

namedStreamInVJson= see   section 2.2.6.3.14

Edm.Geography

N/A

N/A

Edm.GeographyPoint

pointVJsonLiteral

pointVJsonLiteral = <See   [GeoJSON] representation for a Point>

Edm.GeographyLineString

lineStringVJsonLiteral

lineStringVJsonLiteral =   <See [GeoJSON] representation for a LineString>

Edm.GeographyPolygon

polygonVJsonLiteral

polygonVJsonLiteral   = <See [GeoJSON] representation for a
Polygon, except as   modified below>
                 
In Ellipsoidal   coordinates, all rings are equally
interpretable as   "outer". Therefore, the rings MUST have
their control points   in left-foot winding order. This means
that the points to   the left side of the ring, when traversing in serialized
order, are in the   polygon,
while those to the   right side are not.
                 
In planar   coordinates, where "outer" is well defined, the
first ring MUST be   the outer ring, in accordance with the
JSON standard.

Edm.GeographyCollection

geoCollectionVJsonLiteral

geoCollectionVJsonLiteral =   <See [GeoJSON] representation for a GeometryCollection>

Edm.GeographyMultiPoint

multiPointVJsonLiteral

multiPointVJsonLiteral =   <See [GeoJSON] representation for a MultiPoint>

Edm.GeographyMultiLineString

multiLineStringVJsonLiteral

multiLineStringVJsonLiteral   = <See [GeoJSON] representation for a MultiLineString>

Edm.GeographyMultiPolygon

multiPolygonVJsonLiteral

multiPolygonVJsonLiteral   = <See [GeoJSON] representation
for a MultiPolygon,   as modified below> 
                 
In Ellipsoidal   coordinates, all rings are equally
interpretable as   "outer". Therefore, the rings MUST have
their control points   in left-foot winding order. This means
that the points to   the left side of the ring, when
traversing in   serialized order, are in the polygon,
while those to the   right side are not.
                 
In planar   coordinates, where "outer" is well defined, the
first ring MUST be   the outer ring, in accordance with the
 JSON standard.

Edm.Geometry

N/A

N/A

Edm.GeometryPoint

pointVJsonLiteral

N/A

Edm.GeometryLineString

lineStringVJsonLiteral

N/A

Edm.GeometryPolygon

polygonVJsonLiteral

N/A

Edm.GeometryCollection

geoCollectionVJsonLiteral

N/A

Edm.GeometryMultiPoint

multiPointVJsonLiteral

N/A

Edm.GeometryMultiLineString

multiLineStringVJsonLiteral

N/A

Edm.GeometryMultiPolygon

multiPolygonVJsonLiteral

N/A

Table: Common Verbose JSON Serialization Rules for All EDM Constructs