[SOLVED] Content Item By Version - Response Inconsistent

We can query different version of a content item like below via API.

https://<SQUIDEX_URL>/api/content/<APP_NAME>/<SCHEMA_NAME>/<CONTENT_ID> --> Current
https://<SQUIDEX_URL>/api/content/<APP_NAME>/<SCHEMA_NAME>/<CONTENT_ID>/ --> Previous Versions

But the response structure is different for the current version compared to previous versions. When we query for the current version, I see all the metadata (id, createdBy,status,schema etc) properties and data property that holds the actual content. Like below
{ "id" : "1234", "createdBy" : "client:test", <MoreProperties> "data" : { "Title" : { "iv" : "Test" } } <MoreProperties> }

Whereas, when I query for a particular version, I don’t see any metadata properties and also there is no data property. The actual content is the response. Like below.
{ "Title" : { "iv" : "Test1" } }

Is this expected behavior ? I was of the impression that the response structure will be same irrespective of whether we query the current or previous version. Also, according to the OpenAPI specs, the response structure is the same.

Am I missing something ?

No, the spec is just wrong. It was built for the frontend only and eventually made public. I have to keep it like this for compatibility but a new endpoint can be added.

Thanks for the confirmation.

I have solved the problem:

  1. The /version endpoint has been fixed in the OpenApi.
  2. The /version endpoint is deprecated now.
  3. A ?version={number} Query has been added to the normal GET /…/id endpoint.

This topic was automatically closed after 2 days. New replies are no longer allowed.