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

Replacing Klaxon in favor of Moshi in lookup() function #44

Merged
merged 5 commits into from
Nov 6, 2022
Merged

Replacing Klaxon in favor of Moshi in lookup() function #44

merged 5 commits into from
Nov 6, 2022

Conversation

ivanempire
Copy link
Contributor

@ivanempire ivanempire commented Nov 6, 2022

Description

This is a fairly quick and dirty for the lookup() function. It can now parse the nested list of objects coming from ODict using Moshi. I'll probably see how to get it to work with Klaxon too.

Update

Removing Klaxon completely in favor of Moshi since the former cannot handle nested lists in the form of List<List<Entry>>.

jvm/local.properties Outdated Show resolved Hide resolved
jvm/build.gradle Outdated Show resolved Hide resolved
}

companion object {
private val moshi = Moshi.Builder().addLast(KotlinJsonAdapterFactory()).build()

private val innerLookupType = Types.newParameterizedType(MutableList::class.java, Entry::class.java)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bruh that crazy fr fr no cap


private val innerLookupType = Types.newParameterizedType(MutableList::class.java, Entry::class.java)
private val outerLookupType = Types.newParameterizedType(MutableList::class.java, innerLookupType)
private val lookupAdapter: JsonAdapter<List<List<Entry>>> = moshi.adapter(outerLookupType)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ong

@Nickersoft Nickersoft merged commit d960814 into TheOpenDictionary:main Nov 6, 2022
@github-actions github-actions bot mentioned this pull request Nov 6, 2022
@ivanempire ivanempire deleted the dev/im/JSON branch November 6, 2022 05:50
This was referenced Nov 6, 2022
@github-actions github-actions bot mentioned this pull request Jan 4, 2023
This was referenced Feb 1, 2023
@github-actions github-actions bot mentioned this pull request Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants