Skip to content

Support custom class lookup in Wire conversion (#806) - #807

Draft
maxim-ponomarev wants to merge 3 commits into
developfrom
#806-Support-custom-ClassLookup-in-WireTypeConverter
Draft

maxim-ponomarev wants to merge 3 commits into
developfrom
#806-Support-custom-ClassLookup-in-WireTypeConverter

Conversation

@maxim-ponomarev

@maxim-ponomarev maxim-ponomarev commented Jan 10, 2024 •

Copy link
Copy Markdown
Contributor

Add ClassLookup constructor overloads to WireTypeConverter and share the supplied lookup between YAML and JSON conversion. Retain validation and propagate lookup failures through the converter.

The draft also introduces a lookup wrapper that generates map-backed classes for unknown type names, with YAML/JSON/YAML round-trip tests.

This remains a draft. Review the public exception-signature change, qualified-name and alias handling, generated-class ownership and restoration of global Wire test settings. The discussion also points to #823; reconcile that related work before choosing a delivery path.

Validation: the diff and recorded review/check history were inspected at 609b4becef47. No build, test or benchmark was rerun for this metadata edit. No CI result was returned for this head.

@yevgenp
yevgenp force-pushed the #806-Support-custom-ClassLookup-in-WireTypeConverter branch from 95d5159 to 05fa50e Compare January 30, 2024 14:22
@yevgenp

yevgenp commented Jan 30, 2024

Copy link
Copy Markdown
Contributor

@maxim-ponomarev I've adjusted the test (as per YamlWire specs). Please verify if that's acceptable.

@yevgenp
yevgenp force-pushed the #806-Support-custom-ClassLookup-in-WireTypeConverter branch from 05fa50e to 609b4be Compare January 30, 2024 20:20

public class UnknownClassLookup implements ClassLookup {
public static final CachedCompiler CACHED_COMPILER =
new CachedCompiler(Jvm.isDebug() ? new File(OS.getTarget(), "generated-test-sources") : null, null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This class should be moved to test sources or target has to be adjusted respectively.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
72.9% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@peter-lawrey

Copy link
Copy Markdown
Member

c.f. #823

@peter-lawrey peter-lawrey changed the title #806 Support custom ClassLookup in WireTypeConverter Support custom class lookup in Wire conversion (#806) Sep 12, 2026

This branch has not been deployed

No deployments
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