Expose response ContentTypes in api-definition and use them in proxies#25639
Merged
Conversation
1 task
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #25639 +/- ##
==========================================
+ Coverage 49.36% 49.42% +0.06%
==========================================
Files 3687 3687
Lines 124432 124550 +118
Branches 9507 9534 +27
==========================================
+ Hits 61421 61557 +136
+ Misses 61171 61149 -22
- Partials 1840 1844 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…yloads in RestService
…lections to any[] in Angular schematic
…ngular client proxies
sumeyyeKurtulus
approved these changes
Jun 18, 2026
EngincanV
approved these changes
Jun 18, 2026
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.
Expose response
ContentTypesandIsRemoteStreamflag in api-definition so C# / jQuery / Angular proxies can echo back the actual declared media type instead of collapsing everything toapplication/json+text/plain. Also unwraps ABP error envelopes inRestServicefor text and blob response modes. The jQuery generator and Angular schematic now forward DTO uploads containingIRemoteStreamContentas multipartFormDatainstead of JSON.How to use
Server side — register the upload DTOs in
FormBodyBindingIgnoredTypes(same patternVolo.CmsKit/Volo.Blogging/ file management already follow, documented here):Application service:
Client side — jQuery:
Client side — Angular:
Client side — C# (dynamic + static proxy identical):
Generated proxy before / after
jQuery — before (what @martingagne reported in #8581: the
inputargument is silently dropped, no body):jQuery — after (FormData forwarded as multipart body):
Angular schematic — before (upload arg typed as the DTO;
input.nameaccess fails at runtime because the caller has to pass a real DTO with a stream property the proxy then ignores):Angular schematic — after (arg collapses to
FormData, body forwards it directly, query-string fields originating from the upload arg are dropped to keep the rendered code TS-safe):Test coverage
Framework C# unit (
Volo.Abp.Http.Client.Tests+Volo.Abp.Http.Tests):ClientProxyRequestPayloadBuildermultipart serialization: directIRemoteStreamContent, DTO with stream property, DTO withIEnumerable<>, nested DTO (Child.File), 3-level nested (Inner.Child.File), UTF-8 RFC 5987 filename, polymorphic / generic / record / inherited DTO,DateTime/ enum / nullable struct fields, mixed property + collection, Body binding wins over Form, null FormFile skip, Path + Form + FormFile mix, multiple actions on the same builder, stream pass-through (no implicit buffering)JQueryProxyScriptGenerator:application/json/+json/text/csv/application/pdf/ charset variants echo,IRemoteStreamContentskipsdataTypeoverride, multipart emitsdata + processData: false + contentType: false, custom subclass narrowed scope, multiple directFormFileknown limitationAngular schematic vitest (
@abp/ng.schematics):Accept/responseTyperesolution across json / text / blob /+json/ xml / custom MIME, 6 multipart DTO shapes,ModelBindingfield dropped from query params when sharing the upload arg, multiple directFormFilelimitationFormDatacollapse on upload arg,Patharg keeps primitive type, multiple directFormFileeach becomeFormDataindependently, non-upload action signature unchangedts.createProgramsemantic check (incl.FormDatasignature compilation), vm sandbox runtime forwarding theFormDataarg torestService.requestEnd-to-end against a local demo project (MVC + AppService + Angular):
IRemoteStreamContentshapes from Make generate-proxy support IRemoteStreamContent. #8581, plus PUT upload / PUT + Path /IFormFiledirect param / UTF-8 filename / 5 MB stream /api-version+ upload / cancellation /byte[]documented limitation / anti-forgery / multi-tenant / OpenIddict password-grant authorized uploadAbp/ServiceProxyScriptcontentClientDemoService45 cases × DYNAMIC + STATIC proxy modes (90 total)ng buildof the Angular schematic output through the existingdev-appnx project, exercising the rendered service in the real Angular compiler pipelineCloses #23732
Closes #8581