Skip to content

feat(api-only-transcriberj-restdocs): add the Spring REST Docs emitter for the API-Only TranscriberJ - #86

Merged
Arc-E-Tect merged 5 commits into
mainfrom
feat/api-only-transcriberj-restdocs
Sep 17, 2026
Merged

Arc-E-Tect merged 5 commits into
mainfrom
feat/api-only-transcriberj-restdocs

Conversation

@Arc-E-Tect

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

Copy link
Copy Markdown
Owner

What

This PR adds a new module, api-only-transcriberj-restdocs, published to Maven Central as com.arc-e-tect:api-only-transcriberj-restdocs. It is an emitter for the API-Only TranscriberJ, the Gradle plugin that generates Java classes from an API contract.

For every body class the TranscriberJ generates, the emitter writes a companion, <base>.restdocs.<Name>Docs. The companion has these methods:

  • fields() and fields(prefix) return the Spring REST Docs field descriptors.
  • requestFields() and responseFields() return the snippets. They are relaxed when the contract allows members it does not list.

All companions share one RestDocsFields class, which maps the TranscriberJ's field descriptions to descriptors. When the TranscriberJ could not generate a method from the contract, that method throws. The companion method that uses it throws too, rather than hiding the failure.

The emitter asks the TranscriberJ to manage org.springframework.restdocs:spring-restdocs-core at 4.0.1, and marks it untested from 5.

Why

Contract tests described request and response fields by hand, in classes that repeated the API specification and could drift from it. With the TranscriberJ, these descriptors are generated from the subscribed contract instead.

Build and release

  • The module compiles compileOnly against the TranscriberJ plugin, com.arc-e-tect:api-only-transcriberj:0.0.1, which carries the emitter interface.
  • Its tests run the TranscriberJ, with this emitter, over a copy of the reference implementation's user-account contract. They compile what comes out against Spring REST Docs, and call it.
  • The build, release and NVD scan workflows follow the pattern used for dsl-updater-core. The tag format is api-only-transcriberj-restdocs-v${version}, and the seed tag api-only-transcriberj-restdocs-v0.0.0 is already pushed.

Arc-E-Tect and others added 5 commits September 17, 2026 10:56
…r for the API-Only TranscriberJ

For every public class the API-Only TranscriberJ generates from a contract
with a body, the emitter writes a companion in <basePackage>.restdocs with
its field descriptors and its request and response field snippets, and
once, RestDocsFields, which turns the core's ContractField descriptions
into REST Docs descriptors. A body whose contract allows unlisted members
gets relaxed snippets.

It declares spring-restdocs-core 4.0.1 as the dependency the generated
code needs, untested from 5, for the plugin to manage.

The TranscriberJ is not released yet and is read from mavenLocal. Release
and CI configuration follow once the emitter is proven against the
reference implementation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…n and Maven Central publishing

The emitter gets the same release setup as dsl-updater-core: its own
semantic-release configuration under the api-only-transcriberj-restdocs-v*
tags, the first-release analyzer, jReleaser deployment to Maven Central
through a staging repository, and dependency-check. CONTRIB.adoc describes
it, and that the TranscriberJ it builds against must be released before
the CI workflows can resolve it. The repository README lists the module.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
api-only-transcriberj-restdocs-build.yml and
api-only-transcriberj-restdocs-release.yml follow the dsl-updater-core
workflows job for job, and nvd-cache-refresh.yml scans the module with the
same Read-Version and Security-Scan job pair.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…iberJ plugin, which carries the emitter interface

The API-Only TranscriberJ's emitter interface is now part of the plugin
artifact, so the emitter compiles against com.arc-e-tect:api-only-transcriberj,
compileOnly, from the Gradle Plugin Portal's repository. It ships no
dependency of its own: the plugin provides the interface when it loads the
emitter. The tests follow the TranscriberJ's current Generation.run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ed API-Only TranscriberJ 0.0.1

The TranscriberJ is on the Gradle Plugin Portal now, so the emitter resolves
it from there and no longer reads it from mavenLocal. The CONTRIB and README
no longer describe the local publishing step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Arc-E-Tect
Arc-E-Tect merged commit 259a71a into main Sep 17, 2026
4 checks passed
@Arc-E-Tect
Arc-E-Tect deleted the feat/api-only-transcriberj-restdocs branch September 17, 2026 10:58
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