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

Implement toNode for partition models #1449

Merged
merged 5 commits into from
Oct 18, 2022

Conversation

ganeshnj
Copy link
Contributor

Issue #, if available:

Description of changes:

Motivation

Currently I'm relying on the internal APIs to get the node for partitions in Swift SDK which we must not given how partitions are managed is totally internal details.

val partitions = DefaultPartitionDataProvider::class.java.getResourceAsStream("/software/amazon/smithy/rulesengine/language/partitions.json")
writer.write("private let partitions = \$S", Node.printJson(Node.parse(partitions)))

Changes

This change makes Parititions class Node convertible.

Result

I could do

val partitions = DefaultPartitionDataProvider().loadPartitions()
writer.write("private let partitions = \$S", Node.printJson(partitions.toNode()))

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ganeshnj ganeshnj marked this pull request as ready for review October 13, 2022 21:45
@ganeshnj ganeshnj requested a review from a team as a code owner October 13, 2022 21:45
Copy link
Contributor

@JordonPhillips JordonPhillips left a comment

Choose a reason for hiding this comment

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

Lets add a quick test case please

@ganeshnj
Copy link
Contributor Author

Lets add a quick test case please

Added one.

@mtdowling mtdowling merged commit 629d75b into smithy-lang:main Oct 18, 2022
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