Skip to content

Commit

Permalink
feat: update the shape of Asset field type
Browse files Browse the repository at this point in the history
  • Loading branch information
Edo-San committed Sep 26, 2024
1 parent ad5a50b commit 89398cd
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions src/utils/typescript/storyblokProvidedPropertyTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,65 @@ export const getAssetJSONSchema = (title: string): JSONSchema => ({
$id: "#/asset",
title,
type: "object",
required: ["id", "filename", "name"],
required: ["id", "fieldtype", "filename", "name", "title", "focus", "alt"],
properties: {
alt: {
type: "string",
type: ["string", "null"],
},
copyright: {
type: ["string", "null"],
},
fieldtype: {
type: "string",
enum: ["asset"],
},
id: {
type: "number",
},
filename: {
type: "string",

This comment has been minimized.

Copy link
@mllustosa

mllustosa Oct 8, 2024

Just a little clarification if possible, why is it that the filename is optional now?

type: ["string", "null"],
},
name: {
type: "string",
},
title: {
type: "string",
type: ["string", "null"],
},
focus: {
type: ["string", "null"],
},
meta_data: {
type: "object",
},
source: {
type: ["string", "null"],
},
is_external_url: {
type: "boolean",
},
is_private: {
type: "boolean",
},
src: {
type: "string",
},
updated_at: {
type: "string",
},
// Cloudinary integration keys
width: {
type: ["number", "null"],
},
height: {
type: ["number", "null"],
},
aspect_ratio: {
type: ["number", "null"],
},
public_id: {
type: ["string", "null"],
},
content_type: {
type: "string",
},
},
Expand Down

0 comments on commit 89398cd

Please sign in to comment.