-
Notifications
You must be signed in to change notification settings - Fork 219
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
[0.10] Support Smithy IDL Serialization #284
Merged
JordonPhillips
merged 16 commits into
smithy-lang:0.10
from
JordonPhillips:idl-serializer
Feb 27, 2020
Merged
[0.10] Support Smithy IDL Serialization #284
JordonPhillips
merged 16 commits into
smithy-lang:0.10
from
JordonPhillips:idl-serializer
Feb 27, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds a method to CodeWriter which allow for writing without having a trailing newline or leading indentation inserted. This can be very useful when you want to write part of a line without knowing what the whole line will contain. This does preserve some safety in that it will intercept newlines to treat them as normal, but it is still potentially dangerous if not used carefully.
This adds support for serializing a Smithy model into the IDL format.
mtdowling
requested changes
Feb 22, 2020
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Show resolved
Hide resolved
smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java
Outdated
Show resolved
Hide resolved
mtdowling
changed the title
Support Smithy IDL Serialization
[0.10] Support Smithy IDL Serialization
Feb 24, 2020
Shapes can be filtered case-insensitively because they are required to be case-insensitively unique. Metadata doesn't have that same constraint though, so filtering them as such would lead to a non- deterministic ordering.
mtdowling
requested changes
Feb 26, 2020
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java
Outdated
Show resolved
Hide resolved
This simplifies various bits of the internals, for instance by discarding much manual tinkering of sorting.
This updates the `compareTo` on shapeIds to be case-insensitve by default, with a case-sensitive tie-breaker. Though technically that means we could be comparing a given shape twice, practically the likelihood is low since ShapeId's in a model must be case-insensitively unique.
mtdowling
approved these changes
Feb 27, 2020
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the ability to take an in-memory model and serialize it into the Smithy IDL format.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.