hedera-mirror-node icon indicating copy to clipboard operation
hedera-mirror-node copied to clipboard

NFT allowance rest API enhancement and validations

Open mgoelswirlds opened this issue 1 year ago • 1 comments

Problem

  • Currently the NFT allowance API returns approve_for_all=true and false values.
  • Need to add Query Parameter validation as per openapi spec.

Solution

  • Modify the NFT allowance API to return values only for approve_for_all=true Example : GET /api/v1/accounts/0.0.8488/allowances/nfts?limit=3&owner=false
{
  "allowances": [
    {
      "owner": "0.0.1000",
      "spender": "0.0.8488",
      "token_id": "0.0.1033",
      "timestamp": {
        "from": "1633466229.96874612",
        "to": null
      }
    },
    {
      "owner": "0.0.1000",
      "spender": "0.0.8488",
      "token_id": "0.0.1034",
      "timestamp": {
        "from": "1633466229.96874618",
        "to": null
      }
    }
  ],
  "links": {
	   "next": "/api/v1/accounts/0.0.8488/allowances/nfts?limit=3&order=asc&account.id=gte:1000&token.id=gt:0.0.1034"
	}
}
  • Add validation for checking multiple existence of query params not supported.

Alternatives

No response

mgoelswirlds avatar Apr 25 '24 17:04 mgoelswirlds

Creating a separate ticket for - Next link generation correction.

mgoelswirlds avatar Apr 26 '24 15:04 mgoelswirlds