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

Initial Support for Simple Map decoding with unnamed toml keys #246

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

orchestr7
Copy link
Owner

@orchestr7 orchestr7 commented Dec 3, 2023

What's done:

  • Phaze 1: only primitive tables (without nested multiple tables) with no explicit type checking.
  • The idea is to decode unnamed arguments.
    For example:
[map]
a = 1
b = 2 

or

map = {a=1, b=2}

Should be decoded (without knowing and naming explicitly toml keys) to:

data class Test {
    val map: Map<String, Int>
}

Guys like @jakubgwozdz @y9san9 requested it and it looks like it can be useful for parsing gradle configs.

### What's done:
- Tests
- MapDecoder
@orchestr7 orchestr7 linked an issue Dec 3, 2023 that may be closed by this pull request
@orchestr7 orchestr7 marked this pull request as draft December 3, 2023 15:30
@orchestr7 orchestr7 marked this pull request as draft December 3, 2023 15:30
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

ktlint found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

### What's done:
- Tests
- MapDecoder
### What's done:
- Tests
- MapDecoder
@orchestr7 orchestr7 changed the title Initial test support for Map decoding Initial for Simple Map decoding Dec 12, 2023
@orchestr7 orchestr7 changed the title Initial for Simple Map decoding Initial Support for Simple Map decoding Dec 12, 2023
@orchestr7 orchestr7 marked this pull request as ready for review December 12, 2023 21:09
@orchestr7
Copy link
Owner Author

@y9san9 implemented as we have discussed with you 😄

@orchestr7 orchestr7 requested a review from NightEule5 December 12, 2023 21:14
@orchestr7 orchestr7 changed the title Initial Support for Simple Map decoding Initial Support for Simple Map decoding with unnamed toml keys Dec 12, 2023
@orchestr7 orchestr7 merged commit 57f933b into main Dec 12, 2023
6 checks passed
@orchestr7 orchestr7 deleted the feature/map-support branch December 12, 2023 22:02
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.

Exception when decoding map
1 participant