Skip to content

Commit

Permalink
Add constructor to ServiceDescription API (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
juileetikekar authored Aug 15, 2024
1 parent 3d8efc4 commit f500250
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/AasxServerBlazor/Configuration/ServerConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using AasSecurity;
Expand Down Expand Up @@ -233,7 +233,8 @@ private static void AddSwaggerGen(IServiceCollection services) =>
});

swaggerGenOptions.EnableAnnotations();
swaggerGenOptions.CustomSchemaIds(type => type.FullName);
//Based on issue https://github.com/swagger-api/swagger-ui/issues/7911
swaggerGenOptions.CustomSchemaIds(type => type.FullName?.Replace("+", "."));

var swaggerCommentedAssembly =
typeof(AssetAdministrationShellRepositoryAPIApiController).Assembly.GetName().Name;
Expand Down
6 changes: 4 additions & 2 deletions src/IO.Swagger.Lib.V3/Controllers/DescriptionAPIApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class DescriptionAPIApiController : ControllerBase
{
private readonly IServiceDescription _serviceDescription;

public DescriptionAPIApiController(IServiceDescription serviceDescription) => _serviceDescription = serviceDescription;

/// <summary>
/// Returns the self-describing information of a network resource (ServiceDescription)
/// </summary>
Expand All @@ -41,7 +43,7 @@ public class DescriptionAPIApiController : ControllerBase
public virtual IActionResult GetDescription()
{
var output = new ServiceDescription();
output.Profiles = new List<ServiceProfiles>
_serviceDescription.Profiles = new List<ServiceProfiles>
{
ServiceProfiles.AasxFileServerServiceSpecificationSSP001,
ServiceProfiles.SubmodelRepositoryServiceSpecificationSSP001,
Expand All @@ -53,6 +55,6 @@ public virtual IActionResult GetDescription()
ServiceProfiles.ConceptDescriptionServiceSpecificationSSP001
};
//return new ObjectResult(_serviceDescription.ToJson());
return new ObjectResult(output.ToJson());
return new ObjectResult(_serviceDescription.ToJson());
}
}

0 comments on commit f500250

Please sign in to comment.