Skip to content

Escape comparison delimiters in generated JavaDoc - #984

Merged
iuliiasobolevska merged 2 commits into
Netflix:masterfrom
abhinavs1920:fix-javadoc-comparisons-772
Nov 4, 2026
Merged

iuliiasobolevska merged 2 commits into
Netflix:masterfrom
abhinavs1920:fix-javadoc-comparisons-772

Conversation

@abhinavs1920

Copy link
Copy Markdown
Contributor

Fixes #772.

Escape stray < characters in Java schema descriptions, such as created_at:<now and <=2024, while retaining complete HTML tags and Javadoc code/literal blocks. Applied across data types, interfaces, enums and client descriptions. This is not a general HTML sanitizer.

Added a regression that runs JDK 17 Javadoc on the generated sources, plus a markup-preservation check. The generated-source regression fails on master with malformed-HTML errors and passes with this change.

Validation on Linux/JDK 17: 7 focused Javadoc tests passed; Kotlin main/test lint and git diff --check passed. Full core/integration and broader client test runs did not finish within the local execution window, so I cannot claim those passed. Other operating systems were not tested.

abhinavs1920 and others added 2 commits November 3, 2026 18:26
Preserve balanced inline literals, HTML comments and quoted attributes while escaping comparison text and bare ampersands.
Escape comment terminators and eligible Unicode escape backslashes without changing literal rendering.
Cover descriptions and deprecation documentation at every Java emission site.
@iuliiasobolevska
iuliiasobolevska force-pushed the fix-javadoc-comparisons-772 branch from 0d7d91f to 12a4315 Compare November 4, 2026 02:36
@iuliiasobolevska

iuliiasobolevska commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Hi @abhinavs1920!
Thank you for the contribution!

Rebased your branch and added the following fixes to strengthen the Javadoc escaping (12a43150):

  • Preserves balanced {@code} and {@literal} blocks, HTML comments, quoted attributes and existing entities.
  • Handles stray <, bare &, comment terminators (*/) and Java Unicode escapes without changing literal rendering.
  • Applies escaping consistently to descriptions, deprecation reasons and directive comments.
  • Adds regression tests that compile generated Java, run strict Java 17 doclint and check rendered HTML for double escaping.

@iuliiasobolevska
iuliiasobolevska merged commit 7cd5538 into Netflix:master Nov 4, 2026
1 check passed
@iuliiasobolevska iuliiasobolevska added the bug Something isn't working label Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments in generated java objects may not be javadoc compliant

2 participants