Terry Windwalker
Terry Windwalker

Reputation: 1888

NFT Metadata: Have more than one line of description

is it possible to have more than one line of words as the description of the metadata json of an NFT? I have browsed several examples on the Internet and all of them are using just one line, like this one from NFTSchool:

{
    "title": "Asset Metadata",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "Identifies the asset to which this NFT represents"
        },
        "description": {
            "type": "string",
            "description": "Describes the asset to which this NFT represents"
        },
        "image": {
            "type": "string",
            "description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
        }
    }
}

This example's description:

Describes the asset to which this NFT represents

Is it possible to have something like this that can change lines on marketplaces like Opensea and Rarible? (The following example is supposed to have three lines of description)

{
    "title": "Asset Metadata",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "Identifies the asset to which this NFT represents"
        },
        "description": {
            "type": "string",
            "description": "Describes the asset to which this NFT represents\nDescribes the asset to which this NFT represents\nDescribes the asset to which this NFT represents"
        },
        "image": {
            "type": "string",
            "description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
        }
    }
}

This example's desired description:

Describes the asset to which this NFT represents
Describes the asset to which this NFT represents
Describes the asset to which this NFT represents

Upvotes: 0

Views: 900

Answers (1)

Terry Windwalker
Terry Windwalker

Reputation: 1888

\n works for letting those descriptions change line on Opensea. Haven't tested on other platforms yet but it should work everywhere.

Example:

{
    description: "Line one  \nLine two  \nLine three"
}

What it will show:

Line one
Line two
Line three

It will automatically ignore the extra spaces before and after \n.

Related answer: https://stackoverflow.com/a/60083782/11421839

Upvotes: 1

Related Questions