-
Notifications
You must be signed in to change notification settings - Fork 623
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
Implement addAll functions for JsonArrayBuilder #2156
Conversation
formats/json/commonMain/src/kotlinx/serialization/json/JsonElementBuilders.kt
Outdated
Show resolved
Hide resolved
formats/json/commonMain/src/kotlinx/serialization/json/JsonElementBuilders.kt
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for your PR and sorry it took so long to process it. I think we can accept this functionality after some refining. As you correctly said, all new functions should be marked with @ExperimentalSerializationApi
. Can you also please rebase your branch on the latest dev
?
* | ||
* @return `true` if the list was changed as the result of the operation. | ||
*/ | ||
public fun addAll(elements: Collection<JsonElement>): Boolean = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good this function's signature matches one from MutableList
— we can add superclass later without breaking anything 👍🏻
formats/json/commonMain/src/kotlinx/serialization/json/JsonElementBuilders.kt
Outdated
Show resolved
Hide resolved
formats/json/commonMain/src/kotlinx/serialization/json/JsonElementBuilders.kt
Outdated
Show resolved
Hide resolved
75cba74
to
8b73cfc
Compare
1c894a0
to
f6f64f2
Compare
* @return `true` if the list was changed as the result of the operation. | ||
*/ | ||
@ExperimentalSerializationApi | ||
public fun JsonArrayBuilder.addAll(vararg elements: JsonElement): Boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for vararg
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I missed that one. It's now removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also apiDump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also apiDump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @sandwwraith, sorry I forgot this! Would you mind updating it? You should have permissions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, no problems
…arg elements: JsonElement)`
50b3420
to
dc46b70
Compare
* @return `true` if the list was changed as the result of the operation. | ||
*/ | ||
@ExperimentalSerializationApi | ||
public fun JsonArrayBuilder.addAll(vararg elements: JsonElement): Boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also apiDump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you once again!
Fix #2127
addAll()
method onJsonArrayBuilder
vararg
Should the new functions be marked with
@ExperimentalSerializationApi
?