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

Add API analysers #3003

Merged
merged 2 commits into from
Aug 2, 2024
Merged
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
6 changes: 5 additions & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,21 @@ jobs:

$xml = [xml](Get-Content $properties)
$versionPrefix = $xml.SelectSingleNode('Project/PropertyGroup/VersionPrefix')
$publishedVersion = $versionPrefix.InnerText;

if (-Not [string]::IsNullOrEmpty(${env:NEXT_VERSION})) {
$version = [System.Version]::new(${env:NEXT_VERSION})
} else {
$version = [System.Version]::new($versionPrefix.InnerText)
$version = [System.Version]::new($publishedVersion)
$version = [System.Version]::new($version.Major, $version.Minor, $version.Build + 1)
}

$updatedVersion = $version.ToString()
$versionPrefix.InnerText = $updatedVersion

$packageValidationBaselineVersion = $xml.SelectSingleNode('Project/PropertyGroup/PackageValidationBaselineVersion')
$packageValidationBaselineVersion.InnerText = $publishedVersion

$settings = New-Object System.Xml.XmlWriterSettings
$settings.Encoding = New-Object System.Text.UTF8Encoding($false)
$settings.Indent = $true
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<Copyright>Copyright (c) 2016-$([System.DateTime]::Now.ToString(yyyy)) Richard Morris</Copyright>
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EnablePackageValidation>$(IsPackable)</EnablePackageValidation>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<!--
TODO Go through the code and tidy up the usings
Expand Down Expand Up @@ -41,6 +42,7 @@
<PackageReadmeFile>package-readme.md</PackageReadmeFile>
<PackageReleaseNotes>See $(PackageProjectUrl)/releases for details.</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageValidationBaselineVersion>6.7.0</PackageValidationBaselineVersion>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>$(PackageProjectUrl).git</RepositoryUrl>
Expand Down
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<PackageVersion Include="Microsoft.AspNetCore.Routing" Version="2.1.0" />
<PackageVersion Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="6.0.29" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.1.0" />
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.14" />
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="1.6.14" />
Expand All @@ -32,4 +33,4 @@
<PackageVersion Include="xunit.core" Version="2.8.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
Microsoft.Extensions.DependencyInjection.AnnotationsSwaggerGenOptionsExtensions
static Microsoft.Extensions.DependencyInjection.AnnotationsSwaggerGenOptionsExtensions.EnableAnnotations(this Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions options) -> void
static Microsoft.Extensions.DependencyInjection.AnnotationsSwaggerGenOptionsExtensions.EnableAnnotations(this Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions options, bool enableAnnotationsForInheritance, bool enableAnnotationsForPolymorphism) -> void
static Swashbuckle.AspNetCore.Annotations.AnnotationsOperationFilter.ApplySwaggerOperationFilterAttributes(Microsoft.OpenApi.Models.OpenApiOperation operation, Swashbuckle.AspNetCore.SwaggerGen.OperationFilterContext context, System.Collections.Generic.IEnumerable<object> controllerAndActionAttributes) -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsDocumentFilter
Swashbuckle.AspNetCore.Annotations.AnnotationsDocumentFilter.AnnotationsDocumentFilter() -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsDocumentFilter.Apply(Microsoft.OpenApi.Models.OpenApiDocument swaggerDoc, Swashbuckle.AspNetCore.SwaggerGen.DocumentFilterContext context) -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsOperationFilter
Swashbuckle.AspNetCore.Annotations.AnnotationsOperationFilter.AnnotationsOperationFilter() -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsOperationFilter.Apply(Microsoft.OpenApi.Models.OpenApiOperation operation, Swashbuckle.AspNetCore.SwaggerGen.OperationFilterContext context) -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsParameterFilter
Swashbuckle.AspNetCore.Annotations.AnnotationsParameterFilter.AnnotationsParameterFilter() -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsParameterFilter.Apply(Microsoft.OpenApi.Models.OpenApiParameter parameter, Swashbuckle.AspNetCore.SwaggerGen.ParameterFilterContext context) -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsRequestBodyFilter
Swashbuckle.AspNetCore.Annotations.AnnotationsRequestBodyFilter.AnnotationsRequestBodyFilter() -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsRequestBodyFilter.Apply(Microsoft.OpenApi.Models.OpenApiRequestBody requestBody, Swashbuckle.AspNetCore.SwaggerGen.RequestBodyFilterContext context) -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsSchemaFilter
Swashbuckle.AspNetCore.Annotations.AnnotationsSchemaFilter.AnnotationsSchemaFilter(System.IServiceProvider serviceProvider) -> void
Swashbuckle.AspNetCore.Annotations.AnnotationsSchemaFilter.Apply(Microsoft.OpenApi.Models.OpenApiSchema schema, Swashbuckle.AspNetCore.SwaggerGen.SchemaFilterContext context) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerDiscriminatorAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerDiscriminatorAttribute.PropertyName.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerDiscriminatorAttribute.PropertyName.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerDiscriminatorAttribute.SwaggerDiscriminatorAttribute(string propertyName) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute.Description.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute.Description.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute.OperationId.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute.OperationId.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute.Summary.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute.Summary.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute.SwaggerOperationAttribute(string summary = null, string description = null) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute.Tags.get -> string[]
Swashbuckle.AspNetCore.Annotations.SwaggerOperationAttribute.Tags.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerOperationFilterAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerOperationFilterAttribute.FilterType.get -> System.Type
Swashbuckle.AspNetCore.Annotations.SwaggerOperationFilterAttribute.SwaggerOperationFilterAttribute(System.Type filterType) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerParameterAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerParameterAttribute.Description.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerParameterAttribute.Description.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerParameterAttribute.Required.get -> bool
Swashbuckle.AspNetCore.Annotations.SwaggerParameterAttribute.Required.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerParameterAttribute.SwaggerParameterAttribute(string description = null) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerRequestBodyAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerRequestBodyAttribute.Description.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerRequestBodyAttribute.Description.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerRequestBodyAttribute.Required.get -> bool
Swashbuckle.AspNetCore.Annotations.SwaggerRequestBodyAttribute.Required.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerRequestBodyAttribute.SwaggerRequestBodyAttribute(string description = null) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.ContentTypes.get -> string[]
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.ContentTypes.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.Description.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.Description.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.SwaggerResponseAttribute(int statusCode, string description = null, System.Type type = null) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerResponseAttribute.SwaggerResponseAttribute(int statusCode, string description = null, System.Type type = null, params string[] contentTypes) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Description.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Description.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Format.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Format.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Nullable.get -> bool
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Nullable.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.ReadOnly.get -> bool
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.ReadOnly.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Required.get -> string[]
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Required.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.SwaggerSchemaAttribute(string description = null) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Title.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.Title.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.WriteOnly.get -> bool
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaAttribute.WriteOnly.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilterAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilterAttribute.Arguments.get -> object[]
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilterAttribute.Arguments.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilterAttribute.SwaggerSchemaFilterAttribute(System.Type type) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSchemaFilterAttribute.Type.get -> System.Type
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypeAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypeAttribute.DiscriminatorValue.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypeAttribute.DiscriminatorValue.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypeAttribute.SubType.get -> System.Type
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypeAttribute.SubType.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypeAttribute.SwaggerSubTypeAttribute(System.Type subType) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypesAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypesAttribute.Discriminator.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypesAttribute.Discriminator.set -> void
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypesAttribute.SubTypes.get -> System.Collections.Generic.IEnumerable<System.Type>
Swashbuckle.AspNetCore.Annotations.SwaggerSubTypesAttribute.SwaggerSubTypesAttribute(params System.Type[] subTypes) -> void
Swashbuckle.AspNetCore.Annotations.SwaggerTagAttribute
Swashbuckle.AspNetCore.Annotations.SwaggerTagAttribute.Description.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerTagAttribute.ExternalDocsUrl.get -> string
Swashbuckle.AspNetCore.Annotations.SwaggerTagAttribute.SwaggerTagAttribute(string description = null, string externalDocsUrl = null) -> void
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<AssemblyOriginatorKeyFile>Swashbuckle.AspNetCore.Annotations.snk</AssemblyOriginatorKeyFile>
<Description>Provides custom attributes that can be applied to controllers, actions and models to enrich the generated Swagger</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<NoWarn>$(NoWarn);1591</NoWarn>
<PackageTags>swagger;documentation;discovery;help;webapi;aspnet;aspnetcore;annotations</PackageTags>
<SignAssembly>true</SignAssembly>
Expand All @@ -14,4 +15,10 @@
<ProjectReference Include="..\Swashbuckle.AspNetCore.SwaggerGen\Swashbuckle.AspNetCore.SwaggerGen.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
<AdditionalFiles Include="PublicAPI\PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI\PublicAPI.Unshipped.txt" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Swashbuckle.AspNetCore.ApiTesting.Xunit.ApiTestFixture<TEntryPoint>
Swashbuckle.AspNetCore.ApiTesting.Xunit.ApiTestFixture<TEntryPoint>.ApiTestFixture(Swashbuckle.AspNetCore.ApiTesting.ApiTestRunnerBase apiTestRunner, Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory<TEntryPoint> webAppFactory, string documentName) -> void
Swashbuckle.AspNetCore.ApiTesting.Xunit.ApiTestFixture<TEntryPoint>.Describe(string pathTemplate, Microsoft.OpenApi.Models.OperationType operationType, Microsoft.OpenApi.Models.OpenApiOperation operationSpec) -> void
Swashbuckle.AspNetCore.ApiTesting.Xunit.ApiTestFixture<TEntryPoint>.TestAsync(string operationId, string expectedStatusCode, System.Net.Http.HttpRequestMessage request) -> System.Threading.Tasks.Task
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<Description>Xunit add-on for Swagger/OpenAPI-driven integration testing APIs built on ASP.NET Core</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<IsTestProject>false</IsTestProject>
<NoWarn>$(NoWarn);1591</NoWarn>
<PackageTags>swagger;openapi;test-first;spec-first;testing;aspnetcore;xunit</PackageTags>
Expand All @@ -20,5 +21,11 @@
<ItemGroup>
<ProjectCapability Remove="TestContainer" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
<AdditionalFiles Include="PublicAPI\PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI\PublicAPI.Unshipped.txt" />
</ItemGroup>

</Project>
Loading