Skip to Content
0
Apr 29, 2020 at 07:17 AM

CAP JAVA oData: String as ODATA Key causes problems when including special characters

130 Views

Hey folks,

I'm implementing a JAVA App according to SAP CAP. I have an Odata Entity with a String key.

	entity FavoriteSet{ 
		key Id: String;
		Desc1: String;
		Desc2: String;
		Pinned: String;
	}

As long the key contains only URL-valid characters, everything works fine. But as soon as I have (url-encoded) special characters in it, it does not work. E.g. the following call returns an HTTP 400.

http://localhost:8080/odata/v4/NAVIGATE_SRV/FavoriteSet('KEY%2FTEST')

However, String Keys with url encoded characters are valid according to ODATA v4 spec: https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_URLSyntax

Is this a bug? Or am I missing something?

Thank you!

Simon