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

Fix Bool handling bug in json printer #34

Merged
merged 1 commit into from
Aug 24, 2021
Merged

Conversation

abdula571
Copy link

printed true and false when number equal 1 and 0 respectively

@kean
Copy link
Owner

kean commented Aug 24, 2021

Oh wow I'm surprised it converts 0 and 1 to Bool. The fix works, thanks!

@kean kean merged commit 01b8290 into kean:master Aug 24, 2021
@kean kean changed the title fix bag in json printer Fix Bool handling bug in json printer Aug 24, 2021
@abdula571
Copy link
Author

@kean, I don't know where to write. I'll write here. Can you update the documentation? Section "Alamofire integration".

update this method

func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
        logger.logDataTask(dataTask, didReceive: data)
 }

to

func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
        
        if let response = dataTask.response {
            logger.logDataTask(dataTask, didReceive: response)
        }
        
        logger.logDataTask(dataTask, didReceive: data)
 }

@kean
Copy link
Owner

kean commented Aug 25, 2021

Thanks, I will. I'll try make the documentation open-source too soon.

@kean
Copy link
Owner

kean commented Sep 11, 2021

I've had no free time to work on this project, but now I do. I'm making the if let response = dataTask.response call unnecessary in the upcoming release. The framework will do it automatically rather than asking the user to do it.

@kean
Copy link
Owner

kean commented Sep 11, 2021

I rewrote the documentation, I hope it's more clear now: https://kean.blog/pulse/guides/networking. I'm also not recommending to use manual logging instead of URLSessionProxyDelegate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants