@arc-e-tect/api-only-publisher 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.adoc CHANGED
@@ -6,7 +6,15 @@
6
6
  :source-highlighter: rouge
7
7
  // The released version of this component: its snippets use it. The release
8
8
  // workflow updates it; do not change it by hand.
9
- :api-only-publisher-version: 0.13.0
9
+ :api-only-publisher-version: 0.14.0
10
+
11
+ [NOTE]
12
+ .About this documentation
13
+ ====
14
+ This documentation was partially authored by Claude, an AI assistant.
15
+ Documentation is part of the product, and is held to the same standard as the code it describes.
16
+ If something here seems wrong, please file a bug report: link:https://github.com/Arc-E-Tect/SoftwareEngineeringDoneRight-API/issues/new[open an issue in this repository ↗].
17
+ ====
10
18
 
11
19
  image:https://github.com/Arc-E-Tect/SoftwareEngineeringDoneRight-API/actions/workflows/nvd-cache-refresh.yml/badge.svg[Vulnerability Scan,link=https://github.com/Arc-E-Tect/SoftwareEngineeringDoneRight-API/actions/workflows/nvd-cache-refresh.yml]
12
20
  image:https://img.shields.io/npm/v/@arc-e-tect/api-only-publisher[npm,link=https://www.npmjs.com/package/@arc-e-tect/api-only-publisher]
@@ -1021,11 +1029,19 @@ AsyncAPI operation '<operationId>': message '<messageKey>' (<fragment, or where
1021
1029
  ----
1022
1030
 
1023
1031
  For OpenAPI, it is whether a request body's or response's media type declares `example`/`examples`, or the schema it references carries its own top-level `examples`.
1024
- Nothing downstream currently reads an OpenAPI example, so the message never claims the bundle cannot be used -- only that the generated documentation is weaker without one:
1032
+ The message never claims the bundle cannot be used, and says only what is true for the part.
1033
+ For a request body, the TranscriberJ's contract cases send the example the media type names, or values from the schemas' own examples (link:../api-only-transcriberj/README.adoc#example-data[Example data in the TranscriberJ's README →]); without one they send values it generates:
1034
+
1035
+ [source,text]
1036
+ ----
1037
+ OpenAPI operation '<operationId>': request body (<fragment, or where in the bundle>) carries no example, so the TranscriberJ's contract cases send generated values rather than ones the contract chose, and the generated documentation is harder to read.
1038
+ ----
1039
+
1040
+ Nothing downstream reads a response's example, so for a response only the documentation is weaker without one:
1025
1041
 
1026
1042
  [source,text]
1027
1043
  ----
1028
- OpenAPI operation '<operationId>': <request body, or response <status>> (<fragment, or where in the bundle>) carries no example, which makes the generated documentation harder to read.
1044
+ OpenAPI operation '<operationId>': response <status> (<fragment, or where in the bundle>) carries no example, which makes the generated documentation harder to read.
1029
1045
  ----
1030
1046
 
1031
1047
  A body or response with no `content` at all, such as a `204`, has nothing to exemplify and is never reported.
@@ -1589,6 +1605,8 @@ docker/smoke-test.sh api-only-publisher:local 0.0.0-local
1589
1605
  It runs every step with no network, a read-only root and your own user: the version, the help, the toolchain labels against what is installed and against `init`'s pins, a library with two targets built, linted and packaged to every local channel in one run, ownership, byte-identical packaging twice, the hand-off, a foreign toolchain pin failing at once, the shell mode, and a build as an arbitrary UID.
1590
1606
 
1591
1607
  link:../.github/workflows/api-only-publisher-image-e2e.yml[`api-only-publisher-image-e2e.yml` →] runs the GitHub Actions reference pipeline for real, by hand only.
1608
+ link:test/docker.test.js[`test/docker.test.js` →] holds it to what the link:pipelines/[reference pipelines →] do, the same actions, commands, inputs and environment, but not to the versions they pin.
1609
+ The reference pipelines are examples, maintained on their own, and the end-to-end workflow is maintained with this repository's other workflows, so a new version of an action in one never fails the Publisher's build while the other has not moved.
1592
1610
  Give it an image by digest; it publishes version `0.<run>.<attempt>` of two scratch targets, `apionly-e2e-alpha` and `apionly-e2e-beta`, to npm, Maven and NuGet on GitHub Packages and to a scratch release, publishes again to prove a re-run is safe, resolves each package with its own client and with the Subscriber, and removes what it published.
1593
1611
  The image workflow, dispatched by hand, is the release's dry run: its defaults are the scratch names `ghcr.io/arc-e-tect/api-only-publisher-scratch` and `arcetect/api-only-publisher-scratch`, and it builds from the branch's source.
1594
1612
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arc-e-tect/api-only-publisher",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Builds, packs and publishes API description documents from a library of reusable fragments.",
5
5
  "license": "MIT",
6
6
  "author": "Arc-E-Tect",
@@ -46,7 +46,7 @@
46
46
  "@semantic-release/changelog": "^7.0.0",
47
47
  "@semantic-release/commit-analyzer": "^13.0.1",
48
48
  "@semantic-release/git": "^11.0.1",
49
- "@semantic-release/github": "^12.0.9",
49
+ "@semantic-release/github": "^12.0.10",
50
50
  "@semantic-release/npm": "^13.1.5",
51
51
  "@semantic-release/release-notes-generator": "^14.1.1",
52
52
  "semantic-release": "^25.0.9"
package/src/examples.js CHANGED
@@ -16,10 +16,12 @@
16
16
  // Object itself. A message with none cannot be used for Microcks-based conformance
17
17
  // testing at all, so the message says exactly that.
18
18
  //
19
- // OpenAPI: nothing downstream currently reads an example. The TranscriberJ
20
- // processes a bundle without one perfectly well -- bodies take arguments,
21
- // constraints become constants. So the OpenAPI message claims only what is true:
22
- // weaker documentation, never that the bundle cannot be used.
19
+ // OpenAPI: the TranscriberJ sends a request body's named example, or values from
20
+ // the schemas' own examples, in the contract cases it generates; without them it
21
+ // generates values from the constraints, and processes the bundle perfectly well.
22
+ // A response's example is read by nothing downstream. So the OpenAPI message
23
+ // claims only what is true for its part -- generated values for a request body,
24
+ // weaker documentation for both -- never that the bundle cannot be used.
23
25
 
24
26
  const KEY = "x-fragment-path";
25
27
 
@@ -160,8 +162,12 @@ function asyncapiMessage(finding) {
160
162
  */
161
163
  function openapiMessage(finding) {
162
164
  const where = finding.fragmentPath || `at ${finding.at}`;
163
- return `OpenAPI operation '${finding.operationId}': ${finding.part} (${where}) ` +
164
- "carries no example, which makes the generated documentation harder to read.";
165
+ const prefix = `OpenAPI operation '${finding.operationId}': ${finding.part} (${where}) carries no example, `;
166
+ if (finding.part === "request body") {
167
+ return prefix + "so the TranscriberJ's contract cases send generated values rather than ones the " +
168
+ "contract chose, and the generated documentation is harder to read.";
169
+ }
170
+ return prefix + "which makes the generated documentation harder to read.";
165
171
  }
166
172
 
167
173
  module.exports = {