PokemonAPI icon indicating copy to clipboard operation
PokemonAPI copied to clipboard

PKMItemHolderPokemonVersionDetail decoding error

Open QuaRang1225 opened this issue 1 year ago • 0 comments

Of the data in the class PKMitemHolderPokemonVersionDetail, the "rarity" data actually gives a value of Int form, but the "jsonParsingError" error appears when trying to decode it as string within the package.

I would appreciate it if you could solve this problem.

held_Items

"version_details": [
      {
          "rarity": 5,    //this data
          "version": {
              "name": "ruby",
              "url": "https://pokeapi.co/api/v2/version/7/"
          }
      }
]
open class PKMItemHolderPokemonVersionDetail: Codable {
    
    open var rarity: String?    //data is not correct
    
    open var version: PKMNamedAPIResource<PKMVersion>?
}

QuaRang1225 avatar Aug 23 '23 06:08 QuaRang1225