This library integrates OpenAPI 3 generation into the Giraffe Endpoint Routing programming model.
It is designed as a series of shadowed bindings that take the existing names for Giraffe HttpHandler combinators and augments them with OpenAPI metadata.
A component is registered that knows how to interpret those pieces of metadata and transforms them into an OpenAPI description document.
For usage examples, check the OpenAPI.Sample project in the samples directory.
GitHub Actions |
---|
Package | Stable | Prerelease |
---|---|---|
Giraffe.EndpointRouting.OpenAPI |
Make sure the following requirements are installed on your system:
or
CONFIGURATION
will set the configuration of the dotnet commands. If not set, it will default to Release.
CONFIGURATION=Debug ./build.sh
will result in -c
additions to commands such as in dotnet build -c Debug
GITHUB_TOKEN
will be used to upload release notes and Nuget packages to GitHub.
DISABLE_COVERAGE
Will disable running code coverage metrics. AltCover can have severe performance degradation so it's worth disabling when looking to do a quicker feedback loop.
DISABLE_COVERAGE=1 ./build.sh
> build.cmd <optional buildtarget> // on windows
$ ./build.sh <optional buildtarget>// on unix
The bin of your library should look similar to:
$ tree src/MyCoolNewLib/bin/
src/MyCoolNewLib/bin/
└── Debug
└── net50
├── MyCoolNewLib.deps.json
├── MyCoolNewLib.dll
├── MyCoolNewLib.pdb
└── MyCoolNewLib.xml
Clean
- Cleans artifact and temp directories.DotnetRestore
- Runs dotnet restore on the solution file.DotnetBuild
- Runs dotnet build on the solution file.DotnetTest
- Runs dotnet test on the solution file.GenerateCoverageReport
- Code coverage is run during DotnetTest
and this generates a report via ReportGenerator.WatchTests
- Runs dotnet watch with the test projects. Useful for rapid feedback loops.DotnetPack
- Runs dotnet pack. This includes running Source Link.SourceLinkTest
- Runs a Source Link test tool to verify Source Links were properly generated.PublishToNuGet
- Publishes the NuGet packages generated in DotnetPack
to NuGet via paket push.GitRelease
- Creates a commit message with the Release Notes and a git tag via the version in the Release Notes
.GitHubRelease
- Publishes a GitHub Release with the Release Notes and any NuGet packages.FormatCode
- Runs Fantomas on the solution file.BuildDocs
- Generates Documentation from docsSrc
and the XML Documentation Comments from your libraries in src
.WatchDocs
- Generates documentation and starts a webserver locally. It will rebuild and hot reload if it detects any changes made to docsSrc
files, libraries in src
, or the docsTool
itself.ReleaseDocs
- Will stage, commit, and push docs generated in the BuildDocs
target.Release
- Task that runs all release type tasks such as PublishToNuGet
, GitRelease
, ReleaseDocs
, and GitHubRelease
. Make sure to read Releasing to setup your environment correctly for releases.git add .
git commit -m "Scaffold"
git remote add origin https://github.com/user/MyCoolNewLib.git
git push -u origin main
paket config add-token "https://www.nuget.org" 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a
NUGET_TOKEN
to your keyGITHUB_TOKEN
to upload release notes and artifacts to githubThen update the CHANGELOG.md
with an "Unreleased" section containing release notes for this version, in KeepAChangelog format.
NOTE: Its highly recommend to add a link to the Pull Request next to the release note that it affects. The reason for this is when the RELEASE
target is run, it will add these new notes into the body of git commit. GitHub will notice the links and will update the Pull Request with what commit referenced it saying "added a commit that referenced this pull request". Since the build script automates the commit message, it will say "Bump Version to x.y.z". The benefit of this is when users goto a Pull Request, it will be clear when and which version those code changes released. Also when reading the CHANGELOG
, if someone is curious about how or why those changes were made, they can easily discover the work and discussions.
Here's an example of adding an "Unreleased" section to a CHANGELOG.md
with a 0.1.0
section already released.
## [Unreleased]
### Added
- Does cool stuff!
### Fixed
- Fixes that silly oversight
## [0.1.0] - 2017-03-17
First release
### Added
- This release already has lots of features
[Unreleased]: https://github.com/user/MyCoolNewLib.git/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/user/MyCoolNewLib.git/releases/tag/v0.1.0
Release
target, specifying the version number either in the RELEASE_VERSION
environmentCHANGELOG.md
, moving changes from the Unreleased
section into a new 0.2.0
section
Bump version to 0.2.0
and adds the new changelog section to the commit's bodymacOS/Linux Parameter:
./build.sh Release 0.2.0
macOS/Linux Environment Variable:
RELEASE_VERSION=0.2.0 ./build.sh Release