V6 doesn't recognize _embedded resources
See original GitHub issueIn version 5.2 _embedded
resources won’t trigger a request per entry, but version 6 won’t recognize that the request contains _embedded
resources and will instead make a GET
request for each resources embedded.
Example:
const articles = await ketting.follow('articles').followAll('articles')
for (const resource of articles) {
const state = await resource.get();
console.log(state)
}
The above code follows the root document link articles
and then follows all embedded articles and logs them.
In version 5.2 it will simply log the _embedded
resources from the initial request. But in version 6, the exact same code will trigger a GET
request per entry.
A workaround The following example is a possible workaround. But I’m not sure this is how it’s intended to be used.
const articles = await ketting.follow('articles')
const fetchedArticles = await articles.get()
for (const resource of fetchedArticles.embedded) {
console.log(state)
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:12
Top Results From Across the Web
Embedded resource won't work for some filenames?
If I have an embedded resource file called “light.sms.txt”, then it is not embedded, but if I change it to “light.sms1.txt”, then it...
Read more >Cannot find embedded resource in referenced assembly
Two things to check: Make sure the Build Action property on the icon is set to Embedded Resource. Are you using the fully...
Read more >Embedded Resources - Articles Tutorials | AspNet Boilerplate
First, we create a file and mark it as an embedded resource. Any assembly can contain embedded resource files. The process changes based...
Read more >Tables and Views — PostgREST 9.0.0 documentation
PostgREST cannot detect a view as an embedded resource by using a column name or foreign key name as targets, that is why...
Read more >MSP-FET: Device not recognized by V6.51 (or older) IAR ...
I have been able to work with IAR-Workbench V6.51 and older debugging ... for the IAR Embedded Workbench (EW) shared components and not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@madsmadsen identified the core issue, I’m very grateful. The reason I hadn’t seen this is (sadly) because we were running a version of ketting 6 slightly older than current, and it’s a relatively new change.
PR and release will follow in the next 30 minutes.
Thank you @madsmadsen and everyone sending their debug information. Apologies for not spotting the error earlier.
That is very strange… definitely a bug! nice catch. Would be ok sharing a sample HAL document? I’d like to make sure this is not some kind of edge case I missed, as I’ve not seen this problem myself.