Skip to content
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

Add IDL serializer option to coerce inline IO #2316

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

kstich
Copy link
Contributor

@kstich kstich commented Jun 11, 2024

This commit adds a new IDL serializer configuration, coerceInlineIo, that will use inline IO to write input and output shapes that are only bound to one operation - even if they don't have the input or output trait applied.

It also fixes a bug where an empty newline was written before empty inline IO shape definitions.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kstich kstich requested a review from a team as a code owner June 11, 2024 16:58
@kstich kstich requested a review from milesziemer June 11, 2024 16:58
@@ -833,7 +874,7 @@ private Collection<MemberShape> writeInlineableProperty(String key, ShapeId shap
}

private boolean hasOnlyDefaultTrait(Shape shape, ShapeId defaultTrait) {
return shape.getAllTraits().size() == 1 && shape.hasTrait(defaultTrait);
return shape.getAllTraits().isEmpty() || (shape.getAllTraits().size() == 1 && shape.hasTrait(defaultTrait));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the aforementioned fix.

This commit adds a new IDL serializer configuration, coerceInlineIo,
that will use inline IO to write input and output shapes that are only
bound to one operation - even if they don't have the input or output
trait applied.

It also fixes a bug where an empty newline was written before empty
inline IO shape definitions.
@kstich kstich force-pushed the coerce_inline_io_idl_serializer branch from 31b4e10 to 1b901f5 Compare June 11, 2024 18:00
@kstich kstich merged commit 754426b into main Jun 11, 2024
14 checks passed
@kstich kstich deleted the coerce_inline_io_idl_serializer branch June 11, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants