简体   繁体   English

ERC721 元数据 JSON 模式中的类型(如“对象”)是什么

[英]What is type (like "object") in ERC721 Metadata JSON schema

According to the standard , there's a type such as "object" shown below.根据标准,有如下所示的“对象”之类的type What is this type for and what other types can we use?这种type有什么用途,我们还可以使用哪些其他类型? Can I use like "art?"我可以像“艺术”一样使用吗?

{
    "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."
        }
    }
}

It's the datatype of the described item according to the JSON Schema specification.它是根据JSON Schema规范描述的项目的数据类型。 It's a standard used in other development fields as well - not limited just to NFTs or blockchain development.它也是用于其他开发领域的标准——不仅限于 NFT 或区块链开发。

There is a list of default allowed type values: http://json-schema.org/understanding-json-schema/reference/type.html有一个默认允许的type值列表: http://json-schema.org/understanding-json-schema/reference/type.html

It's possible to create a custom type in JSON Schema, but the limited scope of what the "ERC-721 Metadata Document" document allows, doesn't effectively allow for custom types.可以在 JSON Schema 中创建自定义类型,但是“ERC-721 元数据文档”文档允许的有限 scope 不能有效地允许自定义类型。

TLDR: Cannot use type: "art" in an "ERC-721 Metadata Document". TLDR:不能在“ERC-721 元数据文档”中使用type: "art" ”。 Can use it in a larger scope (eg a REST endpoint definition).可以在更大的 scope 中使用它(例如 REST 端点定义)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM