How do I skip shapes with certain data type? #2248
-
I want to add some attribute to generated data types, except for data types who has e.g. pub struct SelectObjectContentOutput {
/// <p>The array of results.</p>
pub payload: aws_smithy_http::event_stream::Receiver<
crate::model::SelectObjectContentEventStream,
crate::error::SelectObjectContentEventStreamError,
>,
} Should I just check it by iterating through PR: #2183 |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 24 replies
-
You can use this So perhaps something like: // If none of the members are event stream
if (structShape.members.none { it.isEventStream(model) }) {
// add ser/de attributes
} |
Beta Was this translation helpful? Give feedback.
-
Hi, we're still looking into it. I wanted to make sure the Null pointer exception was reproducible in
|
Beta Was this translation helpful? Give feedback.
-
Let me share two things: 1. where NPE is coming from and 2. how you could debug code as
Up in the call stack, we see Further up in the call stack, we see it originate from rendering If we go up even further (not showing a screenshot), we see that all the frames above are part of rendering
You can then set an Exception Breakpoint as follows so the bugger stops only when NullPointerException is encountered: With that setting, you can start the debugger in IntelliJ with the bug icon. Then in a terminal, you can execute the following from the root directory of the
(you may need to run You should be able to reproduce the first screenshot in this reply. |
Beta Was this translation helpful? Give feedback.
-
I replaced this class Attribute(val inner: Writable) {
...
Attribute(cfgAttr(all(writable("aws_sdk_unstable"), pair("feature" to "serde-serialize"), derive(RuntimeType.SerdeSerialize)))).render(writer)
Attribute(cfgAttr(all(writable("aws_sdk_unstable"), pair("feature" to "serde-deserialize"), derive(RuntimeType.SerdeDeserialize)))).render(writer) with this class Attribute(val inner: Writable) {
constructor(str: String) : this(writable(str))
constructor(runtimeType: RuntimeType) : this(runtimeType.writable)
val SerdeSerialize = Attribute(RuntimeType.SerdeSerialize)
val SerdeDeserialize = Attribute(RuntimeType.SerdeDeserialize) Since constructor accepts This is the new error that I've got.
|
Beta Was this translation helpful? Give feedback.
-
Hi, I've made changes as suggested
on top of It's still an NPE in disguise, although the stack trace you got did not explicitly say that: Any chance |
Beta Was this translation helpful? Give feedback.
-
At this point, it's probably easier to work with a test whose scope is narrower than
The test fails with a NPE with the same root cause ( There could be other unit tests that fail in the same way. FYI, I use IntelliJ to run & debug unit tests. |
Beta Was this translation helpful? Give feedback.
You can use this
MemberShape.isEventStream
function to determine if the member of aStructureShape
is an event stream type (@streaming union
).So perhaps something like: