Skip to content

Conversation

@JordonPhillips
Copy link
Contributor

This adds support for generating examples based on the examples trait. It also adds a general ability to generate code that initializes shapes based on a Node value as translated to Java code.

Note that the deserialize interface isn't used in this because the intent is to generate something that's naturally readable. Writing out the node and calling deserilize on it wouldn't be very readable, and wouldn't work on things that don't have the deserialize method.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@JordonPhillips JordonPhillips force-pushed the examples-trait branch 3 times, most recently from 691a904 to ad54ad7 Compare December 15, 2025 21:12
This adds a generator that writes out shape initializers given their
value as a node. This is primarily intended for examples, but could
be used for other purposes.
This adds support for the examples trait to javadoc generation
for clients.
var expected = """
* <h4>Examples</h4>
* <h5>Basic Example</h5>
* <pre>
Copy link
Member

Choose a reason for hiding this comment

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

you can use {@snippet : now

return false;
}
try {
Base64.getDecoder().decode(value.getBytes(StandardCharsets.UTF_8));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Base64.getDecoder().decode(value.getBytes(StandardCharsets.UTF_8));
Base64.getDecoder().decode(value);

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.

3 participants