feat: update JSON protocol codegen for cleanliness#547
Merged
kstich merged 3 commits intosmithy-codegenfrom Dec 12, 2019
Merged
feat: update JSON protocol codegen for cleanliness#547kstich merged 3 commits intosmithy-codegenfrom
kstich merged 3 commits intosmithy-codegenfrom
Conversation
This commit includes assorted updates to the protocol generators to improve reusability, set proper visibility, use an import alias for SerdeContext, and other minor updates. It also includes a fix for handling the unknown case when deserializing a union.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
mtdowling
reviewed
Dec 10, 2019
...pt-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java
Outdated
Show resolved
Hide resolved
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
mtdowling
reviewed
Dec 12, 2019
| @Override | ||
| protected void generateDocumentShapeSerializers(GenerationContext context, Set<Shape> shapes) { | ||
| generateDocumentShapeSerde(context, shapes, new JsonShapeSerVisitor(context)); | ||
| protected void generateDocumentBodyShapeSer(GenerationContext context, Set<Shape> shapes) { |
Contributor
There was a problem hiding this comment.
I think "Ser" is not a descriptive enough name and prefer Serializer
| Set<Shape> shapesToDeserialize = new TreeSet<>(shapes); | ||
| shapes.forEach(shape -> shapesToDeserialize.addAll(shapeWalker.walkShapes(shape))); | ||
| shapesToDeserialize.forEach(shape -> shape.accept(visitor)); | ||
| protected void generateDocumentBodyShapeDeser(GenerationContext context, Set<Shape> shapes) { |
Contributor
There was a problem hiding this comment.
Deser is slightly better than Ser, but still not ideal.
| @Override | ||
| protected void generateDocumentShapeSerializers(GenerationContext context, Set<Shape> shapes) { | ||
| generateDocumentShapeSerde(context, shapes, new JsonShapeSerVisitor(context)); | ||
| protected void generateDocumentBodyShapeSer(GenerationContext context, Set<Shape> shapes) { |
0783ef8 to
fab4223
Compare
mtdowling
approved these changes
Dec 12, 2019
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 commit includes assorted updates to the protocol generators
to improve reusability, set proper visibility, use an import alias
for SerdeContext, and other minor updates.
It also includes a fix for handling the unknown case when
deserializing a union.
Use Model instead of deprecated ShapeIndex. This commit will require using the latest version of Smithy published locally.
Use better name for document body shape serde gen
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.