Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 13738 fix dotnet build warnings #14321

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions backend/packagegroups/NuGet.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<PackageReference Update="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Update="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0" />
<PackageReference Update="Microsoft.Azure.KeyVault" Version="3.0.5" />
<PackageReference Update="Microsoft.Azure.Security.KeyVault.Secrets" Version="4.5.0" />
<PackageReference Update="Microsoft.Azure.Services.AppAuthentication" Version="1.6.2" />
<PackageReference Update="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.24" />
<PackageReference Update="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0" />
Expand All @@ -42,6 +41,15 @@
<PackageReference Update="DotNetEnv" Version="3.1.1" />
<PackageReference Update="NuGet.Versioning" Version="6.12.1" />
<PackageReference Update="DistributedLock.Postgres" Version="1.2.1" />
<PackageReference Include="System.Text.Json" Version="[9.0.0]" />
<PackageReference Update="Microsoft.CodeAnalysis.Common" Version="[4.8.0, 4.12.0)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="[4.12.0]" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="[4.12.0]" />
<PackageReference Update="Azure.Security.KeyVault.Secrets" Version="[4.7.0]" />
<PackageReference Include="System.Formats.Asn1" Version="8.0.1" />
<PackageReference Include="System.Net.Http" Version="[4.3.4]" />
<PackageReference Include="System.Text.RegularExpressions" Version="[4.3.1]" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
</ItemGroup>

<ItemGroup Label="Packages used for testing">
Expand All @@ -56,8 +64,8 @@
<PackageReference Update="Basic.Reference.Assemblies" Version="1.7.8" />
<PackageReference Update="Fare" Version="2.2.1" />
<PackageReference Update="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageReference Update="Microsoft.CodeAnalysis.Common" Version="4.9.2" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
<PackageReference Update="Microsoft.CodeAnalysis.Common" Version="4.12.0" />
<PackageReference Update="Testcontainers" Version="3.10.0" />
<PackageReference Update="Testcontainers.PostgreSql" Version="3.10.0" />
<PackageReference Update="Microsoft.AspNetCore.SignalR.Client" Version="9.0.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Runtime.Serialization;

namespace Altinn.Studio.DataModeling.Converter.Csharp
{
Expand All @@ -23,11 +22,5 @@ public CsharpGenerationException(string message) : base(message)
public CsharpGenerationException(string message, Exception innerException) : base(message, innerException)
{
}

/// <inheritdoc/>
protected CsharpGenerationException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Runtime.Serialization;

namespace Altinn.Studio.DataModeling.Converter.Json
{
Expand Down Expand Up @@ -29,12 +28,5 @@ public JsonSchemaConvertException(string message) : base(message)
public JsonSchemaConvertException(string message, Exception innerException) : base(message, innerException)
{
}

/// <summary>
/// <inheritdoc/>
/// </summary>
protected JsonSchemaConvertException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Runtime.Serialization;

namespace Altinn.Studio.DataModeling.Converter.Metadata
{
Expand All @@ -23,10 +22,5 @@ public MetamodelConvertException(string message) : base(message)
public MetamodelConvertException(string message, Exception innerException) : base(message, innerException)
{
}

/// <inheritdoc/>
protected MetamodelConvertException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Runtime.Serialization;

namespace Altinn.Studio.DataModeling.Converter.Xml
{
Expand Down Expand Up @@ -29,12 +28,5 @@ public XmlSchemaConvertException(string message) : base(message)
public XmlSchemaConvertException(string message, Exception innerException) : base(message, innerException)
{
}

/// <summary>
/// <inheritdoc/>
/// </summary>
protected XmlSchemaConvertException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
1 change: 1 addition & 0 deletions backend/src/DataModeling/DataModeling.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<AssemblyName>Altinn.Studio.DataModeling</AssemblyName>
<LangVersion>latest</LangVersion>
<RootNamespace>Altinn.Studio.DataModeling</RootNamespace>
<Version>1.0.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public class ApplicationMetadataController : ControllerBase
/// Initializes a new instance of the <see cref="ApplicationMetadataController"/> class.
/// </summary>
/// <param name="applicationMetadataService">The application metadata service</param>
/// <param name="userRequestsSynchronizationService">The user requests synchronization service</param>
public ApplicationMetadataController(IApplicationMetadataService applicationMetadataService)
{
_applicationMetadataService = applicationMetadataService;
Expand Down
1 change: 1 addition & 0 deletions backend/src/Designer/Controllers/DatamodelsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class DatamodelsController : ControllerBase
/// </summary>
/// <param name="schemaModelService">Interface for working with models.</param>
/// <param name="jsonSchemaValidator">An <see cref="IJsonSchemaValidator"/>.</param>
/// <param name="modelNameValidator">Interface for validating that the model name does not already belong to a data type</param>
public DatamodelsController(ISchemaModelService schemaModelService, IJsonSchemaValidator jsonSchemaValidator, IModelNameValidator modelNameValidator)
{
_schemaModelService = schemaModelService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ private async Task<OrgList> GetOrgList()
return orgList;
}

private static bool IsServiceOwner(ServiceResource? resource, string loggedInOrg)
private static bool IsServiceOwner(ServiceResource resource, string loggedInOrg)
{
if (resource?.HasCompetentAuthority == null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Runtime.Serialization;

namespace Altinn.Studio.Designer.Infrastructure.GitRepository;

Expand All @@ -23,10 +22,5 @@ public LocalGitCloneIoException(string message) : base(message)
public LocalGitCloneIoException(string message, Exception innerException) : base(message, innerException)
{
}

/// <inheritdoc/>
protected LocalGitCloneIoException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}

4 changes: 2 additions & 2 deletions backend/src/Designer/Models/AccessList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Altinn.Studio.Designer.Models

public class AccessList : HeaderEtag
{
public string Identifier { get; set; }
public string Name { get; set; }
public required string Identifier { get; set; }
public required string Name { get; set; }
public string? Description { get; set; }
public IEnumerable<AccessListResourceConnection>? ResourceConnections { get; set; }
}
Expand Down
9 changes: 5 additions & 4 deletions backend/src/Designer/Models/AccessListMember.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
namespace Altinn.Studio.Designer.Models
#nullable enable
namespace Altinn.Studio.Designer.Models
{
public class AccessListMember
{
public string OrgNr { get; set; }
public string OrgName { get; set; }
public bool IsSubParty { get; set; }
public required string OrgNr { get; set; }
public required string OrgName { get; set; }
public bool? IsSubParty { get; set; }
}
}
2 changes: 1 addition & 1 deletion backend/src/Designer/Models/BrregPartyResultSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Altinn.Studio.Designer.Models
public class BrregParty
{
[JsonPropertyName("organisasjonsnummer")]
public string Organisasjonsnummer { get; set; }
public required string Organisasjonsnummer { get; set; }
[JsonPropertyName("navn")]
public string? Navn { get; set; }
}
Expand Down
2 changes: 1 addition & 1 deletion backend/src/Designer/Models/CreateAccessListModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Altinn.Studio.Designer.Models
{
public class CreateAccessListModel
{
public string Name { get; set; }
public required string Name { get; set; }
public string? Description { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Altinn.Studio.Designer.Models.Dto
{
public class AccessListInfoDtoPaginated
{
public IEnumerable<AccessList> Data { get; set; }
public required IEnumerable<AccessList> Data { get; set; }
public AccessListPaging? Links { get; set; }
}
}
19 changes: 10 additions & 9 deletions backend/src/Designer/Models/Dto/AccessListMember.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
using System.Collections.Generic;
#nullable enable
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace Altinn.Studio.Designer.Models.Dto
{
public class AccessListMembersDto
{
public IList<AccessListMemberDataDto> Data { get; set; }
public required IList<AccessListMemberDataDto> Data { get; set; }
public AccessListPaging? Links { get; set; }
}

public class AccessListMemberDataDto
{
public string Id { get; set; }
public string Since { get; set; }
public AccessListMemberDtoIdentifier Identifiers { get; set; }
public required string Id { get; set; }
public required string Since { get; set; }
public required AccessListMemberDtoIdentifier Identifiers { get; set; }
}

public class AccessListMemberDtoIdentifier
{
[JsonPropertyName("urn:altinn:party:uuid")]
public string PartyUuid { get; set; }
public required string PartyUuid { get; set; }
[JsonPropertyName("urn:altinn:party:id")]
public int PartyId { get; set; }
public required int PartyId { get; set; }
[JsonPropertyName("urn:altinn:organization:identifier-no")]
public string OrganizationNumber { get; set; }
public required string OrganizationNumber { get; set; }
}

public class UpdateAccessListMemberDto
{
public IList<string> Data { get; set; }
public required IList<string> Data { get; set; }
}


Expand Down
20 changes: 8 additions & 12 deletions backend/src/Designer/Models/LayoutSets.cs
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
#nullable enable
using System.Collections.Generic;
using System.Text.Json.Serialization;
using JetBrains.Annotations;

namespace Altinn.Studio.Designer.Models;

public class LayoutSets : Altinn.App.Core.Models.LayoutSets
{
[JsonPropertyName("$schema")]
public string Schema { get; set; }
public required string Schema { get; set; }

[JsonPropertyName("sets")]
public new List<LayoutSetConfig> Sets { get; set; }
public new required List<LayoutSetConfig> Sets { get; set; }

[JsonExtensionData]
public IDictionary<string, object?> UnknownProperties { get; set; }
public IDictionary<string, object?>? UnknownProperties { get; set; }
}

public class LayoutSetConfig
{
[JsonPropertyName("id")]
public string Id { get; set; }
public required string Id { get; set; }

[JsonPropertyName("dataType")]
[CanBeNull]
public string DataType { get; set; }
[JsonPropertyName("dataType")] public string? DataType { get; set; }

[JsonPropertyName("tasks")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[CanBeNull]
public List<string> Tasks { get; set; }
public List<string>? Tasks { get; set; }

[JsonPropertyName("type")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string Type { get; set; }
public string? Type { get; set; }

[JsonExtensionData]
public IDictionary<string, object?> UnknownProperties { get; set; }
public IDictionary<string, object?>? UnknownProperties { get; set; }
}
4 changes: 2 additions & 2 deletions backend/src/Designer/Models/ListviewServiceResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ListviewServiceResource
public string? CreatedBy { get; set; }

/// <summary>
/// Timestamp for when the resourcefile was last changed
/// Timestamp for when the resource file was last changed
/// </summary>
public DateTime? LastChanged { get; set; }

Expand All @@ -34,6 +34,6 @@ public class ListviewServiceResource
/// <summary>
/// A list of environments the resource is deployed in
/// </summary>
public IList<string> Environments { get; set; }
public IList<string>? Environments { get; set; }
}
}
2 changes: 1 addition & 1 deletion backend/src/Designer/Models/PagedAccessListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Altinn.Studio.Designer.Models
{
public class PagedAccessListResponse
{
public IEnumerable<AccessList> Data { get; set; }
public IEnumerable<AccessList>? Data { get; set; }
public string? NextPage { get; set; }
}
}
1 change: 1 addition & 0 deletions backend/src/Designer/Models/Preview/DataPatchRequest.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable enable
using System.Collections.Generic;
using System.Text.Json.Serialization;
using Json.Patch;
Expand Down
4 changes: 2 additions & 2 deletions backend/src/Designer/Models/ServiceResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Altinn.Studio.Designer.Models
{
/// <summary>
/// Model describing a complete resource from the resrouce registry
/// Model describing a complete resource from the resource registry
/// </summary>
public class ServiceResource
{
Expand Down Expand Up @@ -54,7 +54,7 @@ public class ServiceResource
/// <summary>
/// List of possible contact points
/// </summary>
public List<ContactPoint> ContactPoints { get; set; }
public List<ContactPoint>? ContactPoints { get; set; }

/// <summary>
/// Linkes to the outcome of a public service
Expand Down
9 changes: 0 additions & 9 deletions backend/src/Designer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,4 @@ void CreateDirectory(IConfiguration configuration)
}
}

static string GetXmlCommentsPathForControllers()
{
// locate the xml file being generated by .NET
string xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.XML";
string xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);

return xmlPath;
}

public partial class Program { }
Loading
Loading