Skip to content

Conversation

tapankavasthi
Copy link
Contributor

@tapankavasthi tapankavasthi commented Mar 2, 2024

Summary

Demonstrate reading YAML content in Kotlin

Jira

KTLN-746

@tapankavasthi tapankavasthi changed the title noop Guide to Reading From a YAML File in Kotlin Mar 2, 2024
@tapankavasthi tapankavasthi force-pushed the dev/tavasthi-ktln-746 branch from 9104d16 to 75ebf65 Compare March 10, 2024 08:49
@tapankavasthi tapankavasthi force-pushed the dev/tavasthi-ktln-746 branch 4 times, most recently from 2ee9204 to d5df022 Compare March 29, 2024 05:28
@tapankavasthi tapankavasthi marked this pull request as draft March 29, 2024 06:28
@tapankavasthi tapankavasthi force-pushed the dev/tavasthi-ktln-746 branch 2 times, most recently from 919bc46 to 7e9dfdd Compare March 30, 2024 11:46
@tapankavasthi tapankavasthi changed the title Guide to Reading From a YAML File in Kotlin KTLN-746: Guide to Reading From a YAML File in Kotlin Mar 30, 2024
@tapankavasthi tapankavasthi marked this pull request as ready for review March 30, 2024 11:47
@tapankavasthi tapankavasthi force-pushed the dev/tavasthi-ktln-746 branch 2 times, most recently from 3166e69 to 79bafd9 Compare March 31, 2024 03:07
Copy link
Contributor

@theangrydev theangrydev left a comment

Choose a reason for hiding this comment

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

Nice! Just a few minor points

Comment on lines 22 to 24



Copy link
Contributor

Choose a reason for hiding this comment

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

Delete extra newlines, just keep one blank one inbetween

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 75 to 76


Copy link
Contributor

Choose a reason for hiding this comment

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

Delete newlines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


class YamlktUnitTest {

private val yamlDefault = Yaml.Default
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use a fully qualified import to make it clear which library we are importing from

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


class KamlUnitTest {

private val yamlDefault = Yaml.default
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use a fully qualified import to make it clear which library we are importing from

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@Test
fun `Return float when parsing scalar float number in a yaml string using decodeFromString`() {
val scalarFloatYamlStr = "12.3"
val yaml = Yaml.default
Copy link
Contributor

Choose a reason for hiding this comment

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

Use existing field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@tapankavasthi tapankavasthi force-pushed the dev/tavasthi-ktln-746 branch 2 times, most recently from e32bf56 to 32b8746 Compare March 31, 2024 15:32
@tapankavasthi tapankavasthi force-pushed the dev/tavasthi-ktln-746 branch from 32b8746 to 9ab5e04 Compare April 3, 2024 08:06
@tapankavasthi tapankavasthi force-pushed the dev/tavasthi-ktln-746 branch from 9ab5e04 to 4f0897f Compare April 3, 2024 08:51
@theangrydev
Copy link
Contributor

@tapankavasthi going forwards can you try not to force push when possible, it's hard to review the diff versus the last time I reviewed the PR if the commit history is lost

@tapankavasthi
Copy link
Contributor Author

@tapankavasthi going forwards can you try not to force push when possible, it's hard to review the diff versus the last time I reviewed the PR if the commit history is lost

sure, @theangrydev. I wanted to keep the commit history clean, so had to squash the commits.

Here is the diff, in case you want to double-check:

https://github.com/Baeldung/kotlin-tutorials/compare/79bafd90587b07ddfe818844b8fe751e55d535a1..4f0897fe0440fa05f4ce74a26385afad0d791a8d

@theangrydev theangrydev merged commit 116eb78 into Baeldung:master Apr 4, 2024
@tapankavasthi tapankavasthi deleted the dev/tavasthi-ktln-746 branch August 14, 2024 23:55
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.

2 participants