Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The AssetStoryblok type is missing properties #113

Closed
ryami333 opened this issue Sep 3, 2024 · 1 comment · Fixed by #122
Closed

The AssetStoryblok type is missing properties #113

ryami333 opened this issue Sep 3, 2024 · 1 comment · Fixed by #122
Assignees
Labels
bug Something isn't working p3-significant [Priority] Moderate issues, major enhancements

Comments

@ryami333
Copy link

ryami333 commented Sep 3, 2024

{
  "id": 16807114,
  "alt": "",
  "name": "",
  "focus": "",
  "title": "",
  "source": "",
  "filename": "https://a.storyblok.com/f/foo/bar.jpg",
  "copyright": "",
  "fieldtype": "asset",
  "meta_data": {},
  "is_private": false,
  "is_external_url": false
}

This is an example of a real JSON payload that was returned by the Storyblok API for an "asset" field. As you can see, it does not overlap entirely with the AssetStoryblok type generated by generate-sb-types:

export interface AssetStoryblok {
  alt?: string;
  copyright?: string;
  id: number;
  filename: string;
  name: string;
  title?: string;
  focus?: string;
}

As you can see, the payload contains the following additional fields: is_external_url, is_private, source, fieldtype and meta_data.

@ryami333 ryami333 added the bug Something isn't working label Sep 3, 2024
@alvarosabu alvarosabu added the p3-significant [Priority] Moderate issues, major enhancements label Oct 1, 2024
@alvarosabu alvarosabu self-assigned this Oct 1, 2024
@Edo-San Edo-San linked a pull request Oct 2, 2024 that will close this issue
5 tasks
@Edo-San
Copy link
Contributor

Edo-San commented Oct 2, 2024

Hi @ryami333 thanks for reporting this inconsistency, much appreciated!
I have filed a PR #122 to fix some of the types for blok fields, including the Asset and Multiasset fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p3-significant [Priority] Moderate issues, major enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants