Get Method JSON Response(String) Coding Complaint for key





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















My ResponseString is as follows,



SUCCESS: 
{"code":200,"shop_detail":{"name":"dad","address":"556666"},
"shop_types : [{"name":"IT/SOFTWARE","merchant_type":"office"}]}


My Get request code with headers is as follows,



func getProfileAPI() {
let headers: HTTPHeaders = [
"Authorisation": AuthService.instance.tokenId ?? "",
"Content-Type": "application/json",
"Accept": "application/json"
]
print(headers)
let scriptUrl = "http://haitch.igenuz.com/api/merchant/profile"

if let url = URL(string: scriptUrl) {
var urlRequest = URLRequest(url: url)
urlRequest.httpMethod = HTTPMethod.get.rawValue

urlRequest.addValue(AuthService.instance.tokenId ?? "", forHTTPHeaderField: "Authorization")
urlRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
urlRequest.addValue("application/json", forHTTPHeaderField: "Accept")

Alamofire.request(urlRequest)
.responseString { response in
debugPrint(response)
print(response)
if let result = response.result.value // getting the json value from the server
{
print(result)

let jsonData1 = result as NSString
print(jsonData1)
let name = jsonData1.object(forKey: "code") as! [AnyHashable: Any]
print(name)
// var data = jsonData1!["shop_detail"]?["name"] as? String

} }
}


When I tried to get the value for "name" its getting'[<__NSCFString 0x7b40f400> valueForUndefinedKey:]: this class is not key value coding-compliant for the key code. Please guide me to get the values of name, address..?????










share|improve this question





























    2















    My ResponseString is as follows,



    SUCCESS: 
    {"code":200,"shop_detail":{"name":"dad","address":"556666"},
    "shop_types : [{"name":"IT/SOFTWARE","merchant_type":"office"}]}


    My Get request code with headers is as follows,



    func getProfileAPI() {
    let headers: HTTPHeaders = [
    "Authorisation": AuthService.instance.tokenId ?? "",
    "Content-Type": "application/json",
    "Accept": "application/json"
    ]
    print(headers)
    let scriptUrl = "http://haitch.igenuz.com/api/merchant/profile"

    if let url = URL(string: scriptUrl) {
    var urlRequest = URLRequest(url: url)
    urlRequest.httpMethod = HTTPMethod.get.rawValue

    urlRequest.addValue(AuthService.instance.tokenId ?? "", forHTTPHeaderField: "Authorization")
    urlRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
    urlRequest.addValue("application/json", forHTTPHeaderField: "Accept")

    Alamofire.request(urlRequest)
    .responseString { response in
    debugPrint(response)
    print(response)
    if let result = response.result.value // getting the json value from the server
    {
    print(result)

    let jsonData1 = result as NSString
    print(jsonData1)
    let name = jsonData1.object(forKey: "code") as! [AnyHashable: Any]
    print(name)
    // var data = jsonData1!["shop_detail"]?["name"] as? String

    } }
    }


    When I tried to get the value for "name" its getting'[<__NSCFString 0x7b40f400> valueForUndefinedKey:]: this class is not key value coding-compliant for the key code. Please guide me to get the values of name, address..?????










    share|improve this question

























      2












      2








      2








      My ResponseString is as follows,



      SUCCESS: 
      {"code":200,"shop_detail":{"name":"dad","address":"556666"},
      "shop_types : [{"name":"IT/SOFTWARE","merchant_type":"office"}]}


      My Get request code with headers is as follows,



      func getProfileAPI() {
      let headers: HTTPHeaders = [
      "Authorisation": AuthService.instance.tokenId ?? "",
      "Content-Type": "application/json",
      "Accept": "application/json"
      ]
      print(headers)
      let scriptUrl = "http://haitch.igenuz.com/api/merchant/profile"

      if let url = URL(string: scriptUrl) {
      var urlRequest = URLRequest(url: url)
      urlRequest.httpMethod = HTTPMethod.get.rawValue

      urlRequest.addValue(AuthService.instance.tokenId ?? "", forHTTPHeaderField: "Authorization")
      urlRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
      urlRequest.addValue("application/json", forHTTPHeaderField: "Accept")

      Alamofire.request(urlRequest)
      .responseString { response in
      debugPrint(response)
      print(response)
      if let result = response.result.value // getting the json value from the server
      {
      print(result)

      let jsonData1 = result as NSString
      print(jsonData1)
      let name = jsonData1.object(forKey: "code") as! [AnyHashable: Any]
      print(name)
      // var data = jsonData1!["shop_detail"]?["name"] as? String

      } }
      }


      When I tried to get the value for "name" its getting'[<__NSCFString 0x7b40f400> valueForUndefinedKey:]: this class is not key value coding-compliant for the key code. Please guide me to get the values of name, address..?????










      share|improve this question














      My ResponseString is as follows,



      SUCCESS: 
      {"code":200,"shop_detail":{"name":"dad","address":"556666"},
      "shop_types : [{"name":"IT/SOFTWARE","merchant_type":"office"}]}


      My Get request code with headers is as follows,



      func getProfileAPI() {
      let headers: HTTPHeaders = [
      "Authorisation": AuthService.instance.tokenId ?? "",
      "Content-Type": "application/json",
      "Accept": "application/json"
      ]
      print(headers)
      let scriptUrl = "http://haitch.igenuz.com/api/merchant/profile"

      if let url = URL(string: scriptUrl) {
      var urlRequest = URLRequest(url: url)
      urlRequest.httpMethod = HTTPMethod.get.rawValue

      urlRequest.addValue(AuthService.instance.tokenId ?? "", forHTTPHeaderField: "Authorization")
      urlRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
      urlRequest.addValue("application/json", forHTTPHeaderField: "Accept")

      Alamofire.request(urlRequest)
      .responseString { response in
      debugPrint(response)
      print(response)
      if let result = response.result.value // getting the json value from the server
      {
      print(result)

      let jsonData1 = result as NSString
      print(jsonData1)
      let name = jsonData1.object(forKey: "code") as! [AnyHashable: Any]
      print(name)
      // var data = jsonData1!["shop_detail"]?["name"] as? String

      } }
      }


      When I tried to get the value for "name" its getting'[<__NSCFString 0x7b40f400> valueForUndefinedKey:]: this class is not key value coding-compliant for the key code. Please guide me to get the values of name, address..?????







      ios json string xcode swift4






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 14:44









      AleeshaAleesha

      459




      459
























          2 Answers
          2






          active

          oldest

          votes


















          3














          You can use the Response Handler instead of Response String Handler:




          Response Handler



          The response handler does NOT evaluate any of the response data. It
          merely forwards on all information directly from the URL session
          delegate. It is the Alamofire equivalent of using cURL to execute a Request.




          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Also you can omit the coding keys from your struct declaration if you set your decoder keyDecodingStrategy (check this) to .convertFromSnakeCase as already mentioned in comments by @vadian:





          Alamofire.request(urlRequest).response { response in
          guard
          let data = response.data,
          let json = String(data: data, encoding: .utf8)
          else { return }
          print("json:", json)
          do {
          let decoder = JSONDecoder()
          decoder.keyDecodingStrategy = .convertFromSnakeCase
          let root = try decoder.decode(Root.self, from: data)
          print(root.shopDetail.name)
          print(root.shopDetail.address)
          for shop in root.shopTypes {
          print(shop.name)
          print(shop.merchantType)
          }
          } catch {
          print(error)
          }
          }


          For more information about encoding and decoding custom types you can read this post.






          share|improve this answer


























          • its getting json printed, now please help me in getting the values of shop detail printed for name/address and shoptype for name/merchant_type

            – Aleesha
            Nov 25 '18 at 1:34











          • @Aleesha check my last edit.

            – Leo Dabus
            Nov 25 '18 at 1:49






          • 1





            Superb, it worked well, thank you very much for excellent coding @ Leo Dabus. This helped me to learn new things.

            – Aleesha
            Nov 25 '18 at 2:11



















          0














          You can try to convert the json string to data then decode it



          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Then



          let jsonStr = result as! String
          let dec = JSONDecoder()
          dec.keyDecodingStrategy = .convertFromSnakeCase
          let res = try? dec.decode(Root.self,from:jsonStr.data(using:.utf8)!)


          Note your str json may be invalid as you miss " after shop_types so make sure it looks like this




          {"code":200,"shop_detail":{"name":"dad","address":"556666"},
          "shop_types" : [{"name":"IT/SOFTWARE","merchant_type":"office"}]}







          share|improve this answer





















          • 1





            Thank you very much @ Sh_Khan. It gives the concept..

            – Aleesha
            Nov 24 '18 at 16:52






          • 1





            Are you aware that you can omit all CodingKeys if you use the .convertFromSnakeCase key decoding strategy?

            – vadian
            Nov 24 '18 at 18:46











          • @vadian i agree , the reason is i no longer write the json myself as i have no time

            – Sh_Khan
            Nov 24 '18 at 20:11














          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53459301%2fget-method-json-responsestring-coding-complaint-for-key%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          You can use the Response Handler instead of Response String Handler:




          Response Handler



          The response handler does NOT evaluate any of the response data. It
          merely forwards on all information directly from the URL session
          delegate. It is the Alamofire equivalent of using cURL to execute a Request.




          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Also you can omit the coding keys from your struct declaration if you set your decoder keyDecodingStrategy (check this) to .convertFromSnakeCase as already mentioned in comments by @vadian:





          Alamofire.request(urlRequest).response { response in
          guard
          let data = response.data,
          let json = String(data: data, encoding: .utf8)
          else { return }
          print("json:", json)
          do {
          let decoder = JSONDecoder()
          decoder.keyDecodingStrategy = .convertFromSnakeCase
          let root = try decoder.decode(Root.self, from: data)
          print(root.shopDetail.name)
          print(root.shopDetail.address)
          for shop in root.shopTypes {
          print(shop.name)
          print(shop.merchantType)
          }
          } catch {
          print(error)
          }
          }


          For more information about encoding and decoding custom types you can read this post.






          share|improve this answer


























          • its getting json printed, now please help me in getting the values of shop detail printed for name/address and shoptype for name/merchant_type

            – Aleesha
            Nov 25 '18 at 1:34











          • @Aleesha check my last edit.

            – Leo Dabus
            Nov 25 '18 at 1:49






          • 1





            Superb, it worked well, thank you very much for excellent coding @ Leo Dabus. This helped me to learn new things.

            – Aleesha
            Nov 25 '18 at 2:11
















          3














          You can use the Response Handler instead of Response String Handler:




          Response Handler



          The response handler does NOT evaluate any of the response data. It
          merely forwards on all information directly from the URL session
          delegate. It is the Alamofire equivalent of using cURL to execute a Request.




          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Also you can omit the coding keys from your struct declaration if you set your decoder keyDecodingStrategy (check this) to .convertFromSnakeCase as already mentioned in comments by @vadian:





          Alamofire.request(urlRequest).response { response in
          guard
          let data = response.data,
          let json = String(data: data, encoding: .utf8)
          else { return }
          print("json:", json)
          do {
          let decoder = JSONDecoder()
          decoder.keyDecodingStrategy = .convertFromSnakeCase
          let root = try decoder.decode(Root.self, from: data)
          print(root.shopDetail.name)
          print(root.shopDetail.address)
          for shop in root.shopTypes {
          print(shop.name)
          print(shop.merchantType)
          }
          } catch {
          print(error)
          }
          }


          For more information about encoding and decoding custom types you can read this post.






          share|improve this answer


























          • its getting json printed, now please help me in getting the values of shop detail printed for name/address and shoptype for name/merchant_type

            – Aleesha
            Nov 25 '18 at 1:34











          • @Aleesha check my last edit.

            – Leo Dabus
            Nov 25 '18 at 1:49






          • 1





            Superb, it worked well, thank you very much for excellent coding @ Leo Dabus. This helped me to learn new things.

            – Aleesha
            Nov 25 '18 at 2:11














          3












          3








          3







          You can use the Response Handler instead of Response String Handler:




          Response Handler



          The response handler does NOT evaluate any of the response data. It
          merely forwards on all information directly from the URL session
          delegate. It is the Alamofire equivalent of using cURL to execute a Request.




          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Also you can omit the coding keys from your struct declaration if you set your decoder keyDecodingStrategy (check this) to .convertFromSnakeCase as already mentioned in comments by @vadian:





          Alamofire.request(urlRequest).response { response in
          guard
          let data = response.data,
          let json = String(data: data, encoding: .utf8)
          else { return }
          print("json:", json)
          do {
          let decoder = JSONDecoder()
          decoder.keyDecodingStrategy = .convertFromSnakeCase
          let root = try decoder.decode(Root.self, from: data)
          print(root.shopDetail.name)
          print(root.shopDetail.address)
          for shop in root.shopTypes {
          print(shop.name)
          print(shop.merchantType)
          }
          } catch {
          print(error)
          }
          }


          For more information about encoding and decoding custom types you can read this post.






          share|improve this answer















          You can use the Response Handler instead of Response String Handler:




          Response Handler



          The response handler does NOT evaluate any of the response data. It
          merely forwards on all information directly from the URL session
          delegate. It is the Alamofire equivalent of using cURL to execute a Request.




          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Also you can omit the coding keys from your struct declaration if you set your decoder keyDecodingStrategy (check this) to .convertFromSnakeCase as already mentioned in comments by @vadian:





          Alamofire.request(urlRequest).response { response in
          guard
          let data = response.data,
          let json = String(data: data, encoding: .utf8)
          else { return }
          print("json:", json)
          do {
          let decoder = JSONDecoder()
          decoder.keyDecodingStrategy = .convertFromSnakeCase
          let root = try decoder.decode(Root.self, from: data)
          print(root.shopDetail.name)
          print(root.shopDetail.address)
          for shop in root.shopTypes {
          print(shop.name)
          print(shop.merchantType)
          }
          } catch {
          print(error)
          }
          }


          For more information about encoding and decoding custom types you can read this post.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 25 '18 at 1:54

























          answered Nov 24 '18 at 19:29









          Leo DabusLeo Dabus

          139k33287359




          139k33287359













          • its getting json printed, now please help me in getting the values of shop detail printed for name/address and shoptype for name/merchant_type

            – Aleesha
            Nov 25 '18 at 1:34











          • @Aleesha check my last edit.

            – Leo Dabus
            Nov 25 '18 at 1:49






          • 1





            Superb, it worked well, thank you very much for excellent coding @ Leo Dabus. This helped me to learn new things.

            – Aleesha
            Nov 25 '18 at 2:11



















          • its getting json printed, now please help me in getting the values of shop detail printed for name/address and shoptype for name/merchant_type

            – Aleesha
            Nov 25 '18 at 1:34











          • @Aleesha check my last edit.

            – Leo Dabus
            Nov 25 '18 at 1:49






          • 1





            Superb, it worked well, thank you very much for excellent coding @ Leo Dabus. This helped me to learn new things.

            – Aleesha
            Nov 25 '18 at 2:11

















          its getting json printed, now please help me in getting the values of shop detail printed for name/address and shoptype for name/merchant_type

          – Aleesha
          Nov 25 '18 at 1:34





          its getting json printed, now please help me in getting the values of shop detail printed for name/address and shoptype for name/merchant_type

          – Aleesha
          Nov 25 '18 at 1:34













          @Aleesha check my last edit.

          – Leo Dabus
          Nov 25 '18 at 1:49





          @Aleesha check my last edit.

          – Leo Dabus
          Nov 25 '18 at 1:49




          1




          1





          Superb, it worked well, thank you very much for excellent coding @ Leo Dabus. This helped me to learn new things.

          – Aleesha
          Nov 25 '18 at 2:11





          Superb, it worked well, thank you very much for excellent coding @ Leo Dabus. This helped me to learn new things.

          – Aleesha
          Nov 25 '18 at 2:11













          0














          You can try to convert the json string to data then decode it



          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Then



          let jsonStr = result as! String
          let dec = JSONDecoder()
          dec.keyDecodingStrategy = .convertFromSnakeCase
          let res = try? dec.decode(Root.self,from:jsonStr.data(using:.utf8)!)


          Note your str json may be invalid as you miss " after shop_types so make sure it looks like this




          {"code":200,"shop_detail":{"name":"dad","address":"556666"},
          "shop_types" : [{"name":"IT/SOFTWARE","merchant_type":"office"}]}







          share|improve this answer





















          • 1





            Thank you very much @ Sh_Khan. It gives the concept..

            – Aleesha
            Nov 24 '18 at 16:52






          • 1





            Are you aware that you can omit all CodingKeys if you use the .convertFromSnakeCase key decoding strategy?

            – vadian
            Nov 24 '18 at 18:46











          • @vadian i agree , the reason is i no longer write the json myself as i have no time

            – Sh_Khan
            Nov 24 '18 at 20:11


















          0














          You can try to convert the json string to data then decode it



          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Then



          let jsonStr = result as! String
          let dec = JSONDecoder()
          dec.keyDecodingStrategy = .convertFromSnakeCase
          let res = try? dec.decode(Root.self,from:jsonStr.data(using:.utf8)!)


          Note your str json may be invalid as you miss " after shop_types so make sure it looks like this




          {"code":200,"shop_detail":{"name":"dad","address":"556666"},
          "shop_types" : [{"name":"IT/SOFTWARE","merchant_type":"office"}]}







          share|improve this answer





















          • 1





            Thank you very much @ Sh_Khan. It gives the concept..

            – Aleesha
            Nov 24 '18 at 16:52






          • 1





            Are you aware that you can omit all CodingKeys if you use the .convertFromSnakeCase key decoding strategy?

            – vadian
            Nov 24 '18 at 18:46











          • @vadian i agree , the reason is i no longer write the json myself as i have no time

            – Sh_Khan
            Nov 24 '18 at 20:11
















          0












          0








          0







          You can try to convert the json string to data then decode it



          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Then



          let jsonStr = result as! String
          let dec = JSONDecoder()
          dec.keyDecodingStrategy = .convertFromSnakeCase
          let res = try? dec.decode(Root.self,from:jsonStr.data(using:.utf8)!)


          Note your str json may be invalid as you miss " after shop_types so make sure it looks like this




          {"code":200,"shop_detail":{"name":"dad","address":"556666"},
          "shop_types" : [{"name":"IT/SOFTWARE","merchant_type":"office"}]}







          share|improve this answer















          You can try to convert the json string to data then decode it



          struct Root: Codable {
          let code: Int
          let shopDetail: ShopDetail
          let shopTypes: [ShopType]
          }

          struct ShopDetail: Codable {
          let name, address: String
          }

          struct ShopType: Codable {
          let name, merchantType: String
          }


          Then



          let jsonStr = result as! String
          let dec = JSONDecoder()
          dec.keyDecodingStrategy = .convertFromSnakeCase
          let res = try? dec.decode(Root.self,from:jsonStr.data(using:.utf8)!)


          Note your str json may be invalid as you miss " after shop_types so make sure it looks like this




          {"code":200,"shop_detail":{"name":"dad","address":"556666"},
          "shop_types" : [{"name":"IT/SOFTWARE","merchant_type":"office"}]}








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 24 '18 at 20:12

























          answered Nov 24 '18 at 15:00









          Sh_KhanSh_Khan

          48.3k51434




          48.3k51434








          • 1





            Thank you very much @ Sh_Khan. It gives the concept..

            – Aleesha
            Nov 24 '18 at 16:52






          • 1





            Are you aware that you can omit all CodingKeys if you use the .convertFromSnakeCase key decoding strategy?

            – vadian
            Nov 24 '18 at 18:46











          • @vadian i agree , the reason is i no longer write the json myself as i have no time

            – Sh_Khan
            Nov 24 '18 at 20:11
















          • 1





            Thank you very much @ Sh_Khan. It gives the concept..

            – Aleesha
            Nov 24 '18 at 16:52






          • 1





            Are you aware that you can omit all CodingKeys if you use the .convertFromSnakeCase key decoding strategy?

            – vadian
            Nov 24 '18 at 18:46











          • @vadian i agree , the reason is i no longer write the json myself as i have no time

            – Sh_Khan
            Nov 24 '18 at 20:11










          1




          1





          Thank you very much @ Sh_Khan. It gives the concept..

          – Aleesha
          Nov 24 '18 at 16:52





          Thank you very much @ Sh_Khan. It gives the concept..

          – Aleesha
          Nov 24 '18 at 16:52




          1




          1





          Are you aware that you can omit all CodingKeys if you use the .convertFromSnakeCase key decoding strategy?

          – vadian
          Nov 24 '18 at 18:46





          Are you aware that you can omit all CodingKeys if you use the .convertFromSnakeCase key decoding strategy?

          – vadian
          Nov 24 '18 at 18:46













          @vadian i agree , the reason is i no longer write the json myself as i have no time

          – Sh_Khan
          Nov 24 '18 at 20:11







          @vadian i agree , the reason is i no longer write the json myself as i have no time

          – Sh_Khan
          Nov 24 '18 at 20:11




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53459301%2fget-method-json-responsestring-coding-complaint-for-key%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Academy of Television Arts & Sciences

          L'Équipe

          1995 France bombings