Skip to content

Commit d3374e4

Browse files
committed
bump 3.6.2
1 parent 474c8a2 commit d3374e4

12 files changed

Lines changed: 59 additions & 18 deletions

File tree

.github/workflows/build-test-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
RELEASE_VERSION: v3.6.1
11+
RELEASE_VERSION: v3.6.2
1212

1313
# Add workflow-level permissions
1414
permissions:

NpgsqlRest/IRoutineSource.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,12 @@ public interface IRoutineSource
6161
/// Query parameter
6262
/// </summary>
6363
string[]? ExcludeNames { get; set; }
64+
65+
/// <summary>
66+
/// When true, composite type columns in the response are serialized as nested JSON objects.
67+
/// For example, a column "req" of type "my_request(id int, name text)" becomes {"req": {"id": 1, "name": "test"}}
68+
/// instead of the default flat structure {"id": 1, "name": "test"}.
69+
/// Default is false.
70+
/// </summary>
71+
bool NestedJsonForCompositeTypes { get; set; }
6472
}

NpgsqlRest/NpgsqlRest.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3030
<PackageReadmeFile>README.MD</PackageReadmeFile>
3131
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
32-
<Version>3.6.1</Version>
33-
<AssemblyVersion>3.6.1</AssemblyVersion>
34-
<FileVersion>3.6.1</FileVersion>
35-
<PackageVersion>3.6.1</PackageVersion>
32+
<Version>3.6.2</Version>
33+
<AssemblyVersion>3.6.2</AssemblyVersion>
34+
<FileVersion>3.6.2</FileVersion>
35+
<PackageVersion>3.6.2</PackageVersion>
3636
<EnableRequestDelegateGenerator>true</EnableRequestDelegateGenerator>
3737
</PropertyGroup>
3838

NpgsqlRest/NpgsqlRestBuilder.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ private static Metadata Build(IApplicationBuilder? builder, RetryStrategy? defau
169169
}
170170
}
171171

172+
// Apply source's NestedJsonForCompositeTypes default if not set by comment annotation
173+
if (endpoint.NestedJsonForCompositeTypes is null && source.NestedJsonForCompositeTypes)
174+
{
175+
endpoint.NestedJsonForCompositeTypes = true;
176+
}
177+
172178
if (defaultStrategy is not null && endpoint.RetryStrategy is null)
173179
{
174180
endpoint.RetryStrategy = defaultStrategy;

NpgsqlRestClient/NpgsqlRestClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PublishAot>true</PublishAot>
1111
<PublishTrimmed>true</PublishTrimmed>
1212
<TrimMode>full</TrimMode>
13-
<Version>3.6.1</Version>
13+
<Version>3.6.2</Version>
1414
</PropertyGroup>
1515

1616
<ItemGroup>

NpgsqlRestClient/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
3.6.1 Default Configuration Template
2+
3.6.2 Default Configuration Template
33
*/
44
{
55
//

changelog.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ Note: The changelog for the older version can be found here: [Changelog Archive]
44

55
---
66

7+
## Version [3.6.2](https://github.com/NpgsqlRest/NpgsqlRest/tree/3.6.2) (2025-02-02)
8+
9+
[Full Changelog](https://github.com/NpgsqlRest/NpgsqlRest/compare/3.6.1...3.6.2)
10+
11+
### Fixes
12+
13+
- Fixed `NestedJsonForCompositeTypes` option from `RoutineOptions` not being applied to endpoints. Previously, only the `nested` comment annotation could enable nested JSON serialization for composite types. Now the global configuration option is properly applied as the default for all endpoints.
14+
15+
- Fixed TypeScript client (`NpgsqlRest.TsClient`) generating incorrect types for composite columns when `NestedJsonForCompositeTypes` is `false` (the default). The client now correctly generates flat field types matching the actual JSON response structure, instead of always generating nested interfaces.
16+
17+
### Breaking Changes
18+
19+
- Added `NestedJsonForCompositeTypes` property to `IRoutineSource` interface. Custom implementations of `IRoutineSource` will need to add this property.
20+
21+
---
22+
723
## Version [3.6.1](https://github.com/NpgsqlRest/NpgsqlRest/tree/3.6.1) (2025-02-02)
824

925
[Full Changelog](https://github.com/NpgsqlRest/NpgsqlRest/compare/3.6.0...3.6.1)

npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "npgsqlrest",
3-
"version": "3.6.1",
3+
"version": "3.6.2",
44
"description": "Automatic REST API for PostgreSQL Databases Client Build",
55
"scripts": {
66
"postinstall": "node postinstall.js",

npm/postinstall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const os = require("os");
66
const https = require("https");
77

88
const downloadDir = "../.bin/";
9-
const downloadFrom = "https://github.com/NpgsqlRest/NpgsqlRest/releases/download/v3.6.1/";
9+
const downloadFrom = "https://github.com/NpgsqlRest/NpgsqlRest/releases/download/v3.6.2/";
1010

1111
function download(url, to, done) {
1212
https.get(url, (response) => {

plugins/NpgsqlRest.CrudSource/CrudSource.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ public class CrudSource(
118118
// Comments mode (`Ignore`, `ParseAll`, `OnlyWithHttpTag`), when not null overrides the `CommentsMode` from the main options.
119119
//
120120
public CommentsMode? CommentsMode { get; set; } = commentsMode;
121+
//
122+
// When true, composite type columns in the response are serialized as nested JSON objects.
123+
// Not typically used for CRUD sources but required by IRoutineSource interface.
124+
//
125+
public bool NestedJsonForCompositeTypes { get; set; } = false;
121126

122127
private readonly IRoutineSourceParameterFormatter _selectParameterFormatter = new SelectParameterFormatter();
123128
private readonly IRoutineSourceParameterFormatter _updateParameterFormatter = new UpdateParameterFormatter();

0 commit comments

Comments
 (0)