Skip to content

Backport generator fixes from tum-apply #4

@az108

Description

@az108

Description

The standalone openapi-generator-angular21 repo has small issues which are fixed the version used in ls1intum/tum-apply, which has accumulated 11 bug fixes and improvements during integration. These need to be backported to keep the standalone generator usable by other projects.

Fixes to backport

  1. Path template generation — Rewrote buildPathTemplate to use original OpenAPI paths instead of regex-parsing the parent's encodeParam format, which broke with openapi-generator 7.18.0+
  2. GET methods in service classes — Removed the x-is-get filter so services include all HTTP methods, not just mutations
  3. Model-to-model imports — Added ./ relative path prefix in model.mustache
  4. API-to-model imports — Switched to tsImports with correct model filenames instead of imports which resolved to the API tag name
  5. Array-of-enum types — Wrapped enum types in Array<> when the property is an array
  6. Void return types — Added explicit <void> type parameter to HttpClient calls
  7. Duplicate HttpHeaders import — Replaced per-operation conditional import with static import
  8. Const enum objects — Generate runtime const objects alongside string union types for enum access
  9. Blob response handling — Added responseType: 'blob' and observe: 'response' for file download endpoints
  10. Array query params — Use URLSearchParams.append() instead of join(',') for correct wire format
  11. Inline model filenames — Convert underscores to hyphens in toKebabCase() for consistent filenames
  12. Model output folder — Use model/ instead of models/ for output directory

Acceptance Criteria

  • All 4 source files match the tum-apply versions
  • Generator compiles and produces correct output against a sample OpenAPI spec

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions