V2 API - why isn't it self describing like V1?

Hello - i'm revisiting Prismic after several years and was refreshing my memory about the V1 and V2 api's - as I couldn't remember why my older work was in V1, and after studying my examples again it all came flooding back. Given the docs all seem to point to the V2 api now - is V1 going to continue to be supported?

I mention this as there seems to be lots of text around v2 api's being self describing etc - but yet when I query prismic to get information on a document - the structure of v2 results seems very oddly thought out - and I don't understand the decisions that were made for this api?

For example - in V1 a result was mostly self describing with a "type" field, e.g.

"data":{
"dashboard":{
"title":{"type":"StructuredText","value":[{"type":"heading1","text":"Test","spans":[]}]},
"description":{"type":"StructuredText","value":[{"type":"paragraph","text":"This is a test","spans":[]}]},
"picture":{"type":"Image","value":{"main":{"dimensions":{"width":2048,"height":1536},"alt":null,"copyright":null,"url":"https://images.prismic.io/slicemachine-blank/26d81419-4d65-46b8-853e-8ea902e160c1_groovy.png?auto=compress,format"}

However in V2 the same result doesn't describe the date types uniformally - in particular a picture has no Type information which seems strange to me?

"data":{
"title":[{"type":"heading1","text":"Test","spans":[]}],
"description":[{"type":"paragraph","text":"This is a test","spans":[]}],
"picture":{"dimensions":{"width":2048,"height":1536},"alt":null,"copyright":null,"url":"https://images.prismic.io/slicemachine-blank/26d81419-4d65-46b8-853e-8ea902e160c1_groovy.png?auto=compress,format"}}}]

What was the thinking behind this? Given the ethos of prismic is in information modelling, why would you throw away this type information in your newer api? I never understood this - and years later, coming back to look again and seeing how the product has evolved, this still sticks out as a sore thumb to me - as it limits the the programmability of Prismic in my opinion.

But I'm wondering if I am totally missing something here?

Tim

Hello @365nice

Welcome to Prismic community, and thanks for posting this question to us. This is indeed a good question.

There are few differences between V2 And V1 API. But If I address your question regarding the "type" field. This is the main difference in the content structure. The content structure for API V1 is more complex and meant to be used with one of our development kits. The content structure for API V2 is more simplified. This decision was taken to retrieving the content more briefly and clearly expressed. It also reduces the reliability of the development kits.

I hope I answered your question.

Let me know if you have any doubt.

Thanks,
Priyanka

Hi - so V1 is not going away and can be used reliably if your needs are more sophisticated (I am integrating a non-supported dynamic language, so perhaps fits the development kit ethos).

This said - it still seems like excluding "type" on some content vs other content doesn't really make things 'more simplified' - I would say in retrospect its more complicated. Perhaps a lesson for V3.

thanks,
Tim

Hello @365nice

Yes, you can retrieve the API with V1 too. And thanks a lot for the feedback. I'll pass this to our development team.

Thanks,
Priyanka

This thread has been closed due to inactivity. Flag to reopen.