-
Notifications
You must be signed in to change notification settings - Fork 195
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
Finish the smithy-json deserializer codegen #530
Conversation
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.
LGTM! there is also more code you can delete—we don't use synthetic body anymore so that can be deleted from operation normalizer
} | ||
} | ||
override fun additionalHeaders(operationShape: OperationShape): List<Pair<String, String>> = | ||
listOf("X-Amz-Target" to "${protocolConfig.serviceShape.id.name}.${operationShape.id.name}") |
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.
this should be x-amz-target
so that hyper doesn't need to re-case it for us
"Ok(body) => #1T { kind: #1TKind::$variantName(body), meta: generic },", | ||
errorSymbol | ||
override fun parseGenericError(operationShape: OperationShape): RuntimeType { | ||
return RuntimeType.forInlineFun("parse_generic_error", "json_deser") { |
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.
nit: you can have this be a single Rust block which is typically a little easier to read
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.
LGTM!
operation: OperationShape, | ||
outputBodyFactory: StructureModifier | ||
): List<StructureShape> { | ||
private fun syntheticOutputShapes(operation: OperationShape): List<StructureShape> { |
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.
can this just be StructureShape?
now?
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 in this particular case, the code is actually cleaner with them being lists since the code that calls these functions is pretty clean that way, even if they only ever have one element. I would have to convert them at the call sites otherwise.
operation: OperationShape, | ||
inputBodyFactory: StructureModifier | ||
): List<StructureShape> { | ||
private fun syntheticInputShapes(operation: OperationShape): List<StructureShape> { |
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.
same here re: StructureShape?
Fixes #161. This is the last of the JSON refactor.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.