Skip to content

feat(api-detector-core): resolve another class's constant through the property map - #85

Merged
Arc-E-Tect merged 1 commit into
mainfrom
feat/api-detector-core-field-access
Sep 17, 2026
Merged

Arc-E-Tect merged 1 commit into
mainfrom
feat/api-detector-core-field-access

Conversation

@Arc-E-Tect

@Arc-E-Tect Arc-E-Tect commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

What

LiteralPathResolver now resolves a reference to another class's constant, such as GetUserOperation.PATH. It looks the reference up in the PropertyResolutionContext under the key ClassName.FIELD, using the class's simple name even when the reference is fully qualified. This works where the reference is used directly and where it initializes a field in the same file.

Why

The API-Only TranscriberJ generates a class per operation from the API contract, so tests take their endpoint paths from compile-checked constants rather than from ApiEndpoints.get("key"). A scanner that reads one file at a time cannot see those constants' values. The TranscriberJ therefore writes them to a properties file, keyed ClassName.PATH, which the Doppelganger plugin's propertyFiles can point at.

Compatibility

The change is additive, and nothing depends on the TranscriberJ.

  • Literals, same-file constants, helper methods and @Value fields resolve exactly as before.
  • Without a matching key in the property map, another class's constant still resolves to nothing, as it did before.
  • A reference whose scope is computed is never resolved.

… property map

A path held in another class's constant, such as GetUserOperation.PATH in a
class generated from the API contract, cannot be resolved from the file
that uses it. LiteralPathResolver now looks such a reference up in the
PropertyResolutionContext under the key ClassName.FIELD, by the class's
simple name even when the reference is fully qualified, both where it is
used directly and where it initializes a field in the same file. A
reference whose scope is computed is still not resolved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Arc-E-Tect
Arc-E-Tect merged commit 316347b into main Sep 17, 2026
4 checks passed
@Arc-E-Tect
Arc-E-Tect deleted the feat/api-detector-core-field-access branch September 17, 2026 10:36
Arc-E-Tect added a commit that referenced this pull request Sep 17, 2026
# [1.8.0](api-detector-core-v1.7.0...api-detector-core-v1.8.0) (2026-09-17)

### ✨ New and updated features

* **api-detector-core:** resolve another class's constant through the property map ([#85](#85)) ([316347b](316347b)), closes [#85](#85)

### 🐛 Bug Fixes

* **dsl-updater-core:** fix all 16 missing-javadoc warnings ([#84](#84)) ([38a1b25](38a1b25)), closes [#84](#84)

### 📝 Documentation

* **dsl-updater-core:** update README version to 1.0.1 [skip ci] ([0e899ed](0e899ed))
* **api-detector-core:** update README version to 1.7.0 [skip ci] ([24acc69](24acc69))
@Arc-E-Tect

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Arc-E-Tect added a commit that referenced this pull request Sep 17, 2026
## [0.0.1](api-only-transcriberj-restdocs-v0.0.0...api-only-transcriberj-restdocs-v0.0.1) (2026-09-17)

### ✨ New and updated features

* **api-only-transcriberj-restdocs:** add the Spring REST Docs emitter for the API-Only TranscriberJ ([#86](#86)) ([259a71a](259a71a)), closes [#86](#86)
* **api-detector-core:** resolve another class's constant through the property map ([#85](#85)) ([316347b](316347b)), closes [#85](#85)

### 📝 Documentation

* **api-detector-core:** update README version to 1.8.0 [skip ci] ([590f332](590f332))
@Arc-E-Tect

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 0.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Arc-E-Tect

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Arc-E-Tect

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Arc-E-Tect

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Arc-E-Tect

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant