PopValidations.Swashbuckle 0.9.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PopValidations.Swashbuckle --version 0.9.0                
NuGet\Install-Package PopValidations.Swashbuckle -Version 0.9.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PopValidations.Swashbuckle" Version="0.9.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PopValidations.Swashbuckle --version 0.9.0                
#r "nuget: PopValidations.Swashbuckle, 0.9.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PopValidations.Swashbuckle as a Cake Addin
#addin nuget:?package=PopValidations.Swashbuckle&version=0.9.0

// Install PopValidations.Swashbuckle as a Cake Tool
#tool nuget:?package=PopValidations.Swashbuckle&version=0.9.0                

PopValidation's Swashbuckle integration allows you to include PopValidations validation descriptions within the OpenApi specifications.

Usage

Pop Validations Swashbuckle Integration, is usable for both public and corporate use, without need for compensation, or mention. Feature or bugfix PR's, including appropriate tests are more than welcome.

Developers

The core developer is Adam Williamson(https://github.com/AdamWilliamson).

Example

PopValidation provides the ability to Describe the validations input configured for your objects. These descriptions can be imported into your OpenApi spec, using this package, with multiple configuration options. The OpenApi specification can be modified in 2 ways, by including the validation descriptions in an attribute, as well as, or instead of, modifying the OpenApi in-built validation options.

An example

using PopValidation;

public record Song(string? Title, double Duration);

public class SongValidator: AbstractValidator<Song> 
{
    public SongValidator() 
    {
        RuleFor(x => x.Title).Vitally().NotEmpty();
        RuleFor(x => x.Duration)
            .IsNotNull()
            .IsLessThan(10.0, options => options.WithErrorMessage("Songs must be less than 10 minutes long."));
    }
}

// Instantiate the Validation Runner.
var runner = new ValidationRunner<Song>(
    new () { new SongValidator() },
    new MessageProcessor()
);

// Run the Validation System.
var results = await runner.Validate(new Song("A Song", 5.5));

// Determine failures;
var isFailure = results.Errors.Any();

Full Documentation

Full documentation can be found at https://adamwilliamson.github.io/popvalidations/

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 218 12/24/2023
0.9.0.1 172 11/3/2023
0.9.0 138 10/29/2023

Working towards V1. This contains the basics needed to Ouput PopValidations to Swashbuckle's OpenApi output.