Repository navigation
v0.22.0: value checks, $search expressions
What's new
Values checked against their type
Writes and data files were checked for the type of a value, but not for its range or format, so some values were stored that the type can't hold, or stored as something else:
POST Values {"Small": 300} Edm.Byte
before: 201, stored 300
now: 400 InvalidValue
POST Orders {"OrderDate": "2025-02-30"}
before: 201, stored 2025-03-02
now: 400 InvalidValue
Integers are checked against their type's range, decimals against Precision and Scale, dates against the calendar, and GUIDs, durations, binary and times of day against their format.
Dates in any timezone
A date that isn't ISO 8601 was read by JavaScript's date parser, in the server's own timezone: in a data file on a server in Athens, 2025/03/07 became 2025-03-06, and 07.03.2025 became July 2nd. Now a date is ISO 8601 (2025-03-07, 2025-03-07T10:00:00Z), or with a space for the T and slashes, as spreadsheets write them. Without a zone it's UTC, on every server. Anything else is refused rather than guessed at.
$search, as the spec reads it
$search was one substring. Fiori Elements V4 sends a search field's words quoted, "open" "gmbh", which then matched nothing. Now $search takes the spec's search expression: words and phrases, AND (or a space), OR, NOT and parentheses:
GET PurchaseOrderSet?$search="open" "gmbh"
before: no rows
now: the orders with both words
V2 has no $search. SAP Gateway reads a basic search from search=, which UI5's V2 model sends for a list report's search field. The V2 service read nothing from it, and now reads it as V4 reads $search.
Every digit of an Int64 or a Decimal
Without IEEE754Compatible=true, V4 wrote Int64 and Decimal values as JSON numbers through a double, which rounds them:
GET Values(1)
before: "Big": 9007199254740992, "Amount": 12345678901234567000
now: "Big": 9007199254740993, "Amount": 12345678901234567890.12
A JSON data file's numbers keep every digit too.
Metadata as CAP and RAP write it
A schema alias in a type reference (BaseType="SAP__self.Base") stopped the server from starting. Aliases, TypeDefinitions, binding targets qualified with their container and IncludeInServiceDocument="false" are now read. Singletons aren't served: the startup log lists them, and a navigation to one is a 501 saying why.
And
round()takes a midpoint away from zero.- Durations compare by length.
INFandNaNare now accepted as literals.groupbyandcountdistinctkeep INF, -INF and NaN apart.- An entity's
/$valueis a 501. - A
$batchbody holding the boundary's text is no longer split.
Upgrading
- A data file with a value its type can't hold, or a date that isn't ISO 8601 (
07.03.2025,03/07/2025), stops the start, naming the file. Write dates as2025-03-07. - A system query option the protocol doesn't have is a 400:
$TOP, a misspelt$fliter,$count=truein V2. Custom options such assap-clientaren't affected. $search=foo barfinds the entities with both words, not the textfoo bar. To search for the text, quote it:$search="foo bar".- A Decimal written with an exponent is stored as its digits:
1.5e2is150.
Install
npx odata-prova@0.22.0 ./MySrv
docker run -p 3000:3000 -v "$PWD/MySrv:/models/MySrv:ro" ghcr.io/jaravan/odata-prova:0.22.0Details: Supported OData features (types, query options, search).