'ERC721 NFT not showing in opensea (related to the metadata)

I was creating the DApp and succeeded to mint NFT in Rinkeby using IPFS (pinata) & Nethereum (C#).

Now, I can get TokenURI using tokenURI function in ERC721URIStorage.sol, like ipfs://QmRH9pTTADs3BCqMLqXEAMP83FoaeMD8CUkNgtxZ5HKTLq.

Below is link of the metadata about same NFT. (https://ipfs.io/ipfs/QmRH9pTTADs3BCqMLqXEAMP83FoaeMD8CUkNgtxZ5HKTLq)

But, in opensea testnet, I can't see the information about my NFT. (I can see my NFT, but there is no image, name, description, and so on..)

To solve this problem, I checked if my contract is valid or not in https://testnets-api.opensea.io/asset/0x1770A249C9743F1493C55fE505BC17beAB772cD5/4/validate/. There is some error : "AttributeError: 'str' object has no attribute 'get'", but I don't know what it is..

Even though I can get TokenURI, why doesn't opensea? In this docs (https://docs.opensea.io/docs/metadata-standards), they say if I want to use IPFS to host my metadata, URL should be in the format ipfs:// (like ipfs://QmRH9pTTADs3BCqMLqXEAMP83FoaeMD8CUkNgtxZ5HKTLq.) I followed that, but it doesn't work.



Solution 1:[1]

Oh, I find that my json in ipfs is not a json, because it is surrounded with "".

It means that opensea will fail to get something from my metadata because it is string.

I used another sample metadata (https://ipfs.io/ipfs/bafybeibnsoufr2renqzsh347nrx54wcubt5lgkeivez63xvivplfwhtpym/metadata.json) which is not mine, and it worked very well!

Therefore, I have to fix the code for uploading metadata to ipfs.

I have not solved the problem completely, but I find the cause, so I will quit this question. After I solve this problem, I will post again.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1