Resolve_links does not work as described according the documentation

Hello!

when requesting my main navigation with parameter resolve_links=url it does not return the object as it is documented.

Per documentation Url resolving added to Content Delivery API - Storyblok


using the parameter resolve_links=url should return a link object which includes a story object where i could access the slug.

But that is not the case, what i get is:

missing the story object in here. A view days ago, with the same request it did work so it sounds like a bug! but maybe i am using it wrong.

The request i use is build up as following:

https://api.storyblok.com/v2/cdn/stories/main_navigation?language=de&resolve_links=url&token=Ds1oDSeudcMDZ9nUD4QHfQtt&version=published

I created a new public token, so you can have a look on the request. i will delete the token later.
This totally breaks my navigation as the object is not valid anymore. Am i using it wrong, or is this a new bug?

The response i get:

{"story":{"name":"Hauptnavigation","created_at":"2021-07-23T19:13:09.562Z","published_at":"2021-07-30T19:37:40.510Z","id":62331418,"uuid":"fb4ccef2-0f33-4150-881e-7f7402ced26e","content":{"_uid":"1aa96047-2d42-440d-bfef-8cc547e9e3bb","component":"MainNavigation","main_navigation":[{"_uid":"f0d9946d-da72-488e-b077-e8483a54e737","link":{"id":"12969258-e475-4875-b0f1-2054a4650f58","url":"","anchor":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/home","prep":true},"name":"Home","component":"navigationItem"},{"_uid":"91b185c8-807f-4cfc-9ab2-4a1ea6053c89","link":{"id":"8953ae9c-2a98-4b87-b353-07343f3e8b18","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/plan-b-corona","prep":true},"name":"Plan B - Corona","component":"navigationItem"},{"_uid":"d2d9a26b-17db-45d7-bba6-edfb3b05b571","link":{"id":"e510ec6a-ad92-4035-a320-edf7ceecdab2","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/news","prep":true},"name":"Aktuelles","component":"navigationItem"},{"_uid":"a372d9b6-c3f7-4ca9-a038-a293a890f477","link":{"id":"734d0dca-94c1-4e93-bf73-5bf1276aee63","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/appartments","prep":true},"name":"Appartements","component":"navigationItem"},{"_uid":"58c4e2b7-adf0-435c-859b-c7850a3a873a","link":{"id":"c7213f58-f59d-4c12-a120-46625960cad4","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/video","prep":true},"name":"Videos","component":"navigationItem"},{"_uid":"6a98eea4-8a88-4103-adae-f5bf90a72866","link":{"id":"5c892a87-2c91-4fc0-a749-dc632d7ad54e","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/gastro","prep":true},"name":"Gastronomie","component":"navigationItem"},{"_uid":"d97bea30-8cca-4cdd-915c-d1229c472b81","link":{"id":"6f022664-c46f-4028-9b72-69b9f79ea743","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/lage","prep":true},"name":"Lage","component":"navigationItem"},{"_uid":"a507bafd-81cd-4ea9-a736-af55e46d7f4d","link":{"id":"81113479-f912-4c0e-8fe4-a01f001f79a3","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/wegbeschreibung","prep":true},"name":"Wegbeschreibung","component":"navigationItem"},{"_uid":"e24cc444-e8ad-4a21-bdf1-0fb23693e6f9","link":{"id":"bf4289b3-0b90-4561-9fa2-99a5ee317752","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/pool","prep":true},"name":"Pool","component":"navigationItem"},{"_uid":"0f71a506-1558-4476-8c35-46c17f1c9aa3","link":{"id":"51786372-4be8-4e16-8df4-e323c5b5edea","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/pferde","prep":true},"name":"Pferde","component":"navigationItem"},{"_uid":"0068ed72-0a12-4784-bbcc-47073159a16d","link":{"id":"9a2aef7c-f4a2-4bb9-8b5b-179ed808dd0e","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/wanderritte","prep":true},"name":"Wanderritte","component":"navigationItem"},{"_uid":"614876e3-9cee-402f-a9e2-9dc0563058dd","link":{"id":"524800d0-d913-494c-b9e6-08f55823db1b","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/sport","prep":true},"name":"Sport","component":"navigationItem"},{"_uid":"b6257b42-a2a4-49f0-91e5-ae2b38320e6f","link":{"id":"5b12bdee-81e9-42be-b830-cff6cea9461c","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/ausfluege","prep":true},"name":"Ausflüge","component":"navigationItem"},{"_uid":"a001eca3-386f-4806-82b4-c91ea08559b0","link":{"id":"9ad1a251-0c9f-4e9f-a28f-616350a93a89","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/preise","prep":true},"name":"Preise","component":"navigationItem"},{"_uid":"b3f44270-3802-47d1-b729-715e4541c063","link":{"id":"e493e9be-2066-4ee6-9820-2acc953284b6","url":"","anchor":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/ueber-uns","prep":true},"name":"Über uns","component":"navigationItem"},{"_uid":"0e775728-0fca-43c9-ab44-73c84d2e0824","link":{"id":"11ff5bb0-2b2a-4068-9961-3498d37f9806","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/kontakt","prep":true},"name":"Kontakt","component":"navigationItem"},{"_uid":"8b3df529-ae19-46f9-9353-9ef7b6cba529","link":{"id":"1ebc3547-1c0e-4024-97a1-c3be1213bdcf","url":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/presse","prep":true},"name":"Presse","component":"navigationItem"},{"_uid":"24326b22-6caa-4e2f-a04e-a98fc024b6cd","link":{"id":"530df307-9ec0-4a0a-80c6-fc481a7e4773","url":"","anchor":"","linktype":"story","fieldtype":"multilink","cached_url":"/de/links","prep":true},"name":"Links","component":"navigationItem"}]},"slug":"main_navigation","full_slug":"de/main_navigation","sort_by_date":null,"position":0,"tag_list":[],"is_startpage":false,"parent_id":null,"meta_data":null,"group_id":"fa7d2ee5-0510-4611-bf76-440fdab3e3a6","first_published_at":"2021-07-25T21:39:40.000Z","release_id":null,"lang":"de","path":"/","alternates":[],"default_full_slug":null,"translated_slugs":null},"cv":1627673860,"rels":[],"links":[{"name":"Preise","id":61278126,"uuid":"9ad1a251-0c9f-4e9f-a28f-616350a93a89","slug":"preise","url":"preise","full_slug":"de/preise"},{"name":"Gastro","id":61278118,"uuid":"5c892a87-2c91-4fc0-a749-dc632d7ad54e","slug":"gastro","url":"gastro","full_slug":"de/gastro"},{"name":"Ausflüge","id":61278125,"uuid":"5b12bdee-81e9-42be-b830-cff6cea9461c","slug":"ausfluege","url":"ausfluege","full_slug":"de/ausfluege"},{"name":"Kontakt","id":61278128,"uuid":"11ff5bb0-2b2a-4068-9961-3498d37f9806","slug":"kontakt","url":"kontakt","full_slug":"de/kontakt"},{"name":"Video","id":61278117,"uuid":"c7213f58-f59d-4c12-a120-46625960cad4","slug":"video","url":"video","full_slug":"de/video"},{"name":"Wanderritte","id":61278123,"uuid":"9a2aef7c-f4a2-4bb9-8b5b-179ed808dd0e","slug":"wanderritte","url":"wanderritte","full_slug":"de/wanderritte"},{"name":"Wegbeschreibung","id":61278120,"uuid":"81113479-f912-4c0e-8fe4-a01f001f79a3","slug":"wegbeschreibung","url":"wegbeschreibung","full_slug":"de/wegbeschreibung"},{"name":"Lage","id":61278119,"uuid":"6f022664-c46f-4028-9b72-69b9f79ea743","slug":"lage","url":"lage","full_slug":"de/lage"},{"name":"Presse","id":61278129,"uuid":"1ebc3547-1c0e-4024-97a1-c3be1213bdcf","slug":"presse","url":"presse","full_slug":"de/presse"},{"name":"Pferde","id":61278122,"uuid":"51786372-4be8-4e16-8df4-e323c5b5edea","slug":"pferde","url":"pferde","full_slug":"de/pferde"},{"name":"Links","id":61278130,"uuid":"530df307-9ec0-4a0a-80c6-fc481a7e4773","slug":"links","url":"links","full_slug":"de/links"},{"name":"Über uns","id":61278127,"uuid":"e493e9be-2066-4ee6-9820-2acc953284b6","slug":"ueber-uns","url":"ueber-uns","full_slug":"de/ueber-uns"},{"name":"Sport","id":61278124,"uuid":"524800d0-d913-494c-b9e6-08f55823db1b","slug":"sport","url":"sport","full_slug":"de/sport"},{"name":"Pool","id":61278121,"uuid":"bf4289b3-0b90-4561-9fa2-99a5ee317752","slug":"pool","url":"pool","full_slug":"de/pool"},{"name":"Appartments","id":61278116,"uuid":"734d0dca-94c1-4e93-bf73-5bf1276aee63","slug":"appartments","url":"appartments","full_slug":"de/appartments"},{"name":"Plan B - Corona","id":61278131,"uuid":"8953ae9c-2a98-4b87-b353-07343f3e8b18","slug":"plan-b-corona","url":"plan-b-corona","full_slug":"de/plan-b-corona"},{"name":"News","id":61278115,"uuid":"e510ec6a-ad92-4035-a320-edf7ceecdab2","slug":"news","url":"news","full_slug":"de/news"},{"name":"Zuhause","id":61278109,"uuid":"12969258-e475-4875-b0f1-2054a4650f58","slug":"home","url":"/","full_slug":"de/home"}]}

Hello @awacode,

as I see you’re using the V2 API in your project. The behavior of the API V2 is different compared to the V1 as the link/story objects aren’t being inserted directly in occurrences of the links in the content. Now, these objects are being delivered in the links array like in the example response that you posted:

When the JS client is being used these objects that you see in your payload will be inserted like in the responses from the V1 API. The related code for this can be found here: storyblok-js-client/index.js at master · storyblok/storyblok-js-client · GitHub

Here are the Link objects in comparison:
from V2 (links array)

{
    "name": "New_Story",
    "id": 51459116,
    "uuid": "9cf15d9d-1342-48b9-998c-3e00350fc26d",
    "slug": "new_story",
    "url": "new_story",
    "full_slug": "new_story"
}

from V1 (directly inserted in the content)

{
    "name": "New_Story",
    "id": 51459116,
    "uuid": "9cf15d9d-1342-48b9-998c-3e00350fc26d",
    "slug": "new_story",
    "full_slug": "new_story",
    "url": "new_story"
}

Best regards
Hannes