Open mathmoth opened 1 month ago
Camel case is commonly used in JavaScript, that's why properties start with lowercase. JavaScript (JSON) is case-sensitive, and that's why you're getting undefined
, i.e. there is no property called Url
. This is the case for all objects returned by the REST API, at least for all built-in properties, the exception is your custom properties which will have the casing you have defined them with.
Hi Johan, I think perhaps you misunderstood my issue, I'll try to clarify:
I was referring to the interface SiteDefinitionLanguage
in the content-delivery-sdk, this one right here:
https://github.com/episerver/content-delivery-js-sdk/blob/master/src/%40episerver/content-delivery/src/models.mts
This typescript interface has Url and UrlSegment with starting uppecase, whilst the API will return the data with starting lowercase:
So using the API and using the SDK's own typings you will get a mismatch on these properties, I was not referring to any custom properties.
I noticed a discrepancy between how the interface
SiteDefinitionLanguage
definesUrl
andUrlSegment
and what is returned from the Content Delivery API. In the API response these members are calledurl
andurlSegment
. Trying to accessUrl
will always result inundefined
.