Skip to content

Diagnostics ​

This page lists every diagnostic code that Hardened's generators, build tasks, package targets and project templates report. The DM and VM codes come from two libraries compiled into Hardened's generators. Prefixes links to their own lists.

The build reports HRDR010 for this handler, added to a dotnet new hardened-web -n Todos project as src/Todos/SearchController.cs:

csharp
using Hardened.Web.Runtime.Attributes;

namespace Todos;

public class SearchController
{
    [Get("/search")]
    public string Find(string title) => title;
}

dotnet build prints the code as a warning:

console
$ dotnet build src/Todos
CSC : warning HRDR010: Parameter 'title' of 'SearchController.Find' is read from the request body, and a GET carries none, so a request that sends no body is refused before the handler runs and the published document gives the operation a body it should not have. Bind 'title' with [FromQueryString] or [FromHeader], mark it [FromServices] if it is a service, or suppress HRDR010 if this operation deliberately reads a body from a GET.

A build prints each code with its severity and its id, as in warning HRDR010, error HRDR009 and info HRDF003. A generator diagnostic with no source position prints as CSC : warning <id>. One with a source position prints the file, line and column first. A build task diagnostic about a description, such as the OpenAPI contract, prints the description's path. Other build task diagnostics print the package's .targets file.

An enum value in an attribute on a [HardenedModule] class can fail the build with CS1503 or CS0266 in the generated module code. Attributes lists those values.

Suppressing or escalating a code ​

<NoWarn> in the project that reports a code removes it. With this block in src/Todos/Todos.csproj, the build above reports no warnings:

xml
<PropertyGroup>
  <NoWarn>$(NoWarn);HRDR010</NoWarn>
</PropertyGroup>

A .globalconfig file sets the severity of any generator diagnostic to none, warning or error. The file holds is_global = true and a dotnet_diagnostic.<id>.severity line. This src/Todos/.globalconfig removes HRDR010:

ini
is_global = true

dotnet_diagnostic.HRDR010.severity = none

The build picks up a file named .globalconfig in the project's folder or a folder above it.

This table shows what each setting does to each kind of diagnostic. The Reported by column of each code table below names the kind.

SettingGenerator diagnostic at a source positionOther generator diagnosticsBuild task and package targets diagnostics
<NoWarn>$(NoWarn);ID</NoWarn>Removes it, warning or errorRemoves it, warning or errorRemoves a warning. An error stays
.globalconfig with dotnet_diagnostic.ID.severitySets the severitySets the severityNo effect
.editorconfig [*.cs] with dotnet_diagnostic.ID.severitySets the severityNo effectNo effect
#pragma warning disable IDRemoves itNo effectNo effect
<WarningsAsErrors>$(WarningsAsErrors);ID</WarningsAsErrors>Makes the warning an errorMakes the warning an errorMakes the warning an error
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>Makes every warning an errorMakes every warning an errorNo effect
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>Makes every warning an errorMakes every warning an errorMakes every warning an error
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>No effectNo effectNo effect, except HSMT011

The generator diagnostics at a source position are HOAG031, HOAG032, HRDR014, HRDV005, and the DM and VM codes. Each points at a position in a source file of the project. HAUTH001 and HRDR013 print a file and line. Neither #pragma nor .editorconfig reaches them.

A build under TreatWarningsAsErrors succeeds when its only warnings come from a build task or package targets. <WarningsNotAsErrors> naming an id keeps that code a warning under TreatWarningsAsErrors.

A category rule, dotnet_analyzer_diagnostic.category-<category>.severity, has no effect on any of these codes. A diagnostic of severity Info prints only at detailed verbosity, dotnet build -v:d.

Properties that change a code ​

Each of these build properties changes the codes in its row:

PropertyCodeEffect
HardenedAmbiguousRoutesHRDR001Its severity: error, the default, warning, info or suggestion, none or hidden. Any other value is error.
HardenedSmithyPinCliVersionHSMT011true makes it an error. It defaults to ContinuousIntegrationBuild.
HardenedSkipCSharpAuthorVersionCheckHARDENED001true turns the check off.
AutoGenerateEntryPointHRDGF002false turns the check off.
HardenedResponseModelHOAT026, HSMT026Standard reports it.

This project file sets HRDR001 to a warning:

xml
<PropertyGroup>
  <HardenedAmbiguousRoutes>warning</HardenedAmbiguousRoutes>
</PropertyGroup>

With HRDR001 lowered by this property, by <NoWarn> or by a .globalconfig, the build fails with CS0152 in the generated routing table. The message is The switch statement contains multiple cases with the label value '"GET"'.

Prefixes ​

The prefix of a code names what reports it.

PrefixReported byPackage
HOAGThe generators, for a handler they cannot write, and the specification-first generator, for described operations and the [Handler] classes that implement themHardened.Web.SourceGenerator, Hardened.Function.SourceGenerator, Hardened.Idl.SourceGenerator
HAUTHThe web generator, for authorizationHardened.Web.SourceGenerator
HRDRThe routing generators, and the library generator for entry points and generator referencesHardened.Web.SourceGenerator, Hardened.Idl.SourceGenerator, Hardened.Library.SourceGenerator
HRDWThe web generator, for handler declarationsHardened.Web.SourceGenerator
HRDRMThe web generator, for response casesHardened.Web.SourceGenerator
HRDTThe web generator, for [Throws<T>], and the testing package's targetsHardened.Web.SourceGenerator, Hardened.Shared.Testing
HRDSCThe web generator, for authentication scheme attributesHardened.Web.SourceGenerator
HRDVThe web and function generators, for handler validationHardened.Web.SourceGenerator, Hardened.Function.SourceGenerator
HRDOAThe web generator, for the OpenAPI document, and the build task that writes it to a fileHardened.Web.SourceGenerator
HRDFThe library generator, for trigger adapters, and the function generator, for test façadesHardened.Library.SourceGenerator, Hardened.Function.SourceGenerator
HRDAZThe Azure Functions generator, and the Azure runtime's targetsHardened.Azure.Functions.SourceGenerator, Hardened.Azure.Functions.Runtime
HRDGFThe Cloud Functions generator, and the Cloud Functions runtime's targetsHardened.Gcp.Functions.SourceGenerator, Hardened.Gcp.Functions.Runtime
HOATThe OpenAPI build task and its targetsHardened.OpenApi.SourceGenerator
HSMTThe Smithy build tasks and their targetsHardened.Smithy.SourceGenerator
HTPLChecks the templates write into the projects they scaffoldHardened.Templates
HSTATICThe static content build task and its targetsHardened.Web.StaticContent
HARDENEDThe source package's version checkHardened.SourceGenerator
HardenedExceptionAny Hardened generator that throws. The id has no numberEvery generator package
DMDependencyModules, inside the library generatorHardened.Library.SourceGenerator
VMValidationModules' generator, and the web and function generators for constraints on handler parametersValidationModules.SourceGenerator, Hardened.Web.SourceGenerator, Hardened.Function.SourceGenerator

HOAT and HSMT share one numbering. HRDOA shares it for the codes of the build task that writes the served document to a file. HOAT and HSMT lists these codes by number.

A build that skips the OpenAPI or Smithy build task as up to date reports that task's last warnings again. The Smithy CLI's version warning, HSMT011, is the exception: it describes the CLI on the machine rather than the model, so it appears only on a build that runs the CLI.

DependencyModules lists the DM codes in its diagnostics reference. ValidationModules lists the VM codes in its diagnostics reference.

HOAG ​

IdSeverityReported whenReported byPage
HOAG001WarningWriting the handler for a described operation threw. The message carries the exception's messageGeneratorNone
HOAG002WarningA model file the build task wrote, *.openapi-model.txt, cannot be readGeneratorGenerating from OpenAPI
HOAG010WarningA handler parameter's type does not resolve for the generator. That handler is not generated, and the project's other handlers areGeneratorRoute links
HOAG020ErrorA described operation answers text/html with a model, and its implementation declares no [Output<T>]GeneratorViews
HOAG030WarningNo class carrying [Handler] implements a service the description declares. The service's routes exist and fail at request timeGeneratorGenerating from OpenAPI
HOAG031WarningA class carrying [Handler] names no service the description declares in its base listGeneratorGenerating from OpenAPI
HOAG032WarningA [Handler] class, or one of its methods, carries [RawResponse], [Throws<T>], [Tag] or [Server]. None of them changes a described operationGeneratorGenerating from OpenAPI

HAUTH ​

IdSeverityReported whenReported byPage
HAUTH001WarningThe project's module class carries [RequireAuthorization] and no authorization attribute of its own, and a handler compiled in the project carries no authorization attribute and no [AllowAnonymous], on its method or its classGeneratorAuthorization
HAUTH002WarningA handler's method carries an authorization attribute, and [AllowAnonymous] is on the same method or on its class, so the attribute has no effectGeneratorAuthorization

[AllowAnonymous] on the handler's method or on its class clears HAUTH001. So does an attribute that implements IAuthorizeAttribute, on the handler or on the module class.

HRDR ​

IdSeverityReported whenReported byPage
HRDR001Error, or the severity HardenedAmbiguousRoutes namesTwo routes under one method match the same paths and differ only in what one token accepts: a constraint, or {name} beside {*name}GeneratorRouting
HRDR002ErrorA route uses a brace form the build does not compile, or names a constraint nothing declaresGeneratorRouting
HRDR003ErrorA [RouteConstraint] method is not static bool taking one ReadOnlySpan<char>GeneratorRouting
HRDR004ErrorA project holds more than one [HardenedModule] classGeneratorModules
HRDR005ErrorA route token binds no parameter, and the parameter meant for it is read from the request body: its name differs from the token only by case, or the method is GET, HEAD, OPTIONS or TRACEGeneratorRouting
HRDR006ErrorA project declares routes and no routing generator compiles themGeneratorFrom scratch
HRDR007ErrorA parameter typed as a service class is read from the request body. The class carries [SingletonService], [ScopedService] or [TransientService], or each of its public constructors takes an interfaceGeneratorRegistering services
HRDR008ErrorTwo routing generators compile one project, such as Hardened.Web.SourceGenerator and the one Hardened.OpenApi.SourceGenerator bringsGeneratorGenerating from OpenAPI
HRDR009ErrorMore than one parameter binds from the request bodyGeneratorParameter binding
HRDR010WarningA parameter binds from the body of a GET, HEAD, OPTIONS or TRACE handlerGeneratorParameter binding
HRDR011ErrorA handler answers with byte[] or Stream, bare or as the success case of a response set, and carries no [Produces]GeneratorContent negotiation
HRDR012WarningA handler returns a model and declares a media type that nothing in the compilation or its references writes, with [Produces] or in its OpenAPI or Smithy contractGeneratorContent negotiation
HRDR013WarningA route attribute sits on an interface member. No route is compiled for itGeneratorRouting
HRDR014ErrorA lambda route registration the build cannot read: the handler is not a lambda written in the call, or the verb is not a constantGeneratorRegistered routes

The HRDR004 message says to move shared handlers into a [WebLibrary] project. Nothing reads the attribute. Handlers that several applications share go in a project with its own [HardenedModule] class. Each application imports that module, as src/Todos.Host imports src/Todos in the hardened-web template.

HRDW ​

IdSeverityReported whenReported byPage
HRDW002ErrorA handler binds a [FromForm] parameter and a request body parameterGeneratorForms and files
HRDW003ErrorA handler declares [Compress] more than once: on the method and on its class, or both [Compress] and [Compress<T>]GeneratorCompression
HRDW004ErrorA handler that does not return IAsyncEnumerable<T> carries [ServerSentEvents], or [Produces("text/event-stream")] on its method or its classGeneratorStreaming responses
HRDW005WarningA handler declares [CacheResponse], and the application module applies [KestrelRuntime] or [AspNetCoreRuntime] and registers no response cache storeGeneratorResponse caching
HRDW006ErrorA [Timeout] that covers a handler declares zero milliseconds or lessGeneratorRequest timeouts
HRDW007ErrorA [FromQueryString] or [FromForm] model cannot be built from fieldsGeneratorParameter binding
HRDW008ErrorAn IFormFile parameter is bound from anywhere but [FromForm]GeneratorForms and files
HRDW009WarningA [CacheResponse<VaryByQuery>] key names no query key the operation bindsGeneratorResponse caching

HRDRM ​

IdSeverityReported whenReported byPage
HRDRM003ErrorA response case is object or dynamicGeneratorDeclared responses
HRDRM004ErrorTwo response cases at different statuses, where one type is assignable to the otherGeneratorDeclared responses

HRDT ​

Two diagnostics share the id HRDT001. The web generator reports one as an error. The targets of the testing package report the other as a warning.

IdSeverityReported whenReported byPage
HRDT001Error[Throws<T>] names a type without [HttpStatus] and states no statusGeneratorDeclared responses
HRDT001WarningA test project references Hardened.Shared.Testing and none of DependencyModules.xUnit, DependencyModules.xUnit4 and DependencyModules.NUnitPackage targetsWriting a test

HRDSC ​

IdSeverityReported whenReported byPage
HRDSC001Warning[HttpAuthenticationScheme], [ApiKeyAuthenticationScheme] or [OAuth2AuthenticationScheme] sits on a handler method, a controller class or a module class, where nothing reads itGeneratorAuthentication

HRDV ​

IdSeverityReported whenReported byPage
HRDV005ErrorA constraint on a handler parameter sets When or UnlessGeneratorValidation
HRDV006WarningA project declares constraints on a handler and does not reference ValidationModules.SourceGeneratorGeneratorValidation

HRDOA ​

The web generator reports HRDOA001 to HRDOA005 for the document that a code-first project serves.

IdSeverityReported whenReported byPage
HRDOA001Error<HardenedOpenApiVersion> is not 3.0, 3.1 or 3.2, with or without a trailing .0GeneratorThe OpenAPI document
HRDOA002WarningA handler streams its response, and the document version is below 3.2GeneratorThe OpenAPI document
HRDOA003WarningA module with [Enable<OpenApiDocumentPublishing>] declares no routes, so the document it serves has no pathsGeneratorThe OpenAPI document
HRDOA004ErrorTwo handlers declare the same [Operation] idGeneratorThe OpenAPI document
HRDOA005WarningTwo different types publish under one schema nameGeneratorThe OpenAPI document

The build task that writes that document to a file reports HRDOA018, HRDOA019 and HRDOA028 to HRDOA031. HOAT and HSMT lists them with the HOAT and HSMT codes of the same numbers.

HRDF ​

IdSeverityReported whenReported byPage
HRDF001ErrorHandlers use a trigger that no referenced package binds, while a referenced package binds another triggerGeneratorTriggers
HRDF002WarningTwo sources of one kind give the same test façade method name, so only one of them can be reached through the façadeGeneratorTesting functions
HRDF003InfoA bound adapter module serves no trigger the project usesGeneratorTriggers

HRDAZ ​

IdSeverityReported whenReported byPage
HRDAZ001ErrorDeclared and never reported: every trigger the Azure Functions generator serves has a bindingGeneratorNone
HRDAZ002ErrorTwo handlers give the same Azure function name, such as [Queue("orders-new")] and [Queue("orders_new")]GeneratorAzure Overview
HRDAZ003ErrorA binding needs a setting that the module attribute on the application does not supply: Subscription for [Topic], Database for [Change], or RetryCount without RetryDelay, or the reverseGeneratorAzure Overview
HRDAZ004ErrorA setting the binding reads is written on the module attribute as anything but a string literal, true, false or a whole number in digits. A constant in any class is refused, and so is RetryCount = -1GeneratorAzure Overview
HRDAZ010ErrorAn executable that is not a test project references Hardened.Azure.Functions.Runtime and not Microsoft.Azure.Functions.Worker.SdkPackage targetsAzure Overview

The HRDAZ004 message asks for an integer literal. The generator refuses -1 with that message. A warning CS1998 in the generated Application.AzureFunctions.cs comes with HRDAZ003 and HRDAZ004. This output is from a project made with dotnet new hardened-function --host azure --trigger stream:

text
CSC : error HRDAZ004: Connection on [EventHubsModule] is written as global::Orders.Application.Connection, and the function metadata the host indexes needs its value at build. Write it as a string literal, an integer literal, or true or false.
CSC : error HRDAZ004: RetryCount on [EventHubsModule] is written as -1, and the function metadata the host indexes needs its value at build. Write it as a string literal, an integer literal, or true or false.
src/Orders/obj/Debug/net8.0/generated/Hardened.Azure.Functions.SourceGenerator/Hardened.Azure.Functions.SourceGenerator.AzureFunctionsSourceGenerator/Application.AzureFunctions.cs(23,63): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

HRDGF ​

IdSeverityReported whenReported byPage
HRDGF001WarningA Cloud Functions assembly holds more than one application. The message names the entry types to choose fromGeneratorGoogle Cloud Web services
HRDGF002WarningAn executable references Hardened.Gcp.Functions.Runtime and does not reference Google.Cloud.Functions.Hosting itself, and does not set AutoGenerateEntryPointPackage targetsGoogle Cloud Web services

HTPL ​

IdSeverityReported whenReported byPage
HTPL001ErrorThe project was scaffolded with hardened-web --host aws-lambda --response-model unionTemplateProject templates
HTPL002ErrorThe Kiota tool does not restoreTemplateGenerated clients
HTPL003ErrorThe Kiota tool and KiotaBundleVersion name different Kiota releasesTemplateGenerated clients
HTPL004ErrorThe Refitter tool does not restoreTemplateGenerated clients
HTPL005ErrorThe project was scaffolded with hardened-function --host gcp --trigger streamTemplateProject templates
HTPL006ErrorThe project was scaffolded with hardened-function --host azure --trigger invokeTemplateProject templates
HTPL007ErrorThe project was scaffolded with hardened-web --host azure-functions --response-model unionTemplateProject templates
HTPL008ErrorThe project was scaffolded with hardened-web --contract smithy and --serializer message-pack-named or message-pack-keyedTemplateProject templates

Each of HTPL001 and HTPL005 to HTPL008 is in a project only when the project was scaffolded with the options in its row. The templates write the checks into the projects they scaffold:

Written intoCodes
Directory.Build.props of a hardened-web projectHTPL001, HTPL007, HTPL008
Directory.Build.props of a hardened-function projectHTPL005, HTPL006
The Kiota client projectHTPL002, HTPL003
The Refitter client projectHTPL004

Each check is an MSBuild Error task in that file, so no setting in the suppression table turns one off.

HSTATIC ​

Hardened.Web.StaticContent reports these codes while it builds the manifest of the files that a HardenedStaticContent item names.

IdSeverityReported whenReported byPage
HSTATIC000ErrorThe static content directory cannot be readBuild taskNone
HSTATIC001ErrorThe directory the item names does not existBuild taskNone
HSTATIC002ErrorA file in the directory resolves to a path outside itBuild taskNone
HSTATIC003WarningA hidden file, or one that looks like a secret, is left out of the manifest and is not servedBuild taskNone
HSTATIC004WarningThe directory is emptyBuild taskNone
HSTATIC005ErrorThe fallback file is not in the directoryBuild taskNone
HSTATIC006ErrorHardened.Web.StaticContent.targets was imported before the HardenedStaticContent items were declaredPackage targetsNone
HSTATIC007ErrorThe manifest was not written. The message says to delete obj/<configuration>/<framework>/staticcontent and rebuildPackage targetsNone
HSTATIC008ErrorA .gz or .br file does not decompressBuild taskNone
HSTATIC009ErrorA .br file is in a build that Visual Studio's MSBuild runs, which cannot decompress BrotliBuild taskNone

HARDENED ​

IdSeverityReported whenReported byPage
HARDENED001ErrorA project compiles the Hardened.SourceGenerator source package, with PackageHardenedIncludeSource set to true, and pins a CSharpAuthor version below 2.0.0. A prerelease or floating pin is not comparedPackage targetsNone

HardenedException ​

IdSeverityReported whenReported byPage
HardenedExceptionErrorA Hardened generator threw while it wrote the source for one item. The message carries the exceptionGeneratorNone

The generator writes nothing for that item. Compiler errors follow for the code it should have written. This output is from a project made with dotnet new hardened-function --host azure --trigger stream, with the handler's [Stream("orders")] changed to [Stream("orders:eu")]:

text
CSC : error HardenedException: The generator threw and produced no source: ArgumentException: The hintName 'STREAM.orders:eu.FunctionHandler.cs' contains an invalid character ':' at position 13. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Void Add(System.String, Microsoft.CodeAnalysis.Text.SourceText)
src/Orders/obj/Debug/net8.0/generated/Hardened.Function.SourceGenerator/Hardened.Function.SourceGenerator.FunctionLibrarySourceGenerator/Application.FunctionHandlers.cs(42,61): error CS0234: The type or namespace name 'OrderHandler_OnOrder_664' does not exist in the namespace 'Orders.Generated' (are you missing an assembly reference?)

HOAT and HSMT ​

A number names the same condition under HOAT and HSMT. The number 026 names two conditions under both.

For <HardenedOpenApiOutput>, a build task writes the served document to a file. That task reports under HRDOA in a code-first project. It reports under HOAT in an OpenAPI-first project and under HSMT in a Smithy-first one.

The OpenAPI and Smithy build tasks run only when their output under obj is missing, or when the description, its item, a build property they read or the package changed since the last build. A build that skips the tasks prints none of their warnings. dotnet build --no-incremental skips them too. They run again after the model folder, such as obj/Debug/net8.0/openapi, is deleted.

Both 026 warnings print in one build of a project made with dotnet new hardened-web -n Todos --contract openapi --client none. Its contracts/todos.yaml has the removeTodo operation's parameter renamed from id to Id. The build runs as dotnet build src/Todos -p:HardenedResponseModel=Standard. This listing shortens the package path:

text
.../build/Hardened.OpenApi.SourceGenerator.targets(211,9): warning HOAT026: $(HardenedResponseModel) is 'Standard', which was renamed 'Throws' in 0.19.0. The mode selected is unchanged; write <HardenedResponseModel>Throws</HardenedResponseModel>.
src/Todos/contracts/todos.yaml : warning HOAT026: 'DELETE /todos/{id}' declares '{id}' and the operation declares no path parameter of that name - 'Id' differs from it only in case. The route still matches and the value is discarded, so the handler cannot read the segment that chose the resource. Declare the parameter, or take the token out of the path.

The same build then fails with compiler errors, because the scaffold's TodoService implements the interface that the Response model generates.

Reading the description ​

NumberSeverityReported whenReported byCodes and pages
001ErrorThe file an item names does not existBuild taskHOAT001: Generating from OpenAPI. HSMT001: none
002ErrorThe description cannot be read. For OpenAPI, also an x-hardened-timeout of zero or less, or an x-hardened-validation that is not stop-on-first-error or collect-all. For Smithy, also a model with no service or no operation, a refused protocol, or a HardenedSmithyServiceShapeId the model does not declareBuild taskHOAT002: Generating from OpenAPI. HSMT002: Generating from Smithy
003ErrorThe description is declared as the wrong item: a .yaml file as AdditionalFiles with no HardenedOpenApiSpec item, or a .smithy file as HardenedSmithyAstPackage targetsHOAT003: Generating from OpenAPI. HSMT003: Generating from Smithy
004ErrorA model file or a generated source file that the build task writes is missing. The message says to delete the model folder and rebuildPackage targetsHOAT004: Generating from OpenAPI. HSMT004: Generating from Smithy
005ErrorThe package's .targets file is imported by hand above the items that declare the descriptionsPackage targetsHOAT005 and HSMT005: none
006WarningThe reader reports a problem in a description it could read. For OpenAPI, among others, scopes on a scheme that carries none. For Smithy, among others, a member narrowed to decimal or long, a trait it does not model, a @timeout of zero or less, or, in a committed AST, an @validation that is not stop-on-first-error or collect-allBuild taskHOAT006: Generating from OpenAPI. HSMT006: Generating from Smithy
007ErrorA slice keeps no operationBuild taskHOAT007: Generating from OpenAPI. HSMT007: none
008WarningA slice removed a schema that is still referenced. The reference becomes JsonElementBuild taskHOAT008 and HSMT008: none
009WarningA sliced description is embedded wholeBuild taskHOAT009: Generating from OpenAPI. HSMT009: none
016ErrorUiUrl is set without PublishUrlBuild taskHOAT016 and HSMT016: The OpenAPI document
017ErrorSourceUrl is set and the description is not embeddedBuild taskHOAT017 and HSMT017: The OpenAPI document
026WarningHardenedResponseModel is Standard. The build uses ThrowsBuild taskHOAT026 and HSMT026: none

The Smithy CLI and model items ​

010 to 015 exist under HSMT only.

NumberSeverityReported whenReported byCodes and pages
010ErrorThe Smithy CLI is on neither PATH nor HardenedSmithyCliPathBuild taskHSMT010: Generating from Smithy
011Warning, or Error when HardenedSmithyPinCliVersion is trueThe CLI's version is not HardenedSmithyCliVersion. An error also when smithy --version failsBuild taskHSMT011: Generating from Smithy
012ErrorThe CLI refuses the model. One error for each findingBuild taskHSMT012: Generating from Smithy
013WarningThe CLI succeeds and reports a warningBuild taskHSMT013: Generating from Smithy
014ErrorThe CLI succeeds and writes no ASTBuild taskHSMT014: Generating from Smithy
015ErrorThe HardenedSmithyModel items name more than one PublishUrl, or more than one UiUrlPackage targetsHSMT015: Generating from Smithy

Checks on the model ​

NumberSeverityReported whenReported byCodes and pages
020WarningA schema declares a property named like the schema itself. The member is renamed, and the wire name is unchangedBuild taskHOAT020 and HSMT020: Generating from OpenAPI
021WarningTwo schemas still generate one type name after the build's own renamingBuild taskHOAT021 and HSMT021: none
022WarningA oneOf with no discriminator has branches that its shapes cannot tell apartBuild taskHOAT022 and HSMT022: Generating from OpenAPI
023ErrorAn enum declares both string and numeric valuesBuild taskHOAT023 and HSMT023: Generating from OpenAPI
024WarningA keyword or trait is declared, and the generated code does not enforce it. One warning for each keywordBuild taskHOAT024 and HSMT024: Generating from OpenAPI
026WarningA path names a token that the operation declares no path parameter forBuild taskHOAT026 and HSMT026: Generating from OpenAPI
027ErrorA reference names something the description does not declareBuild taskHOAT027 and HSMT027: Generating from OpenAPI
032WarningAn OpenAPI 3.1 or later document declares nullableBuild taskHOAT032: Generating from OpenAPI. HSMT032: none
033ErrorUnder HardenedSerializer MessagePackKeyed, a property has no x-message-pack-index, or two properties share oneBuild taskHOAT033: MessagePack. HSMT033: none
034WarningA oneOf schema under a MessagePack serializerBuild taskHOAT034: MessagePack. HSMT034: none
035ErrorA committed AST's @paginated names a member the operation does not have, or one of the wrong typeBuild taskHSMT035: Generating from Smithy. HOAT035: none

No build reports HSMT032, because only the OpenAPI reader records nullable. No build reports HOAT035, because only the Smithy reader records @paginated.

Writing the served document to a file ​

NumberSeverityReported whenReported byCodes and pages
018Error<HardenedOpenApiOutput> is set, and the assembly serves no document, or one the task cannot readBuild taskHRDOA018, HOAT018 and HSMT018: The OpenAPI document
019Error<HardenedOpenApiOutput> is set, and the assembly serves more than one documentBuild taskHRDOA019, HOAT019 and HSMT019: The OpenAPI document
028ErrorThe <HardenedOpenApiOutput> path does not end in .json, .yaml or .ymlBuild taskHRDOA028, HOAT028 and HSMT028: The OpenAPI document
029Error<HardenedOpenApiOutputVersion> is not 3.0 or 3.1, with or without a trailing .0Build taskHRDOA029, HOAT029 and HSMT029: The OpenAPI document
030Warning<HardenedOpenApiOutputVersion> lowers the file, and an operation streams its response. One warning for each such operationBuild taskHRDOA030, HOAT030 and HSMT030: The OpenAPI document
031WarningThe served document puts more than one operation under one method at one pathBuild taskHRDOA031 and HOAT031: none. HSMT031: Generating from Smithy

Next ​

Released under the MIT License.