Open
Conversation
Brings the standalone generator in sync with the battle-tested version from ls1intum/tum-apply. Key fixes: 1. Path template generation: use original OpenAPI paths instead of regex-parsing the parent's encodeParam format 2. Include GET methods in API service classes alongside mutations 3. Model-to-model imports: add ./ relative path prefix 4. API-to-model imports: use tsImports with correct model filenames 5. Array-of-enum types: wrap in Array<> when property is an array 6. Void return types: add explicit <void> type parameter to HttpClient 7. Duplicate HttpHeaders import: use static import instead of per-op 8. Const enum objects: generate runtime const objects for enum types 9. Blob response handling: use responseType/observe for file downloads 10. Array query params: use URLSearchParams.append() instead of join 11. Inline model filenames: convert underscores to hyphens in toKebabCase 12. Model output folder: use 'model/' instead of 'models/' Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace <h3> with <p><b> in class-level javadoc to satisfy strict heading sequence checks, and add missing javadoc comments to all public/protected fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Development: Improve openapi generated code
When useHttpResource=true, GET operations are excluded from service files and only appear in resource files. GET-only tags skip service file generation entirely. Add generator-config.yaml with documented options for all CLI properties. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix bug where useHttpResource=true skipped *-api.ts for GET-only tags even when separateResources=false, causing GET clients to vanish - Add x-inline-resource vendor extension for rendering httpResource functions inline in *-api.ts when separateResources=false - Add hasServiceClass/hasInlineResources flags for conditional template rendering (no empty classes for GET-only tags) - Update config comments to document all useHttpResource/separateResources combinations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Service class now always includes GET methods as Observables,
regardless of useHttpResource/separateResources config
- httpResource functions are generated alongside (not instead of)
Observable methods — existing consumer code never breaks
- Fix required query params typed as {} in httpResource functions
- Remove api file suppression for GET-only tags
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #4
Changes
encodeParam(broke with openapi-generator 7.18.0+)./relative path prefixtsImportswith correct kebab-case model filenamesArray<>when property is an array<void>type parameter on HttpClient callsconstobjects for enum types (TypeScript type/value pattern)responseType: 'blob'+observe: 'response'for file downloadsURLSearchParams.append()instead ofjoin(',')for correct wire formattoKebabCase()model/instead ofmodels/generator-config.yamlwith documented options for all CLI propertiesuseHttpResource=true+separateResources=falserenders httpResource GET functions inline in*-api.tsalongside Observable class methods (one file per tag)params: Signal<T>instead ofparams?: Signal<T>with?? {}fallback that lost type infoArchitecture
Observable service classes are always generated with all HTTP methods. httpResource functions are generated alongside (not instead of) Observable methods when
useHttpResource=true. This means:.subscribe()/firstValueFrom()never breakshttpResourcefunctions for reactive patternsConfiguration matrix
useHttpResourceseparateResourcesfalsefalsetruefalsetruetrue*-api.ts) + httpResource functions (*-resources.ts)falsetruefalse/false(no resource files to generate)Files changed
Angular21Generator.javaapi-service.mustacheapi-resource.mustachemodel.mustachegenerator-config.yamlTest plan
./gradlew build./relative paths../model/with correct filenamesresponseType: 'blob'useHttpResource=true, separateResources=true: Observable class in*-api.tshas all methods,*-resources.tshas httpResource GETsuseHttpResource=true, separateResources=false: Single file with Observable class + inline httpResource functionsuseHttpResource=false: Observable class only, no httpResource functionsparams: Signal<T>🤖 Generated with Claude Code