Skip to content

Conversation

@langehm
Copy link
Contributor

@langehm langehm commented May 27, 2025

Pull Request

Changes

  • added openapi-generator to package.json
  • added openapi-generator config for backend module
  • added generated file to ignores-files
  • generated client for frontend and webcomponent

Currently the client is not used and is only generated. This should be changed in an followup issue.

Full "variability" for the configuration is currently not possible, see

Reference

Issue: #619

Checklist

Note: If some checklist items are not relevant for your PR, just remove them.

General

  • I have read the Contribution Guidelines (TBD)
  • Met all acceptance criteria of the issue
  • Added meaningful PR title and list of changes in the description
  • Opened documentation issue in [refarch repository][refarch-create-documentation-issue-link]

Code

  • Wrote code and comments in English

Frontend / WebComponent

  • Checked / Updated Node.js engine requirements in package.json (if dependencies were changed)

Summary by CodeRabbit

  • Chores
    • Added automated OpenAPI client generation for backend APIs and supporting tooling across frontend and webcomponent projects.
    • Added generation scripts and generator configuration to streamline producing typed API clients and models.
    • Configured formatting/linting to ignore generated API artifacts so tooling won't modify generated code.
    • Included versioning metadata for the generator to ensure reproducible client generation.

✏️ Tip: You can customize this high-level summary in your review settings.

@langehm langehm linked an issue May 27, 2025 that may be closed by this pull request
2 tasks
@langehm langehm self-assigned this May 27, 2025
@github-actions github-actions bot added Template: Frontend Issues regarding the frontend template. Type: Feature The issue is an feature labels May 27, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 27, 2025

📝 Walkthrough

Walkthrough

Adds OpenAPI Generator configs and scripts, excludes generated API folders from linters/formatters, and adds generated TypeScript OpenAPI clients, models, and runtime artifacts for refarch-frontend and refarch-webcomponent.

Changes

Cohort / File(s) Summary
Project config & scripts
refarch-frontend/.prettierignore, refarch-frontend/eslint.config.js, refarch-frontend/package.json, refarch-webcomponent/.prettierignore, refarch-webcomponent/eslint.config.js, refarch-webcomponent/package.json, refarch-frontend/openapitools.json, refarch-webcomponent/openapitools.json
Added openapitools.json configs, api-gen npm scripts, @openapitools/openapi-generator-cli devDependency, and updated Prettier/ESLint ignores to exclude src/api/*/ generated folders.
Generator metadata & controls
.../src/api/refarch-backend/.openapi-generator/*, .../src/api/refarch-backend/.openapi-generator-ignore, .../src/api/refarch-backend/.openapi-generator/VERSION (both projects)
Added generator metadata, FILES listing, VERSION (7.19.0), and .openapi-generator-ignore templates to control regen.
Generated API clients
refarch-frontend/src/api/refarch-backend/apis/ActuatorApi.ts, refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts, refarch-webcomponent/src/api/refarch-backend/apis/ActuatorApi.ts, refarch-webcomponent/src/api/refarch-backend/apis/TheEntityControllerApi.ts
Added generated API classes with raw and convenience methods, request interfaces, enums, parameter validation, and JSON (de)serialization usage.
Models & DTOs
refarch-frontend/src/api/refarch-backend/models/*, refarch-webcomponent/src/api/refarch-backend/models/*
Added model files (Link, PageMetadata, PagedModelTheEntityResponseDTO, TheEntityRequestDTO, TheEntityResponseDTO) including type interfaces, type guards, and JSON (de)serializers.
Runtime & HTTP client
refarch-frontend/src/api/refarch-backend/runtime.ts, refarch-webcomponent/src/api/refarch-backend/runtime.ts
Added full generated runtime: BASE_PATH, Configuration, DefaultConfig, BaseAPI, middleware hooks, request construction, fetch integration, response wrappers, and error types.
Barrels & entry points
refarch-frontend/src/api/refarch-backend/apis/index.ts, refarch-frontend/src/api/refarch-backend/models/index.ts, refarch-frontend/src/api/refarch-backend/index.ts, refarch-webcomponent/src/api/refarch-backend/apis/index.ts, refarch-webcomponent/src/api/refarch-backend/models/index.ts, refarch-webcomponent/src/api/refarch-backend/index.ts
Added barrel/entry files re-exporting runtime, APIs, and models to expose the generated client surface.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Consumer as Consumer
participant API as Generated API
participant Runtime as BaseAPI/Runtime
participant Fetch as fetch
participant Backend as Backend
Consumer->>API: call method (e.g., getTheEntity)
API->>Runtime: build request options, serialize body/query
Runtime->>Runtime: apply pre-middleware
Runtime->>Fetch: perform HTTP request
Fetch->>Backend: HTTP request
Backend-->>Fetch: HTTP response
Fetch-->>Runtime: Response received
Runtime->>Runtime: apply post-middleware, deserialize body
Runtime-->>API: return ApiResponse / value
API-->>Consumer: return typed result

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇
From spec I nibble, line by line,
APIs sprout where YAML did shine.
Models, runtime, middleware hop—so spry,
Clients ready, watch requests fly.
A carrot-toast to generated delight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.63% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main feature: OpenAPI client generation for issue #619. It is specific, concise, and directly reflects the changeset.
Description check ✅ Passed The description covers the main changes (openapi-generator addition, configuration, generated files, ignore rules) and includes the issue reference (#619). Most checklist items are completed, though some non-critical frontend/webcomponent items were appropriately removed as not applicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the Template: Webcomponent Issues regarding the webcomponent template. label Jan 15, 2026
Comment on lines +22 to +29
import {
PagedModelTheEntityResponseDTOFromJSON,
PagedModelTheEntityResponseDTOToJSON,
TheEntityRequestDTOFromJSON,
TheEntityRequestDTOToJSON,
TheEntityResponseDTOFromJSON,
TheEntityResponseDTOToJSON,
} from '../models/index';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused imports PagedModelTheEntityResponseDTOToJSON, TheEntityRequestDTOFromJSON, TheEntityResponseDTOToJSON.

Copilot Autofix

AI 9 days ago

In general, the way to fix unused import warnings is to remove the specific imported symbols that are never referenced in the file, while keeping any that are actually used. We should not remove the entire import statement if some of its members are used elsewhere.

In refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts, we need to update the named import block on lines 22–29. According to CodeQL, PagedModelTheEntityResponseDTOToJSON, TheEntityRequestDTOFromJSON, and TheEntityResponseDTOToJSON are unused. We will keep only the symbols that might be used (PagedModelTheEntityResponseDTOFromJSON, TheEntityRequestDTOToJSON, and TheEntityResponseDTOFromJSON) and delete the unused ones from that import list. No other code changes or new imports are required.

Suggested changeset 1
refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts b/refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts
--- a/refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts
+++ b/refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts
@@ -21,11 +21,8 @@
 } from '../models/index';
 import {
     PagedModelTheEntityResponseDTOFromJSON,
-    PagedModelTheEntityResponseDTOToJSON,
-    TheEntityRequestDTOFromJSON,
     TheEntityRequestDTOToJSON,
     TheEntityResponseDTOFromJSON,
-    TheEntityResponseDTOToJSON,
 } from '../models/index';
 
 export interface DeleteTheEntityRequest {
EOF
@@ -21,11 +21,8 @@
} from '../models/index';
import {
PagedModelTheEntityResponseDTOFromJSON,
PagedModelTheEntityResponseDTOToJSON,
TheEntityRequestDTOFromJSON,
TheEntityRequestDTOToJSON,
TheEntityResponseDTOFromJSON,
TheEntityResponseDTOToJSON,
} from '../models/index';

export interface DeleteTheEntityRequest {
Copilot is powered by AI and may make mistakes. Always verify output.
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import mapValues.

Copilot Autofix

AI 16 days ago

In general, unused imports should be removed to keep the code clear and avoid confusion about dependencies. Since mapValues is not referenced anywhere in Link.ts, the best fix is simply to delete the import line that brings mapValues into scope.

Concretely, in refarch-frontend/src/api/refarch-backend/models/Link.ts, remove line 15 (import { mapValues } from '../runtime';). No additional methods, imports, or definitions are needed, and no other lines need to be changed. This will eliminate the unused import without affecting any existing functionality.

Suggested changeset 1
refarch-frontend/src/api/refarch-backend/models/Link.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/refarch-frontend/src/api/refarch-backend/models/Link.ts b/refarch-frontend/src/api/refarch-backend/models/Link.ts
--- a/refarch-frontend/src/api/refarch-backend/models/Link.ts
+++ b/refarch-frontend/src/api/refarch-backend/models/Link.ts
@@ -12,7 +12,6 @@
  * Do not edit the class manually.
  */
 
-import { mapValues } from '../runtime';
 /**
  * 
  * @export
EOF
@@ -12,7 +12,6 @@
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
/**
*
* @export
Copilot is powered by AI and may make mistakes. Always verify output.
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import mapValues.

Copilot Autofix

AI 16 days ago

In general, the correct fix for an unused import is to remove the import statement (or the unused symbol from a multi-symbol import) so that all imported identifiers are actually used. This reduces noise, avoids confusion, and can slightly improve build performance.

For this specific file (refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts), the best fix is to delete the single unused import line import { mapValues } from '../runtime'; at line 15. No other code in this file refers to mapValues, so there is no need to add alternative logic or replace it with anything else. The rest of the file remains unchanged. No new methods, imports, or definitions are required.

Suggested changeset 1
refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts b/refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts
--- a/refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts
+++ b/refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts
@@ -12,7 +12,6 @@
  * Do not edit the class manually.
  */
 
-import { mapValues } from '../runtime';
 /**
  * 
  * @export
EOF
@@ -12,7 +12,6 @@
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
/**
*
* @export
Copilot is powered by AI and may make mistakes. Always verify output.
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import mapValues.

Copilot Autofix

AI 16 days ago

In general, to fix an unused import you remove the import statement if the symbol is truly unused, or start using the imported symbol if it was intended to be used. Here, none of the functions or interfaces reference mapValues, and there is no indication it should be used, so the safest and simplest fix is to remove the mapValues import line.

Concretely, in refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts, delete line 15 (import { mapValues } from '../runtime';). No additional methods, imports, or definitions are needed; existing functionality for JSON/typed conversion remains unchanged.

Suggested changeset 1
refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts b/refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
--- a/refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
+++ b/refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
@@ -12,7 +12,6 @@
  * Do not edit the class manually.
  */
 
-import { mapValues } from '../runtime';
 import type { PageMetadata } from './PageMetadata';
 import {
     PageMetadataFromJSON,
EOF
@@ -12,7 +12,6 @@
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
import type { PageMetadata } from './PageMetadata';
import {
PageMetadataFromJSON,
Copilot is powered by AI and may make mistakes. Always verify output.
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import mapValues.

Copilot Autofix

AI 16 days ago

In general, unused imports should be removed from the file where they are declared. This eliminates dead code, avoids confusion, and can slightly improve build performance.

The best fix here is to delete the unused mapValues import on line 15 of refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts. No other code changes are needed because mapValues is not referenced anywhere else in the file. The rest of the imports (PageMetadata, TheEntityResponseDTO, and their JSON helper functions) are used and should remain intact. No new methods, imports, or definitions are required.

Suggested changeset 1
refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts b/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
--- a/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
+++ b/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
@@ -12,7 +12,6 @@
  * Do not edit the class manually.
  */
 
-import { mapValues } from '../runtime';
 import type { PageMetadata } from './PageMetadata';
 import {
     PageMetadataFromJSON,
EOF
@@ -12,7 +12,6 @@
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
import type { PageMetadata } from './PageMetadata';
import {
PageMetadataFromJSON,
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +17 to +22
import {
PageMetadataFromJSON,
PageMetadataFromJSONTyped,
PageMetadataToJSON,
PageMetadataToJSONTyped,
} from './PageMetadata';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused imports PageMetadataFromJSONTyped, PageMetadataToJSONTyped.

Copilot Autofix

AI 16 days ago

In general, unused imports should be removed from the file to avoid dead code and improve readability. Here, we should adjust the PageMetadata import so that it only brings in the symbols actually used in this file.

Concretely, in refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts, modify the named import from './PageMetadata' on lines 17–22 to remove PageMetadataFromJSONTyped and PageMetadataToJSONTyped. Keep PageMetadataFromJSON and PageMetadataToJSON as they are required by the JSON conversion functions. No other parts of the file need to change, and no new imports or helper methods are required.

Suggested changeset 1
refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts b/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
--- a/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
+++ b/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
@@ -16,9 +16,7 @@
 import type { PageMetadata } from './PageMetadata';
 import {
     PageMetadataFromJSON,
-    PageMetadataFromJSONTyped,
     PageMetadataToJSON,
-    PageMetadataToJSONTyped,
 } from './PageMetadata';
 import type { TheEntityResponseDTO } from './TheEntityResponseDTO';
 import {
EOF
@@ -16,9 +16,7 @@
import type { PageMetadata } from './PageMetadata';
import {
PageMetadataFromJSON,
PageMetadataFromJSONTyped,
PageMetadataToJSON,
PageMetadataToJSONTyped,
} from './PageMetadata';
import type { TheEntityResponseDTO } from './TheEntityResponseDTO';
import {
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +24 to +29
import {
TheEntityResponseDTOFromJSON,
TheEntityResponseDTOFromJSONTyped,
TheEntityResponseDTOToJSON,
TheEntityResponseDTOToJSONTyped,
} from './TheEntityResponseDTO';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused imports TheEntityResponseDTOFromJSONTyped, TheEntityResponseDTOToJSONTyped.

Copilot Autofix

AI 16 days ago

In general, unused imports should be removed so that only actually referenced symbols are imported. This improves readability and avoids confusion about which functions are in use.

The best fix here is to adjust the import from ./TheEntityResponseDTO to only include the two functions that are used: TheEntityResponseDTOFromJSON and TheEntityResponseDTOToJSON. Specifically, in refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts, lines 24–29, we should remove TheEntityResponseDTOFromJSONTyped and TheEntityResponseDTOToJSONTyped from the import list. No other code changes or new imports are required, since the rest of the file already works with the non-typed versions, and existing functionality will remain unchanged.

Suggested changeset 1
refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts b/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
--- a/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
+++ b/refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
@@ -23,9 +23,7 @@
 import type { TheEntityResponseDTO } from './TheEntityResponseDTO';
 import {
     TheEntityResponseDTOFromJSON,
-    TheEntityResponseDTOFromJSONTyped,
     TheEntityResponseDTOToJSON,
-    TheEntityResponseDTOToJSONTyped,
 } from './TheEntityResponseDTO';
 
 /**
EOF
@@ -23,9 +23,7 @@
import type { TheEntityResponseDTO } from './TheEntityResponseDTO';
import {
TheEntityResponseDTOFromJSON,
TheEntityResponseDTOFromJSONTyped,
TheEntityResponseDTOToJSON,
TheEntityResponseDTOToJSONTyped,
} from './TheEntityResponseDTO';

/**
Copilot is powered by AI and may make mistakes. Always verify output.
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import mapValues.

Copilot Autofix

AI 16 days ago

To fix the problem, we should remove the unused mapValues import from this file. This directly addresses the static analysis finding without altering any runtime behavior, because mapValues is never referenced.

Concretely:

  • In refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts, delete line 15: import { mapValues } from '../runtime';.
  • No other changes are required: no new imports, methods, or definitions are needed, and the existing serialization/deserialization functions continue to work as before.
Suggested changeset 1
refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts b/refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts
--- a/refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts
+++ b/refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts
@@ -12,7 +12,6 @@
  * Do not edit the class manually.
  */
 
-import { mapValues } from '../runtime';
 /**
  * 
  * @export
EOF
@@ -12,7 +12,6 @@
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
/**
*
* @export
Copilot is powered by AI and may make mistakes. Always verify output.
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import mapValues.

Copilot Autofix

AI 16 days ago

In general, to fix an unused import, you remove the import statement if the symbol is not used anywhere in the file. This simplifies the code and avoids confusion.

Here, the best fix is to delete the mapValues import on line 15 of refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts. No other code changes are required because nothing in this file references mapValues, and there are no dependent types or functions tied to that import. No new methods, imports, or definitions are needed.

Suggested changeset 1
refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts b/refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts
--- a/refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts
+++ b/refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts
@@ -12,7 +12,6 @@
  * Do not edit the class manually.
  */
 
-import { mapValues } from '../runtime';
 /**
  * 
  * @export
EOF
@@ -12,7 +12,6 @@
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
/**
*
* @export
Copilot is powered by AI and may make mistakes. Always verify output.
@langehm langehm marked this pull request as ready for review January 15, 2026 15:34
@langehm langehm requested a review from a team as a code owner January 15, 2026 15:34
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@refarch-frontend/openapitools.json`:
- Around line 1-19: The additionalProperties block in openapitools.json contains
an unsupported property "typescriptThreePlus" for the "typescript-fetch"
generator; remove "typescriptThreePlus": true from the additionalProperties
object and (optionally) add "withInterfaces": true to improve type separation,
and consider bumping "generator-cli" version from "7.13.0" to a newer release
(e.g., "7.18.0") to pick up fixes; update the JSON so additionalProperties only
contains supported keys ("supportsES6", "enumPropertyNaming", and optionally
"withInterfaces") while leaving "generatorName": "typescript-fetch" unchanged.

In `@refarch-frontend/package.json`:
- Line 46: DevDependencies in package.json are not alphabetically ordered: move
the "@openapitools/openapi-generator-cli" entry so it appears after
"@muenchen/..." and before the "@vue/..." entries; update the devDependencies
block to place "@openapitools/openapi-generator-cli": "2.27.0" in that correct
alphabetical position (keeping the version unchanged) to maintain the requested
ordering convention.

In `@refarch-webcomponent/src/api/refarch-backend/runtime.ts`:
- Around line 244-249: The method clone<T extends BaseAPI>(this: T) defines a
local variable named constructor which shadows the global name; rename that
local variable (e.g., to ctor or apiCtor) and update its usages inside the
method (in the line that instantiates new constructor(this.configuration)) to
eliminate the shadowing, or if you prefer not to change generated code, add
runtime.ts to the Biome ignore list or adjust the OpenAPI Generator template to
emit a different variable name.

In `@stack/openapitools.json`:
- Around line 4-6: Update the stack-level OpenAPI Generator CLI version to match
the repo: in stack/openapitools.json change the "generator-cli" -> "version"
value from "7.9.0" to "7.13.0" so it aligns with refarch-frontend and
refarch-webcomponent and ensures consistent generated code and types across the
codebase.
♻️ Duplicate comments (14)
refarch-frontend/src/api/refarch-backend/models/Link.ts (1)

15-15: Unused import in generated code.

The mapValues import is unused in this file, as flagged by CodeQL. Since this is auto-generated code (with lint rules disabled at lines 1-2), manual fixes would be overwritten on regeneration. This is a known quirk of the OpenAPI Generator for simple models that don't require the utility.

The generated code is correctly excluded from linting via .eslintignore per the PR description, so this won't cause CI failures.

refarch-webcomponent/src/api/refarch-backend/models/Link.ts (1)

15-15: Unused import mapValues in generated code.

This is a known OpenAPI Generator behavior—it imports utility functions regardless of whether the model uses them. Since this file is auto-generated and marked "Do not edit," consider addressing this at the generator level via a custom template or post-generation script if the unused imports cause issues.

refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts (1)

15-15: Unused import mapValues in generated code.

Same issue as other generated model files. This is an OpenAPI Generator quirk that should be addressed at the generator configuration level if needed.

refarch-webcomponent/src/api/refarch-backend/apis/ActuatorApi.ts (1)

17-23: Unused imports LinkFromJSON and LinkToJSON in generated code.

The Link type (line 18) is used in the return type of linksRaw/links methods, but the JSON serialization utilities are not called because the response is a nested map structure returned as-is. This is an OpenAPI Generator limitation.

refarch-frontend/src/api/refarch-backend/apis/ActuatorApi.ts (1)

20-23: Unused imports detected by static analysis.

LinkFromJSON and LinkToJSON are imported but never used. This is a common artifact of OpenAPI Generator when the generated code doesn't require serialization helpers for all imported types.

Since this is auto-generated code, consider configuring the generator to avoid unused imports, or ensure these files remain in .eslintignore as the PR already does.

refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts (1)

15-15: Unused mapValues import.

The mapValues import is not used in this file. This is a common OpenAPI Generator artifact where the runtime utility is imported but not needed for simple DTOs without nested object mappings.

Since this is auto-generated code with linting disabled, this is acceptable.

refarch-webcomponent/src/api/refarch-backend/models/PageMetadata.ts (1)

15-15: Unused import mapValues in auto-generated code.

This is a known quirk of the OpenAPI Generator where imports may be included but not used depending on the model structure. Since this file is auto-generated (as noted in the header), manual fixes would be overwritten on regeneration.

The generated files are already excluded from ESLint via the ignore configuration added in this PR, so this won't cause CI failures.

refarch-frontend/src/api/refarch-backend/models/TheEntityResponseDTO.ts (1)

1-72: Auto-generated OpenAPI client code looks correct.

This file is auto-generated by OpenAPI Generator with appropriate header comments and disabled lint rules. The interface definition, type guard, and JSON serialization helpers follow the standard OpenAPI Generator typescript-fetch template patterns. Since the generated folder is added to prettierignore/eslint-ignore as noted in the PR, the unused mapValues import flagged by static analysis is expected and acceptable.

refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts (1)

1-87: Auto-generated paged model with correct serialization logic.

The interface and JSON (de)serialization helpers correctly handle the nested content array and page metadata using the appropriate helper functions. The unused imports (mapValues, *FromJSONTyped, *ToJSONTyped) are a known artifact of the OpenAPI Generator template and have already been flagged in past review comments.

refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts (1)

1-88: LGTM!

Standard auto-generated pagination metadata model with correct interface definition and JSON serialization helpers. The unused mapValues import is a known OpenAPI Generator artifact already flagged in past review comments.

refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts (1)

1-87: Auto-generated paged model structure is correct.

This file mirrors the refarch-webcomponent counterpart with identical structure. The interface and serialization helpers correctly map nested content and page fields. All unused import warnings from static analysis have already been flagged in past review comments (multiple times).

refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts (1)

22-29: Unused imports are a known generator artifact.

The static analysis correctly identifies that PagedModelTheEntityResponseDTOToJSON, TheEntityRequestDTOFromJSON, and TheEntityResponseDTOToJSON are unused. This is expected behavior from OpenAPI Generator—it imports both serialization directions for each model even when only one is needed (FromJSON for response parsing, ToJSON for request serialization).

Since these are generated files that should not be manually edited, this is acceptable. If cleaner output is desired, consider customizing the generator templates or exploring generator options that support tree-shaking.

refarch-frontend/src/api/refarch-backend/models/TheEntityRequestDTO.ts (1)

15-15: Unused mapValues import is a generator artifact.

This import is included by the OpenAPI Generator template but isn't used for this simple DTO. Since this is generated code that shouldn't be manually edited, this is acceptable.

refarch-webcomponent/src/api/refarch-backend/apis/TheEntityControllerApi.ts (1)

1-29: Webcomponent API client mirrors frontend version.

This is the expected duplicate of the generated API client for the webcomponent module. The same observations apply: standard OpenAPI Generator output with the known unused imports artifact already flagged by static analysis.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee3bb1c and 658c25c.

⛔ Files ignored due to path filters (2)
  • refarch-frontend/package-lock.json is excluded by !**/package-lock.json
  • refarch-webcomponent/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (37)
  • refarch-frontend/.prettierignore
  • refarch-frontend/eslint.config.js
  • refarch-frontend/openapitools.json
  • refarch-frontend/package.json
  • refarch-frontend/src/api/refarch-backend/.openapi-generator-ignore
  • refarch-frontend/src/api/refarch-backend/.openapi-generator/FILES
  • refarch-frontend/src/api/refarch-backend/.openapi-generator/VERSION
  • refarch-frontend/src/api/refarch-backend/apis/ActuatorApi.ts
  • refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts
  • refarch-frontend/src/api/refarch-backend/apis/index.ts
  • refarch-frontend/src/api/refarch-backend/index.ts
  • refarch-frontend/src/api/refarch-backend/models/Link.ts
  • refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts
  • refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
  • refarch-frontend/src/api/refarch-backend/models/TheEntityRequestDTO.ts
  • refarch-frontend/src/api/refarch-backend/models/TheEntityResponseDTO.ts
  • refarch-frontend/src/api/refarch-backend/models/index.ts
  • refarch-frontend/src/api/refarch-backend/runtime.ts
  • refarch-webcomponent/.prettierignore
  • refarch-webcomponent/eslint.config.js
  • refarch-webcomponent/openapitools.json
  • refarch-webcomponent/package.json
  • refarch-webcomponent/src/api/refarch-backend/.openapi-generator-ignore
  • refarch-webcomponent/src/api/refarch-backend/.openapi-generator/FILES
  • refarch-webcomponent/src/api/refarch-backend/.openapi-generator/VERSION
  • refarch-webcomponent/src/api/refarch-backend/apis/ActuatorApi.ts
  • refarch-webcomponent/src/api/refarch-backend/apis/TheEntityControllerApi.ts
  • refarch-webcomponent/src/api/refarch-backend/apis/index.ts
  • refarch-webcomponent/src/api/refarch-backend/index.ts
  • refarch-webcomponent/src/api/refarch-backend/models/Link.ts
  • refarch-webcomponent/src/api/refarch-backend/models/PageMetadata.ts
  • refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts
  • refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts
  • refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts
  • refarch-webcomponent/src/api/refarch-backend/models/index.ts
  • refarch-webcomponent/src/api/refarch-backend/runtime.ts
  • stack/openapitools.json
🧰 Additional context used
🧬 Code graph analysis (9)
refarch-webcomponent/src/api/refarch-backend/models/PageMetadata.ts (1)
refarch-webcomponent/src/api/refarch-backend/runtime.ts (4)
  • value (405-407)
  • value (413-415)
  • value (421-423)
  • value (429-431)
refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts (3)
refarch-frontend/src/api/refarch-backend/models/TheEntityResponseDTO.ts (3)
  • TheEntityResponseDTO (21-34)
  • TheEntityResponseDTOFromJSON (43-45)
  • TheEntityResponseDTOToJSON (58-60)
refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts (3)
  • PageMetadata (21-46)
  • PageMetadataFromJSON (55-57)
  • PageMetadataToJSON (72-74)
refarch-frontend/src/api/refarch-backend/runtime.ts (4)
  • value (405-407)
  • value (413-415)
  • value (421-423)
  • value (429-431)
refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts (3)
refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts (3)
  • TheEntityResponseDTO (21-34)
  • TheEntityResponseDTOFromJSON (43-45)
  • TheEntityResponseDTOToJSON (58-60)
refarch-webcomponent/src/api/refarch-backend/models/PageMetadata.ts (3)
  • PageMetadata (21-46)
  • PageMetadataFromJSON (55-57)
  • PageMetadataToJSON (72-74)
refarch-webcomponent/src/api/refarch-backend/runtime.ts (4)
  • value (405-407)
  • value (413-415)
  • value (421-423)
  • value (429-431)
refarch-webcomponent/src/api/refarch-backend/models/Link.ts (1)
refarch-webcomponent/src/api/refarch-backend/runtime.ts (4)
  • value (405-407)
  • value (413-415)
  • value (421-423)
  • value (429-431)
refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts (1)
refarch-webcomponent/src/api/refarch-backend/runtime.ts (4)
  • value (405-407)
  • value (413-415)
  • value (421-423)
  • value (429-431)
refarch-webcomponent/src/api/refarch-backend/apis/TheEntityControllerApi.ts (4)
refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts (2)
  • TheEntityRequestDTO (21-28)
  • TheEntityRequestDTOToJSON (52-54)
refarch-webcomponent/src/api/refarch-backend/runtime.ts (3)
  • InitOverrideFunction (298-298)
  • ApiResponse (393-396)
  • HTTPHeaders (292-292)
refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts (2)
  • PagedModelTheEntityResponseDTO (36-49)
  • PagedModelTheEntityResponseDTOFromJSON (58-60)
refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts (2)
  • TheEntityResponseDTO (21-34)
  • TheEntityResponseDTOFromJSON (43-45)
refarch-webcomponent/src/api/refarch-backend/apis/ActuatorApi.ts (2)
refarch-webcomponent/src/api/refarch-backend/runtime.ts (3)
  • InitOverrideFunction (298-298)
  • ApiResponse (393-396)
  • HTTPHeaders (292-292)
refarch-webcomponent/src/api/refarch-backend/models/Link.ts (1)
  • Link (21-34)
refarch-frontend/src/api/refarch-backend/models/TheEntityRequestDTO.ts (1)
refarch-frontend/src/api/refarch-backend/runtime.ts (4)
  • value (405-407)
  • value (413-415)
  • value (421-423)
  • value (429-431)
refarch-frontend/src/api/refarch-backend/models/Link.ts (1)
refarch-frontend/src/api/refarch-backend/runtime.ts (4)
  • value (405-407)
  • value (413-415)
  • value (421-423)
  • value (429-431)
🪛 Biome (2.1.2)
refarch-webcomponent/src/api/refarch-backend/runtime.ts

[error] 245-245: Do not shadow the global "constructor" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

refarch-frontend/src/api/refarch-backend/runtime.ts

[error] 245-245: Do not shadow the global "constructor" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

🪛 GitHub Check: CodeQL
refarch-frontend/src/api/refarch-backend/models/PageMetadata.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.

refarch-webcomponent/src/api/refarch-backend/models/PageMetadata.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.

refarch-frontend/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.


[notice] 17-22: Unused variable, import, function or class
Unused imports PageMetadataFromJSONTyped, PageMetadataToJSONTyped.


[notice] 24-29: Unused variable, import, function or class
Unused imports TheEntityResponseDTOFromJSONTyped, TheEntityResponseDTOToJSONTyped.

refarch-webcomponent/src/api/refarch-backend/models/PagedModelTheEntityResponseDTO.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.


[notice] 17-22: Unused variable, import, function or class
Unused imports PageMetadataFromJSONTyped, PageMetadataToJSONTyped.


[notice] 24-29: Unused variable, import, function or class
Unused imports TheEntityResponseDTOFromJSONTyped, TheEntityResponseDTOToJSONTyped.

refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.

refarch-webcomponent/src/api/refarch-backend/models/Link.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.

refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts

[notice] 22-29: Unused variable, import, function or class
Unused imports PagedModelTheEntityResponseDTOToJSON, TheEntityRequestDTOFromJSON, TheEntityResponseDTOToJSON.

refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.

refarch-frontend/src/api/refarch-backend/models/TheEntityResponseDTO.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.

refarch-webcomponent/src/api/refarch-backend/apis/TheEntityControllerApi.ts

[notice] 22-29: Unused variable, import, function or class
Unused imports PagedModelTheEntityResponseDTOToJSON, TheEntityRequestDTOFromJSON, TheEntityResponseDTOToJSON.

refarch-webcomponent/src/api/refarch-backend/apis/ActuatorApi.ts

[notice] 20-23: Unused variable, import, function or class
Unused imports LinkFromJSON, LinkToJSON.

refarch-frontend/src/api/refarch-backend/apis/ActuatorApi.ts

[notice] 20-23: Unused variable, import, function or class
Unused imports LinkFromJSON, LinkToJSON.

refarch-frontend/src/api/refarch-backend/models/TheEntityRequestDTO.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.

refarch-frontend/src/api/refarch-backend/models/Link.ts

[notice] 15-15: Unused variable, import, function or class
Unused import mapValues.

🔇 Additional comments (38)
refarch-webcomponent/.prettierignore (1)

3-6: LGTM!

The ignore pattern src/api/*/ correctly excludes generated API client folders from Prettier formatting. The comment clarifies the intent, which aids maintainability.

refarch-webcomponent/eslint.config.js (1)

32-32: LGTM!

The glob pattern src/api/*/** correctly excludes all generated API client files from ESLint. The syntax appropriately differs from the .prettierignore pattern (src/api/*/) since ESLint uses glob patterns while prettierignore uses gitignore syntax—both achieve the intended exclusion.

refarch-frontend/eslint.config.js (1)

46-46: LGTM!

The glob pattern correctly excludes generated OpenAPI client code from linting. Ignoring auto-generated code is appropriate since it may not conform to project-specific ESLint rules and shouldn't be manually modified.

refarch-frontend/package.json (1)

16-17: LGTM! The API generation script is correctly configured.

The api-gen script properly delegates to the OpenAPI Generator CLI, which will read configuration from the openapitools.json file.

refarch-frontend/.prettierignore (1)

2-5: LGTM! Generated API folders are correctly excluded from Prettier.

The pattern src/api/*/ appropriately excludes generated OpenAPI client code from formatting checks.

Minor note: node_modules is ignored by Prettier by default, so explicitly listing it is redundant but harmless.

refarch-frontend/src/api/refarch-backend/.openapi-generator/VERSION (1)

1-1: Standard generated metadata file.

This VERSION file is automatically created by OpenAPI Generator to track which version was used for code generation. It's correctly committed to ensure reproducibility.

refarch-webcomponent/src/api/refarch-backend/.openapi-generator-ignore (1)

1-23: Standard OpenAPI Generator ignore template.

This is the default .openapi-generator-ignore template that allows developers to exclude specific files from being overwritten during regeneration. No active ignore rules are present, which is appropriate for initial setup.

refarch-webcomponent/package.json (2)

17-18: LGTM! Consistent with refarch-frontend configuration.

The api-gen script is correctly configured and mirrors the setup in refarch-frontend, ensuring a consistent developer experience across both projects.


39-39: Dependency version is consistent across packages.

Good practice to use the same @openapitools/openapi-generator-cli version (2.27.0) in both refarch-frontend and refarch-webcomponent to ensure consistent code generation output.

refarch-webcomponent/src/api/refarch-backend/.openapi-generator/VERSION (1)

1-1: LGTM!

Auto-generated version marker file. Version 7.13.0 is consistent with the configuration in openapitools.json.

refarch-frontend/src/api/refarch-backend/.openapi-generator-ignore (1)

1-23: LGTM!

Standard OpenAPI Generator ignore file template. All patterns are commented out, meaning all generated files will be regenerated on each run. This is appropriate for the initial setup.

refarch-frontend/src/api/refarch-backend/.openapi-generator/FILES (1)

1-12: LGTM!

Auto-generated manifest file listing all generated artifacts. The file structure follows the standard typescript-fetch generator output with proper barrel files for APIs and models.

refarch-frontend/src/api/refarch-backend/models/Link.ts (1)

1-72: Generated model file looks correct.

The Link interface and its JSON serialization helpers follow the standard OpenAPI Generator typescript-fetch template. The null/undefined guards in LinkFromJSONTyped and LinkToJSONTyped are appropriate for handling optional fields.

refarch-webcomponent/openapitools.json (1)

1-19: Configuration is correct for OpenAPI Generator CLI.

The setup appropriately uses typescript-fetch generator with ES6 support and TypeScript 3+ compatibility. The glob pattern expects the OpenAPI spec to be generated by the backend build process in ../refarch-backend/target/*.yaml. Version 7.13.0 is a stable release; if you want to stay more current, v7.18.0 is available as the latest version.

refarch-webcomponent/src/api/refarch-backend/models/Link.ts (1)

21-72: Auto-generated model implementation looks correct.

The Link interface and its serialization helpers follow standard OpenAPI Generator patterns. The instanceOfLink type guard correctly returns true since all properties are optional.

refarch-webcomponent/src/api/refarch-backend/models/TheEntityRequestDTO.ts (1)

21-65: Auto-generated DTO implementation looks correct.

The TheEntityRequestDTO interface correctly marks textAttribute as required, and the type guard at lines 33-36 properly validates its presence. Serialization helpers are implemented correctly.

refarch-webcomponent/src/api/refarch-backend/.openapi-generator/FILES (1)

1-12: OpenAPI Generator manifest file.

Standard tracking file listing all generated artifacts. This helps with regeneration and understanding the generated structure.

refarch-webcomponent/src/api/refarch-backend/runtime.ts (2)

16-16: Hardcoded localhost BASE_PATH in generated code.

The default BASE_PATH points to a development server. This is acceptable since the Configuration class allows runtime override via basePath parameter. Ensure consumers configure the appropriate base URL for their environment.


31-432: Runtime infrastructure implementation is well-structured.

The generated runtime provides a solid foundation:

  • Configurable middleware pipeline (pre/post/onError hooks)
  • Proper error handling with typed error classes
  • Flexible request/response handling with JSON, Blob, Text support
  • Query string serialization with nested object support
refarch-webcomponent/src/api/refarch-backend/apis/ActuatorApi.ts (2)

37-210: ActuatorApi implementation is correct.

The generated client properly:

  • Validates required parameters (line 121-126 for sbom)
  • Encodes path parameters (line 133)
  • Handles optional query parameters (lines 182-188 for scrape)
  • Uses consistent async/raw pattern for all endpoints

215-220: Well-typed enum pattern.

The ScrapeFormatEnum uses the recommended TypeScript pattern of combining a const object with a derived type, providing both runtime values and type safety.

refarch-frontend/src/api/refarch-backend/apis/ActuatorApi.ts (1)

37-210: Auto-generated API client looks correctly structured.

The ActuatorApi class properly implements the actuator endpoints with appropriate parameter validation (e.g., required id check in sbomRaw), query parameter handling, and the standard raw/wrapped method pattern.

refarch-frontend/src/api/refarch-backend/runtime.ts (3)

244-249: Constructor shadowing in auto-generated code.

Biome flags that constructor shadows the global property. This is a standard pattern in the OpenAPI Generator's typescript-fetch template used for cloning API instances. Since this file is auto-generated and linting is disabled, this is acceptable. The variable name is contextually appropriate within the clone() method.


92-250: Well-structured runtime with middleware support.

The BaseAPI class provides a robust request pipeline with pre/post middleware hooks, proper error handling through ResponseError and FetchError, and immutable cloning for middleware composition. This is standard OpenAPI Generator output and correctly implements the API client foundation.


16-16: The Configuration class already provides a mechanism to override basePath, so consumers can configure the backend URL for their environment.

While the hardcoded localhost:39146 is intentional for local development (the port is defined in application-local.yml), the design pattern properly supports overriding it via ConfigurationParameters.basePath for production deployments.

No action needed; the auto-generated code is working as intended.

Likely an incorrect or invalid review comment.

refarch-webcomponent/src/api/refarch-backend/models/TheEntityResponseDTO.ts (1)

21-72: DTO model correctly implements serialization pattern.

The TheEntityResponseDTO interface and its JSON serialization helpers follow the standard OpenAPI Generator pattern. The null-safe deserialization (lines 48-55) and serialization (lines 63-71) are correctly implemented.

refarch-webcomponent/src/api/refarch-backend/apis/index.ts (1)

1-4: Standard barrel file for API exports.

This index file correctly consolidates the API client exports for the webcomponent module.

refarch-frontend/src/api/refarch-backend/apis/index.ts (1)

1-4: Standard barrel file for API exports.

This index file correctly consolidates the API client exports for the frontend module.

refarch-frontend/src/api/refarch-backend/index.ts (1)

1-5: LGTM!

Standard auto-generated barrel file that correctly re-exports runtime utilities, API clients, and models. The lint disables are appropriate for generated code.

refarch-frontend/src/api/refarch-backend/models/index.ts (1)

1-7: LGTM!

Standard auto-generated models barrel file that correctly re-exports all DTO models.

refarch-webcomponent/src/api/refarch-backend/index.ts (1)

1-5: LGTM!

Standard auto-generated barrel file, consistent with the frontend counterpart.

refarch-webcomponent/src/api/refarch-backend/models/PageMetadata.ts (1)

1-88: Auto-generated model file looks correct.

The PageMetadata interface and serialization helpers follow the standard OpenAPI Generator typescript-fetch output pattern. The lint disables at the top are appropriate for generated code.

refarch-webcomponent/src/api/refarch-backend/models/index.ts (1)

1-7: LGTM!

Standard auto-generated barrel file correctly re-exporting all model types from the OpenAPI-generated models directory.

refarch-frontend/src/api/refarch-backend/apis/TheEntityControllerApi.ts (2)

1-13: Auto-generated OpenAPI client code looks correct.

This is standard output from OpenAPI Generator's typescript-fetch template. The file is appropriately marked with lint disabling directives and the "Do not edit" warning, which aligns with the PR's approach of adding generated files to prettierignore and eslint-ignore lists.


56-246: API implementation follows correct patterns.

The class implementation is well-structured:

  • Proper parameter validation with RequiredError for required fields
  • Correct URL path parameter encoding using encodeURIComponent
  • Appropriate HTTP methods (GET, POST, PUT, DELETE) for each operation
  • Correct use of JSON serializers for request bodies and response parsing
  • Raw methods expose ApiResponse<T> for advanced use cases while convenience methods return typed results directly
refarch-frontend/src/api/refarch-backend/models/TheEntityRequestDTO.ts (2)

1-28: Generated DTO model looks correct.

The interface definition and type guard implementation are appropriate for the simple DTO structure with a single textAttribute property.


38-65: JSON serialization helpers are correctly implemented.

The FromJSON/ToJSON functions properly handle null checks and map the textAttribute field. The typed variants support the discriminator pattern used by OpenAPI Generator for polymorphic models, even though this simple DTO doesn't require it.

refarch-webcomponent/src/api/refarch-backend/apis/TheEntityControllerApi.ts (1)

56-246: API implementation is correct and consistent with frontend version.

The class properly implements CRUD operations with appropriate parameter validation, path encoding, and JSON serialization. The implementation is identical to the frontend version, which is expected for generated code from the same OpenAPI spec.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +244 to +249
private clone<T extends BaseAPI>(this: T): T {
const constructor = this.constructor as any;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Variable constructor shadows global name (Biome warning).

This is a standard OpenAPI Generator pattern for cloning API instances. While Biome flags it, the shadowing is intentional and localized to this method. Since this is generated code, the fix would require customizing the generator template.

private clone<T extends BaseAPI>(this: T): T {
    const constructor = this.constructor as any;  // shadows global
    const next = new constructor(this.configuration);
    next.middleware = this.middleware.slice();
    return next;
}

If this warning is bothersome, you could add runtime.ts to Biome's ignore list or customize the OpenAPI Generator template to use a different variable name (e.g., ctor).

🧰 Tools
🪛 Biome (2.1.2)

[error] 245-245: Do not shadow the global "constructor" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

🤖 Prompt for AI Agents
In `@refarch-webcomponent/src/api/refarch-backend/runtime.ts` around lines 244 -
249, The method clone<T extends BaseAPI>(this: T) defines a local variable named
constructor which shadows the global name; rename that local variable (e.g., to
ctor or apiCtor) and update its usages inside the method (in the line that
instantiates new constructor(this.configuration)) to eliminate the shadowing, or
if you prefer not to change generated code, add runtime.ts to the Biome ignore
list or adjust the OpenAPI Generator template to emit a different variable name.

Comment on lines 4 to 6
"generator-cli": {
"version": "7.9.0"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find all openapitools.json files and show their content with path
fd -type f -name "openapitools.json" -exec sh -c 'echo "=== File: {} ==="; cat "{}"; echo' \;

Repository: it-at-m/refarch-templates

Length of output: 239


🏁 Script executed:

# Find all openapitools.json files and show their content
fd --type f --name "openapitools.json" --exec sh -c 'echo "=== File: {} ==="; cat "{}"; echo' \;

Repository: it-at-m/refarch-templates

Length of output: 319


🏁 Script executed:

# Find all openapitools.json files and display their contents
fd "openapitools.json" --exec sh -c 'echo "=== File: {} ==="; cat "{}"; echo' \;

Repository: it-at-m/refarch-templates

Length of output: 1400


Align OpenAPI Generator CLI versions across stack and repository configurations.

The stack-level configuration uses generator-cli version 7.9.0, while both refarch-frontend and refarch-webcomponent use 7.13.0. Different generator versions produce different code structures and type definitions, creating inconsistencies in generated APIs across the codebase.

Update stack/openapitools.json to use version 7.13.0 to match the repository-level configurations.

🤖 Prompt for AI Agents
In `@stack/openapitools.json` around lines 4 - 6, Update the stack-level OpenAPI
Generator CLI version to match the repo: in stack/openapitools.json change the
"generator-cli" -> "version" value from "7.9.0" to "7.13.0" so it aligns with
refarch-frontend and refarch-webcomponent and ensures consistent generated code
and types across the codebase.

node_modules

# Ignore generated api-folders only
src/api/*/
Copy link
Member

Choose a reason for hiding this comment

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

There might be cases where we have custom hand written code in src/api so I suggest to change it to something like src/api/generated

Copy link
Contributor Author

@langehm langehm Jan 22, 2026

Choose a reason for hiding this comment

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

custom hand written is inside of /api as seperate files. Those are getting ignored.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah but what if you add custom subfolders in the API folder?
@simonhir @DanielOber What do you think about this?

Copy link
Contributor Author

@langehm langehm Jan 22, 2026

Choose a reason for hiding this comment

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

My thought on this: We implemented code geneation for apis - used it.

Smaller api or api-request can still be written in separated files, larger apis should be generated from a specification.

Copy link
Contributor

Choose a reason for hiding this comment

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

For me personally, i would keep my generated APIs inside a generated folder. So i would prefer to ignore everything inside src/api/generated like Tobi said.

},
},
globalIgnores(["dist", "target", "node_modules", "env.d.ts"])
globalIgnores(["dist", "target", "node_modules", "env.d.ts", "src/api/*/**"])
Copy link
Member

Choose a reason for hiding this comment

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

See previous comment

"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.13.0",
Copy link
Member

Choose a reason for hiding this comment

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

Where is this version coming from? Is it up to date?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Long time ago yes - newest is 7.19.0

Copy link
Member

Choose a reason for hiding this comment

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

Why not update to the latest version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did - it is on 7.19.0. Generated code got updated too. See here

},
},
globalIgnores(["dist", "target", "node_modules", "env.d.ts"])
globalIgnores(["dist", "target", "node_modules", "env.d.ts", "src/api/*/**"])
Copy link
Member

Choose a reason for hiding this comment

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

See frontend template

@@ -0,0 +1,19 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

See frontend template

@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
Copy link
Member

Choose a reason for hiding this comment

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

See frontend template

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@refarch-frontend/package.json`:
- Line 35: The package.json dependency "@openapitools/openapi-generator-cli" is
pinned to 2.27.0 but should be updated to 2.28.0; open package.json, locate the
dependency entry for "@openapitools/openapi-generator-cli" and change its
version string from "2.27.0" to "2.28.0", then run your package manager's
install (npm/yarn/pnpm) to update lockfiles and verify build/scripts still work.

In `@refarch-webcomponent/package.json`:
- Around line 17-18: The api-gen npm script ("api-gen") relies on
openapi-generator-cli auto-discovering openapitools.json; add an explicit config
path to be defensive by appending --config ./openapitools.json to the "api-gen"
script in package.json so the CLI always uses the intended configuration
(reference: the "api-gen" script and openapitools.json).

"@intlify/unplugin-vue-i18n": "11.0.3",
"@mdi/js": "7.4.47",
"@muenchen/prettier-codeformat": "1.0.2",
"@openapitools/openapi-generator-cli": "2.27.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the latest version of `@openapitools/openapi-generator-cli`
echo "Checking latest version from npm registry..."
curl -s https://registry.npmjs.org/@openapitools/openapi-generator-cli | jq -r '.["dist-tags"].latest'

echo -e "\nRecent versions:"
curl -s https://registry.npmjs.org/@openapitools/openapi-generator-cli | jq -r '.versions | keys | reverse | .[0:5][]'

Repository: it-at-m/refarch-templates

Length of output: 168


🏁 Script executed:

# Verify alphabetical ordering in package.json around line 35
cd refarch-frontend 2>/dev/null || cd . 
if [ -f package.json ]; then
  echo "Dependencies around `@openapitools/openapi-generator-cli`:"
  cat -n package.json | sed -n '30,40p'
else
  echo "package.json not found in refarch-frontend"
fi

Repository: it-at-m/refarch-templates

Length of output: 652


Update @openapitools/openapi-generator-cli to version 2.28.0.

Alphabetical ordering is correct, but the package version is outdated. The latest available version is 2.28.0; update from 2.27.0.

🤖 Prompt for AI Agents
In `@refarch-frontend/package.json` at line 35, The package.json dependency
"@openapitools/openapi-generator-cli" is pinned to 2.27.0 but should be updated
to 2.28.0; open package.json, locate the dependency entry for
"@openapitools/openapi-generator-cli" and change its version string from
"2.27.0" to "2.28.0", then run your package manager's install (npm/yarn/pnpm) to
update lockfiles and verify build/scripts still work.

Comment on lines +17 to +18
"fix": "prettier . --write && eslint . --fix --concurrency auto",
"api-gen": "openapi-generator-cli generate"
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🏁 Script executed:

fd -a -t f '^openapitools\.json$'

Repository: it-at-m/refarch-templates

Length of output: 180


🏁 Script executed:

# Check root package.json for workspace configuration
cat package.json 2>/dev/null | head -30

# Check if refarch-webcomponent openapitools.json has generatorVersion pinned
cat /home/jailuser/git/refarch-webcomponent/openapitools.json

Repository: it-at-m/refarch-templates

Length of output: 544


🏁 Script executed:

# Read root package.json
head -50 /home/jailuser/git/package.json

Repository: it-at-m/refarch-templates

Length of output: 159


🏁 Script executed:

# Find all package.json files in the repository
find . -maxdepth 3 -name "package.json" -type f

# Check if root has workspaces defined
git ls-files | grep -E "^package\.json$"

Repository: it-at-m/refarch-templates

Length of output: 156


🏁 Script executed:

# Look for CI/CD configuration files
find . -maxdepth 2 \( -name ".github" -o -name ".gitlab-ci.yml" -o -name "Makefile" -o -name "tox.ini" \) -type d -o -type f

# Check if there are any script references in CI files
fd -e yml -e yaml -e json | head -20

Repository: it-at-m/refarch-templates

Length of output: 3294


🏁 Script executed:

# Find and examine GitHub workflow files
find .github/workflows -name "*.yml" -o -name "*.yaml" 2>/dev/null

# Look for any references to "api-gen" in workflows
rg "api-gen" .github/ 2>/dev/null

# Check if npm scripts are run with specific working directories
rg "npm.*run|working-directory" .github/ -A 2 2>/dev/null

Repository: it-at-m/refarch-templates

Length of output: 649


🏁 Script executed:

# Examine the npm-release.yml workflow
cat .github/workflows/npm-release.yml

Repository: it-at-m/refarch-templates

Length of output: 3080


🏁 Script executed:

# Read full refarch-webcomponent/package.json
cat refarch-webcomponent/package.json

Repository: it-at-m/refarch-templates

Length of output: 1551


Adding explicit config path to api-gen is optional. The openapitools.json is correctly placed in the same directory as package.json, and since this is not a monorepo setup, the CLI will find it by default when the script runs. An explicit --config ./openapitools.json parameter would be a minor defensive improvement for clarity, but it's not necessary to ensure correct behavior in the current structure.

🤖 Prompt for AI Agents
In `@refarch-webcomponent/package.json` around lines 17 - 18, The api-gen npm
script ("api-gen") relies on openapi-generator-cli auto-discovering
openapitools.json; add an explicit config path to be defensive by appending
--config ./openapitools.json to the "api-gen" script in package.json so the CLI
always uses the intended configuration (reference: the "api-gen" script and
openapitools.json).

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

Labels

Template: Frontend Issues regarding the frontend template. Template: Webcomponent Issues regarding the webcomponent template. Type: Feature The issue is an feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Client OpenApi generation

4 participants