-
Notifications
You must be signed in to change notification settings - Fork 586
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
Use serde elision index #4712
Use serde elision index #4712
Conversation
5f80e2d
to
6b81152
Compare
if (shape.getId().getName().equals("DenseBooleanMap")) { | ||
System.out.println("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.
😅 Let's remove this.
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. Removed.
/** | ||
* For handling expressions that may be unary function calls. | ||
*/ | ||
public abstract class UnaryFunctionCall { |
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.
Why is this class abstract
?
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.
Carry over from the original addition to smithy-typescript: https://github.com/awslabs/smithy-typescript/blob/main/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/validation/UnaryFunctionCall.java. It doesn't need to be abstract.
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.
there might've been a linter warning when a class only has static methods and isn't abstract
6b81152
to
99428ff
Compare
@@ -55,16 +55,19 @@ final class JsonShapeSerVisitor extends DocumentShapeSerVisitor { | |||
|
|||
private final BiFunction<MemberShape, String, String> memberNameStrategy; | |||
|
|||
JsonShapeSerVisitor(GenerationContext context) { | |||
JsonShapeSerVisitor(GenerationContext context, boolean serdeElisionEnabled) { |
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.
interface change is ok, right? if any external consumers upgrade, they change their calls at the same time?
/** | ||
* For handling expressions that may be unary function calls. | ||
*/ | ||
class UnaryFunctionCall { |
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.
I think this repo and smithy-ts have different static analysis requirements. It might've needed to be abstract there when there were no instance level methods or properties. That check made sense to me.
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. |
Issue
Issue number, if available, prefixed with "#"
Description
This PR updates the Shape visitors and protocol generators to use the SerdeElision KnowledgeIndex that was converted in smithy-lang/smithy-typescript#759
It also adds the UnaryFunctionCall class that was originally added to smithy-typescript (and which is removed in smithy-lang/smithy-typescript#760).
Testing
Ran
yarn generate-clients
to assure there were no generated code differences.Additionally, ran
./gradlew clean build
from thecodegen
directory to assure that thejava.lang.OutOfMemoryError: Java heap space
errors were not thrown as described in #4692.Additional context
Add any other context about the PR here.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.