Skip to content

Commit 84b31ae

Browse files
committed
Merge branch 'main' into feat/signature-validation
2 parents 7018d57 + 209e0c8 commit 84b31ae

File tree

8 files changed

+29
-13
lines changed

8 files changed

+29
-13
lines changed

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="8.10.0" />
3636
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.3.0" />
3737
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
38-
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.27" />
39-
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.27" />
38+
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.28" />
39+
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.28" />
4040
<PackageVersion Include="MinVer" Version="6.0.0" />
4141
<PackageVersion Include="Moq" Version="4.20.72" />
4242
<PackageVersion Include="NetEscapades.EnumGenerators" Version="1.0.0-beta14" />

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.414",
3+
"version": "8.0.415",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}

src/Altinn.App.Api/Controllers/ResourceController.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,22 @@ public ActionResult GetModelJsonSchema([FromRoute] string id)
3737

3838
/// <summary>
3939
/// Get the form layout
40+
/// </summary>
4041
/// <param name="org">Unique identifier of the organisation responsible for the app.</param>
4142
/// <param name="app">Application identifier which is unique within an organisation.</param>
43+
/// <remarks> This endpoint assumes a single layout set and does not work for apps on version 8.0 and above.</remarks>
4244
/// <returns>A collection of FormLayout objects in JSON format.</returns>
43-
/// </summary>
44-
[ProducesResponseType(typeof(string), StatusCodes.Status200OK, "application/json")]
45+
[ProducesResponseType(typeof(string), StatusCodes.Status404NotFound, "text/plain")]
4546
[HttpGet]
4647
[Route("{org}/{app}/api/layouts")]
48+
[Obsolete(
49+
"This endpoint is no longer available. Use /{org}/{app}/api/layoutsets to get available layout sets and /{org}/{app}/api/layouts/{id} to get layouts for a specific layout set."
50+
)]
4751
public ActionResult GetLayouts(string org, string app)
4852
{
49-
string layouts = _appResourceService.GetLayouts();
50-
return Ok(layouts);
53+
return NotFound(
54+
"This endpoint is no longer available. Use /{org}/{app}/api/layoutsets to get available layout sets and /{org}/{app}/api/layouts/{id} to get layouts for a specific layout set."
55+
);
5156
}
5257

5358
/// <summary>

src/Altinn.App.Core/Implementation/AppResourcesSI.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ public string GetClassRefForLogicDataType(string dataType)
218218
}
219219

220220
/// <inheritdoc />
221+
[Obsolete("Use GetLayoutsForSet or GetLayoutModelForTask instead")]
221222
public string GetLayouts()
222223
{
223224
using var activity = _telemetry?.StartGetLayoutsActivity();

src/Altinn.App.Core/Internal/App/IAppResources.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public interface IAppResources
8282
/// Gets the layouts for the app.
8383
/// </summary>
8484
/// <returns>A dictionary of FormLayout objects serialized to JSON</returns>
85+
[Obsolete("Use GetLayoutsForSet or GetLayoutModelForTask instead")]
8586
string GetLayouts();
8687

8788
/// <summary>

test/Altinn.App.Api.Tests/OpenApi/OpenApiSpecChangeDetection.SaveJsonSwagger.verified.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5090,11 +5090,13 @@
50905090
"tags": [
50915091
"Resource"
50925092
],
5093-
"summary": "Get the form layout\n<param name=\"org\">Unique identifier of the organisation responsible for the app.</param><param name=\"app\">Application identifier which is unique within an organisation.</param><returns>A collection of FormLayout objects in JSON format.</returns>",
5093+
"summary": "Get the form layout",
5094+
"description": "This endpoint assumes a single layout set and does not work for apps on version 8.0 and above.",
50945095
"parameters": [
50955096
{
50965097
"name": "org",
50975098
"in": "path",
5099+
"description": "Unique identifier of the organisation responsible for the app.",
50985100
"required": true,
50995101
"schema": {
51005102
"type": "string"
@@ -5103,24 +5105,26 @@
51035105
{
51045106
"name": "app",
51055107
"in": "path",
5108+
"description": "Application identifier which is unique within an organisation.",
51065109
"required": true,
51075110
"schema": {
51085111
"type": "string"
51095112
}
51105113
}
51115114
],
51125115
"responses": {
5113-
"200": {
5114-
"description": "OK",
5116+
"404": {
5117+
"description": "Not Found",
51155118
"content": {
5116-
"application/json": {
5119+
"text/plain": {
51175120
"schema": {
51185121
"type": "string"
51195122
}
51205123
}
51215124
}
51225125
}
5123-
}
5126+
},
5127+
"deprecated": true
51245128
}
51255129
},
51265130
"/{org}/{app}/api/layouts/{id}": {

test/Altinn.App.Api.Tests/PublicApiTests.PublicApi_ShouldNotChange_Unintentionally.verified.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,11 @@ namespace Altinn.App.Api.Controllers
535535
[Microsoft.AspNetCore.Mvc.Route("{org}/{app}/api/layoutsettings/{id}")]
536536
public Microsoft.AspNetCore.Mvc.ActionResult GetLayoutSettings(string org, string app, string id) { }
537537
[Microsoft.AspNetCore.Mvc.HttpGet]
538-
[Microsoft.AspNetCore.Mvc.ProducesResponseType(typeof(string), 200, "application/json", new string[0])]
538+
[Microsoft.AspNetCore.Mvc.ProducesResponseType(typeof(string), 404, "text/plain", new string[0])]
539539
[Microsoft.AspNetCore.Mvc.Route("{org}/{app}/api/layouts")]
540+
[System.Obsolete("This endpoint is no longer available. Use /{org}/{app}/api/layoutsets to get avai" +
541+
"lable layout sets and /{org}/{app}/api/layouts/{id} to get layouts for a specifi" +
542+
"c layout set.")]
540543
public Microsoft.AspNetCore.Mvc.ActionResult GetLayouts(string org, string app) { }
541544
[Microsoft.AspNetCore.Mvc.HttpGet]
542545
[Microsoft.AspNetCore.Mvc.ProducesResponseType(typeof(string), 200, "application/json", new string[0])]

test/Altinn.App.Core.Tests/PublicApiTests.PublicApi_ShouldNotChange_Unintentionally.verified.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,6 +2280,7 @@ namespace Altinn.App.Core.Implementation
22802280
public Altinn.App.Core.Models.LayoutSettings? GetLayoutSettingsForSet(string? layoutSetId) { }
22812281
public string? GetLayoutSettingsString() { }
22822282
public string? GetLayoutSettingsStringForSet(string layoutSetId) { }
2283+
[System.Obsolete("Use GetLayoutsForSet or GetLayoutModelForTask instead")]
22832284
public string GetLayouts() { }
22842285
public string GetLayoutsForSet(string layoutSetId) { }
22852286
public string GetModelJsonSchema(string modelId) { }
@@ -2847,6 +2848,7 @@ namespace Altinn.App.Core.Internal.App
28472848
Altinn.App.Core.Models.LayoutSettings? GetLayoutSettingsForSet(string? layoutSetId);
28482849
string? GetLayoutSettingsString();
28492850
string? GetLayoutSettingsStringForSet(string layoutSetId);
2851+
[System.Obsolete("Use GetLayoutsForSet or GetLayoutModelForTask instead")]
28502852
string GetLayouts();
28512853
string GetLayoutsForSet(string layoutSetId);
28522854
string GetModelJsonSchema(string modelId);

0 commit comments

Comments
 (0)