{"id":17297,"date":"2022-10-23T22:30:01","date_gmt":"2022-10-23T17:00:01","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/"},"modified":"2022-10-23T22:30:01","modified_gmt":"2022-10-23T17:00:01","slug":"solved-go-deserialization-when-type-is-not-known","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/","title":{"rendered":"[Solved] Go deserialization when type is not known"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-59065905\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"59065905\" data-parentid=\"59062330\" data-score=\"2\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<h3>TL;DR<\/h3>\n<p>Just use <code>json.Unmarshal<\/code>.  You can wrap it lightly, using your transport, and call <code>json.Unmarshal<\/code> (or with a <code>json.Decoder<\/code> instance, use <code>d.Decode<\/code>) on your prebuilt JSON bytes and the <code>v interface{}<\/code> argument from your caller.<\/p>\n<h3>Somewhat longer, with an example<\/h3>\n<p>Consider how <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/golang.org\/pkg\/encoding\/json\/#Unmarshal\"><code>json.Unmarshal<\/code><\/a> does its own magic.  Its first argument is the JSON (<code>data []byte<\/code>), but its second argument is of type <code>interface{}<\/code>:<\/p>\n<pre class=\"lang-golang prettyprint-override\"><code>func Unmarshal(data []byte, v interface{}) error\n<\/code><\/pre>\n<p>As the documentation goes on to say, if <code>v<\/code> really <em>is<\/em> just an <code>interface{}<\/code>:<\/p>\n<blockquote>\n<p>To unmarshal JSON into an interface value, Unmarshal stores one of these in the interface value:<\/p>\n<pre class=\"lang-golang prettyprint-override\"><code>bool, for JSON booleans\nfloat64, for JSON numbers\nstring, for JSON strings\n[]interface{}, for JSON arrays\nmap[string]interface{}, for JSON objects\nnil for JSON null\n<\/code><\/pre>\n<\/blockquote>\n<p>but if <code>v<\/code> has an underlying <em>concrete type<\/em>, such as <code>type myData struct { ... }<\/code>, it&#8217;s much fancier.  It only does the above if <code>v<\/code>&#8216;s underlying type <em>is<\/em> <code>interface{}<\/code>.<\/p>\n<p>Its <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/golang.org\/src\/encoding\/json\/decode.go?s=4043:4091#L85\">actual implementation<\/a> is particularly complex because it&#8217;s optimized to do the de-JSON-ification and the assignment into the target object at the same time.  In principle, though, it&#8217;s mostly a big type-switch on the underlying (concrete) type of the interface value.<\/p>\n<p>Meanwhile, what you are describing in your question is that you will first deserialize into generic JSON\u2014which really means a variable of type <code>interface{}<\/code>\u2014and then do your own assignment <em>out<\/em> of this pre-decoded JSON into another variable of type <code>interface{}<\/code>, where the type signature of your own decoder would be:<\/p>\n<pre class=\"lang-golang prettyprint-override\"><code>func xxxDecoder(\/* maybe some args here, *\/ v interface{}) error {\n    var predecoded interface{}\n\n    \/\/ get some json bytes from somewhere into variable `data`\n    err := json.Unmarshal(data, &amp;predecoded)\n\n    \/\/ now emulate json.Unmarshal by getting field names and assigning\n    ... this is the hard part ...\n}\n<\/code><\/pre>\n<p>and you would then <em>call<\/em> this code by writing:<\/p>\n<pre class=\"lang-golang prettyprint-override\"><code>type myData struct {\n    Field1 int    `xxx:\"Field1\"`\n    Field2 string `xxx:\"Field2\"`\n}\n<\/code><\/pre>\n<p>so that you know that JSON object key &#8220;Field1&#8221; should fill in your Field1 field with an integer, and JSON object key &#8220;Field2&#8221; should fill in your Field2 field with a string:<\/p>\n<pre class=\"lang-golang prettyprint-override\"><code>func whatever() {\n    var x myData\n    err := xxxDecode(..., &amp;x)\n    if err != nil { ... handle error ... }\n    ... use x.Field1 and x.Field2 ...\n}\n<\/code><\/pre>\n<p>But this is silly.  You can just write:<\/p>\n<pre class=\"lang-golang prettyprint-override\"><code>type myData struct {\n    Field1 int    `json:\"Field1\"`\n    Field2 string `json:\"Field2\"`\n}\n<\/code><\/pre>\n<p>(or even omit the tags since the field&#8217;s names are the default json tags), and then do this:<\/p>\n<pre class=\"lang-golang prettyprint-override\"><code>func xxxDecode(..., v interface{}) error {\n    ... get data bytes as before ...\n    return json.Unmarshal(data, v)\n}\n<\/code><\/pre>\n<p>In other words, <strong>just let <code>json.Unmarshal<\/code> do all the work<\/strong> by providing <em>json<\/em> tags in the data structures in question.  You still get\u2014and transmit across your special transport\u2014the JSON data bytes <em>from<\/em> <code>json.Marshal<\/code> and <code>json.Unmarshal<\/code>.  You do the transmitting and receiving.  <code>json.Marshal<\/code> and <code>json.Unmarshal<\/code> do all the hard work: you don&#8217;t have to touch it!<\/p>\n<h3>It&#8217;s still fun to see how <code>Json.Unmarshal<\/code> works<\/h3>\n<p>Jump down to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/golang.org\/src\/encoding\/json\/decode.go#L661\">around line 660 of <code>encoding\/json\/decode.go<\/code><\/a>, where you will find the thing that handles a JSON &#8220;object&#8221; (<code>{<\/code> followed by either <code>}<\/code> or a string that represents a key), for instance:<\/p>\n<pre class=\"lang-golang prettyprint-override\"><code>func (d *decodeState) object(v reflect.Value) error {\n<\/code><\/pre>\n<p>There are some mechanics to handle corner cases (including the fact that <code>v<\/code> might not be settable and\/or might be a pointer that should be followed), then it makes sure that <code>v<\/code> is either a <code>map[T1]T2<\/code> or <code>struct<\/code>, and if it is a map, that it&#8217;s suitable\u2014that both <code>T1<\/code> and <code>T2<\/code> will work when decoding the &#8220;key&#8221;:value items in the object.<\/p>\n<p>If all goes well, it gets into the JSON key-and-value scanning loop starting at line 720 (<code>for {<\/code>, which will break or return as appropriate).  On each trip through this loop, the code reads the JSON key first, leaving the <code>:<\/code> and value part for later.<\/p>\n<p>If we&#8217;re decoding into a <code>struct<\/code>, the decoder now uses the struct&#8217;s fields\u2014names and <code>json:\"...\"<\/code> tags\u2014to find a <code>reflect.Value<\/code> that we&#8217;ll use to store right into the field.<sup>1<\/sup>  This is <code>subv<\/code>, found by calling <code>v.Field(i)<\/code> for the right <code>i<\/code>, with some slightly complicated goo to handle embedded anonymous <code>structs<\/code> and pointer-following.  The core of this is just <code>subv = v.Field(i)<\/code>, though, where <code>i<\/code> is whichever field this key names, within the struct.  So <code>subv<\/code> is now a <code>reflect.Value<\/code> that represents the actual struct instance&#8217;s value, which we should set once we&#8217;ve decoded the value part of the JSON key-value pair.<\/p>\n<p>If we&#8217;re decoding into a map, we will decode the value into a temporary first, then store it into the map after decoding.  It would be nice to share this with the struct-field storing, but we need a different <code>reflect<\/code> function to do the store into the map: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/golang.org\/pkg\/reflect\/#Value.SetMapIndex\"><code>v.SetMapIndex<\/code><\/a>, where <code>v<\/code> is the <code>reflect.Value<\/code> of the map.  That&#8217;s why for a map, <code>subv<\/code> points to a temporary <code>Elem<\/code>.<\/p>\n<p>We&#8217;re now ready to convert the actual value to the target type, so we go back to the JSON bytes and consume the colon <code>:<\/code> character and read the JSON value.  We get the value and store it into our storage location (<code>subv<\/code>).  This is the code starting at line 809 (<code>if destring {<\/code>).  The actual assigning is done through the decoder functions (<code>d.literalStore<\/code> at line 908, or <code>d.value<\/code> at line 412) and these actually decode the JSON value while doing the storing.  Note that only <code>d.literalStore<\/code> really stores the value\u2014<code>d.value<\/code> calls on <code>d.array<\/code>, <code>d.object<\/code>, or <code>d.literalStore<\/code> to do the work recursively if needed.<\/p>\n<p><code>d.literalStore<\/code> therefore contains many <code>switch v.Kind()<\/code>s: it parses a <code>null<\/code> or a <code>true<\/code> or <code>false<\/code> or an integer or a string or an array, then makes sure it can store the resulting value into <code>v.Kind()<\/code>, and chooses <em>how<\/em> to store that resulting value into <code>v.Kind()<\/code> based on the combination of what it just decoded, and the actual <code>v.Kind()<\/code>.  So there&#8217;s a bit of a combinatorial explosion here, but it gets the job done.<\/p>\n<p>If all that worked, and we&#8217;re decoding to a map, we may now need to massage the type of the temporary, find the real key, and store the converted value into the map.  That&#8217;s what lines 830 (<code>if v.Kind() == reflect.Map {<\/code>) through the final close brace at 867 are about.<\/p>\n<hr>\n<p><sup>1<\/sup>To find fields, we first look over at <code>encoding\/json\/encode.go<\/code> to find <code>cachedTypeFields<\/code>.  It is a caching version of <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/golang.org\/src\/encoding\/json\/encode.go#L1074\"><code>typeFields<\/code><\/a>.  This is where the json tags are found and put into a slice.  The result is cached via <code>cachedTypeFields<\/code> in a map indexed by the reflect-type value of the <code>struct<\/code> type.  So what we get is a slow lookup the first time we use a <code>struct<\/code> type, then a fast lookup afterwards, to get a slice of information about how to do the decoding.  This slice-of-information maps from json-tag-or-field name to: field; type; whether it&#8217;s a sub-field of an anonymous structure; and so on: everything we will need to know to decode it properly\u2014or to encode it, on the encoding side.  (I didn&#8217;t really look closely at this code.)<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">5<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Go deserialization when type is not known <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] TL;DR Just use json.Unmarshal. You can wrap it lightly, using your transport, and call json.Unmarshal (or with a json.Decoder instance, use d.Decode) on your prebuilt JSON bytes and the v interface{} argument from your caller. Somewhat longer, with an example Consider how json.Unmarshal does its own magic. Its first argument is the JSON (data &#8230; <a title=\"[Solved] Go deserialization when type is not known\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/\" aria-label=\"More on [Solved] Go deserialization when type is not known\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[596,935],"class_list":["post-17297","post","type-post","status-publish","format-standard","hentry","category-solved","tag-go","tag-serialization"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] Go deserialization when type is not known - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Go deserialization when type is not known - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] TL;DR Just use json.Unmarshal. You can wrap it lightly, using your transport, and call json.Unmarshal (or with a json.Decoder instance, use d.Decode) on your prebuilt JSON bytes and the v interface{} argument from your caller. Somewhat longer, with an example Consider how json.Unmarshal does its own magic. Its first argument is the JSON (data ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-23T17:00:01+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Go deserialization when type is not known\",\"datePublished\":\"2022-10-23T17:00:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/\"},\"wordCount\":961,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"go\",\"serialization\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/\",\"name\":\"[Solved] Go deserialization when type is not known - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-10-23T17:00:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Go deserialization when type is not known\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Go deserialization when type is not known - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Go deserialization when type is not known - JassWeb","og_description":"[ad_1] TL;DR Just use json.Unmarshal. You can wrap it lightly, using your transport, and call json.Unmarshal (or with a json.Decoder instance, use d.Decode) on your prebuilt JSON bytes and the v interface{} argument from your caller. Somewhat longer, with an example Consider how json.Unmarshal does its own magic. Its first argument is the JSON (data ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/","og_site_name":"JassWeb","article_published_time":"2022-10-23T17:00:01+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Go deserialization when type is not known","datePublished":"2022-10-23T17:00:01+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/"},"wordCount":961,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["go","serialization"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/","url":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/","name":"[Solved] Go deserialization when type is not known - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-10-23T17:00:01+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-go-deserialization-when-type-is-not-known\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Go deserialization when type is not known"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/17297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=17297"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/17297\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=17297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=17297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=17297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}