Skip to content

Use System.Text.Json to serialize and deserialize JSON text #2

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GerardSmit
Copy link

This pull request replaces Newtonsoft.Json with System.Text.Json.

Do not merge this pull request yet. I don't have an Imghoard environment setup to test the changes I made. If I have a Imghoard environment and tested the changed I made I'll remove the draft status.

@exsersewo
Copy link
Contributor

exsersewo commented Oct 2, 2019

Looking through this, what made you remove Miki.Net.Http & Miki.Utils.Imaging.Headers?

As the former was planning to be used for rate limiting the client, and the latter is used to validate the image based on the only 4 available types that can be uploaded to Imghoard.

Edit: ignore The question Miki.Utils.Headers, the curse of a post wake up review made me over look it in formatters.

@GerardSmit
Copy link
Author

Looking through this, what made you remove Miki.Net.Http

The fact that it currently has a performance issue that I couldn't fix because I don't have access to it.

Whenever you call GetStreamAsync (which I wanted to use for deserializing the JSON) it calls SendAsync, which does the following:

httpResponse.Body = await response.Content.ReadAsStringAsync();

In other words, it calls both ReadAsStringAsync and ReadStreamAsync, which is unnecessary.

the curse of a post wake up review made me over look it in formatters.

Happens to the best of us 😄.

@velddev
Copy link
Member

velddev commented Nov 2, 2019

created an issue in https://github.com/Mikibot/MikiStd/issues/4 to solve Miki.Net.Http routes

@exsersewo
Copy link
Contributor

Hey @GerardSmit is this still a WIP?

@GerardSmit
Copy link
Author

It is. I'll revert System.Net to Miki.Net.Http when https://github.com/Mikibot/MikiStd/pull/3 is merged.

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.

3 participants