Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: The class 'ServerRoute' is not key value coding-compliant for the key 'arch' #76

Closed
cpg opened this issue Apr 6, 2018 · 4 comments · Fixed by #79
Closed

WARNING: The class 'ServerRoute' is not key value coding-compliant for the key 'arch' #76

cpg opened this issue Apr 6, 2018 · 4 comments · Fixed by #79
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@cpg
Copy link
Member

cpg commented Apr 6, 2018

Run-time warning:

WARNING: The class 'ServerRoute' is not key value coding-compliant for the key 'arch'
 There is no support for optional type, array of optionals or enum properties.
As a workaround you can implement the function 'setValue forUndefinedKey' for this. See the unit tests for more information
@cpg cpg added bug Something isn't working good first issue Good for newcomers labels Apr 6, 2018
@codedentwickler
Copy link
Member

codedentwickler commented Apr 8, 2018

@cpg I looked into this issue, the warning is coming from EVReflection, It tries to convert every property in the JSON object to s swift type. If some property isn't defined in the swift class that exist in JSON then EVReflection prints this warning.

Ways to fix

  1. Ensure all properties in the JSON object are mapped correctly to a swift type, i.e no JSON property should be ignored.

  2. We can add a dictionary of all the keys to be ignored in the JSON response. This means EVReflection won't warn us anymore.

Which of the options do you find more appropriate. I prefer option 1. @cpg

@csoni111
Copy link
Member

csoni111 commented Apr 8, 2018

I would prefer the 2nd option. ie. we should ignore the keys which are not required. Why waste memory in storing values for not required keys!

@codedentwickler
Copy link
Member

Thanks, @csoni111. Unnecessary memory usage is a good reason, you convinced me. I will proceed once @cpg sign off on this. Earlier I thought we might need those values later on but then we can always remove them from the ignored list if we need them.

@codedentwickler
Copy link
Member

This bug has been fixed in #79

@cpg cpg closed this as completed in #79 Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
3 participants