Skip to content

Commit

Permalink
fixing xml comments including
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgar Mesquita authored and Edgar Mesquita committed Jul 20, 2023
1 parent 3d2f0f8 commit 12e329f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/eQuantic.Core.Api.Crud/eQuantic.Core.Api.Crud.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>eQuantic API CRUD Library</Description>
<Copyright>2023</Copyright>
<AssemblyTitle>eQuantic.Core.Api.Crud</AssemblyTitle>
<Version>1.0.2.0</Version>
<Version>1.0.3.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFramework>net7.0</TargetFramework>
<PackageId>eQuantic.Core.Api.Crud</PackageId>
Expand All @@ -22,8 +22,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RepositoryUrl>https://github.com/eQuantic/core-api-crud</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
<AssemblyVersion>1.0.3.0</AssemblyVersion>
<FileVersion>1.0.3.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
12 changes: 8 additions & 4 deletions src/eQuantic.Core.Api/Extensions/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,24 @@ public static class ServiceCollectionExtensions
/// Adds the api documentation using the specified registry
/// </summary>
/// <param name="services">The service collection</param>
/// <param name="options">The documentation options</param>
/// <returns>The registry</returns>
public static IServiceCollection AddApiDocumentation(this IServiceCollection services, Action<DocumentationOptions>? options = null)
{
var docOptions = new DocumentationOptions();
options?.Invoke(docOptions);
var assembly = Assembly.GetExecutingAssembly();
var name = assembly.GetName().Name;

var assembly = docOptions.Assembly ?? Assembly.GetEntryAssembly();
var name = assembly?.GetName().Name;

services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = docOptions.Title, Version = "v1" });
c.DescribeAllParametersInCamelCase();
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, $"{name}.xml"));
if(!string.IsNullOrEmpty(name))
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, $"{name}.xml"));
c.EnableAnnotations();
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
{
Expand Down
3 changes: 3 additions & 0 deletions src/eQuantic.Core.Api/Options/DocumentationOptions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System.Reflection;

namespace eQuantic.Core.Api.Options;

public class DocumentationOptions
{
public string? Title { get; set; }
public Assembly? Assembly { get; set; }
}
6 changes: 3 additions & 3 deletions src/eQuantic.Core.Api/eQuantic.Core.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>eQuantic API Library</Description>
<Copyright>2023</Copyright>
<AssemblyTitle>eQuantic.Core.Api</AssemblyTitle>
<Version>1.0.2.0</Version>
<Version>1.0.3.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFramework>net7.0</TargetFramework>
<PackageId>eQuantic.Core.Api</PackageId>
Expand All @@ -22,8 +22,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RepositoryUrl>https://github.com/eQuantic/core-api-crud</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
<AssemblyVersion>1.0.3.0</AssemblyVersion>
<FileVersion>1.0.3.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>eQuantic Application CRUD Library</Description>
<Copyright>2023</Copyright>
<AssemblyTitle>eQuantic.Core.Application.Crud</AssemblyTitle>
<Version>1.0.2.0</Version>
<Version>1.0.3.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFrameworks>netstandard2.1;net7.0</TargetFrameworks>
<PackageId>eQuantic.Core.Application.Crud</PackageId>
Expand All @@ -22,8 +22,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RepositoryUrl>https://github.com/eQuantic/core-api-crud</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
<AssemblyVersion>1.0.3.0</AssemblyVersion>
<FileVersion>1.0.3.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>eQuantic Application Library</Description>
<Copyright>2023</Copyright>
<AssemblyTitle>eQuantic.Core.Application</AssemblyTitle>
<Version>1.0.2.0</Version>
<Version>1.0.3.0</Version>
<Authors>eQuantic Systems</Authors>
<TargetFrameworks>netstandard2.1;net7.0</TargetFrameworks>
<PackageId>eQuantic.Core.Application</PackageId>
Expand All @@ -22,8 +22,8 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RepositoryUrl>https://github.com/eQuantic/core-api-crud</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
<AssemblyVersion>1.0.3.0</AssemblyVersion>
<FileVersion>1.0.3.0</FileVersion>
<PackageIcon>Icon.png</PackageIcon>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down

0 comments on commit 12e329f

Please sign in to comment.