feat: classical HttpClient GET methods + generation fixes (1.1.0)#7
Merged
Merged
Conversation
Make the classical (non-httpResource) mode usable and fix several code-generation
bugs surfaced when adopting the generator in Artemis:
- useHttpResource=false now emits classical Observable HttpClient.get() methods in
the API service. Previously GET operations were always excluded from the service
({{^x-is-get}}) and only emitted via the httpResource template, so disabling
httpResource silently dropped every GET endpoint. GET-only tags now also keep
their -api.ts file in classical mode.
- Model-to-model imports are now relative ('./other-model' instead of bare
'other-model'), which did not resolve.
- Operations always emit an explicit response type parameter, so void endpoints
return Observable<void> instead of Observable<Object>.
- POST/PUT/PATCH always pass a body argument (HttpClient requires it; a missing
body produced a TS "expected 2-3 arguments" error).
- Non-numeric path parameters are interpolated (\${param}) instead of being
emitted as the literal text {param}, and numeric params no longer get a doubled $.
- Array-of-enum model properties are wrapped in Array<...> instead of a single enum.
- Build against openapi-generator 7.21.0 (aligned with the org.openapi.generator
Gradle plugin used downstream).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
krusche
added a commit
to ls1intum/Artemis
that referenced
this pull request
Jun 30, 2026
…cation Bump to de.tum.cit.aet:openapi-generator-angular21:1.1.0 — the upstreamed version with the classical-GET support and generation fixes (ls1intum/openapi-generator-angular22#7) — and resolve it (for the openApiGenerate task only) from Maven Local (build-from-source) or GitHub Packages (with a read:packages token, provided automatically in CI). This lets anyone regenerate the client, not just from a local-only publish. The generated client stays committed, so CI never runs openApiGenerate and never resolves the generator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace GitHub Packages publishing (which requires authentication even to *download*, so it is poor for general consumption) with the Sonatype Central Portal via the com.vanniktech.maven.publish plugin. Consumers now resolve the generator from a plain mavenCentral() repository with no auth. - Sign all publications with GPG, gated on a key being present so that `publishToMavenLocal` (build-from-source) still works without a key. - Update the release workflow to upload to the Central Portal on a v* tag. - Add RELEASING.md documenting the one-time namespace/token/signing-key setup and the tag-based release procedure. - Bump README install/version references to 1.1.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GET operations returning text or binary payloads were generated as
http.get<string>(url) / http.get<Blob>(url) with no responseType, so Angular's
HttpClient defaulted to responseType 'json' and threw while JSON-parsing iCalendar
files, CSV exports, and plain-text tokens.
Compute an x-response-type vendor extension: 'blob' for Blob returns, 'text' for
string returns whose produced media types are all text/* (JSON-string endpoints,
which produce application/json, keep the default parser). The template then emits
http.get(url, { responseType: 'text' | 'blob' }), whose overloads already return
Observable<string> / Observable<Blob>, so the declared return type is preserved.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
10 tasks
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
Makes the classical (non-
httpResource) generation mode usable and fixes several code-generation bugs discovered while adopting this generator for the Artemis OpenAPI client. Switches publishing to Maven Central and bumps the version to 1.1.0.Changes
HttpClient.get()GET methods (useHttpResource=false): GET operations are now emitted as classicalObservablemethods in the API service. Previously every operation inapi-service.mustachewas wrapped in{{^vendorExtensions.x-is-get}}, so GETs were only ever produced via thehttpResourceresource template — disablinguseHttpResourcesilently dropped all GET endpoints. GET-only tags now also keep their-api.tsfile in classical mode.'./other-model'instead of the bare'other-model', which did not resolve.Observable<void>: operations always emit an explicit response type parameter, so void endpoints returnObservable<void>instead ofObservable<Object>.HttpClientrequires it; a missing body produced a TS "Expected 2–3 arguments" error).${param}instead of the literal text{param}; numeric params no longer get a doubled$.Array<…>instead of a single enum type.org.openapi.generatorGradle plugin version used downstream in Artemis).com.vanniktech.maven.publishplugin, so consumers resolve the generator from a plainmavenCentral()with no auth. Artifacts are GPG-signed, gated on a key being present sopublishToMavenLocalstill works key-free. AddsRELEASING.md.Context
These fixes are required for the Artemis client to compile and run after switching its OpenAPI client to this generator (Artemis PR ls1intum/Artemis#13038). Configured there with
useHttpResource=false, useInjectFunction=true, separateResources=false, readonlyModels=false.Releasing 1.1.0 (maintainers)
Publishing now targets Maven Central (auth-free for consumers). One-time setup — see
RELEASING.md:de.tum.cit.aetnamespace on central.sonatype.com (verifytum.devia a DNS TXT record).MAVEN_CENTRAL_USERNAME,MAVEN_CENTRAL_PASSWORD,SIGNING_KEY(ASCII-armored private key),SIGNING_PASSWORD.Then release by pushing a tag:
git tag v1.1.0 && git push origin v1.1.0— the workflow signs and uploads to the Central Portal and creates a GitHub Release.