Skip to content

[aspnetcore] Add support for .NET 10 - #25161

Closed
jonekdahl wants to merge 3 commits into
OpenAPITools:masterfrom
jonekdahl:aspnetcore-dotnet-10
Closed

jonekdahl wants to merge 3 commits into
OpenAPITools:masterfrom
jonekdahl:aspnetcore-dotnet-10

Conversation

@jonekdahl

@jonekdahl jonekdahl commented Oct 6, 2026 •

Copy link
Copy Markdown

This PR adds for .NET 10, similar to how .NET 8 support was added previously.

I found issue #23402 which mentions .NET 10 support but has a much larger scope, this PR is just adding support for .NET 10 in the existing template.

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Adds .NET 10.0 support to the aspnetcore generator so generated servers can target net10.0. The aspnetCoreVersion option now accepts 10.0, the Swashbuckle version option now includes 10.2.3, and the Dockerfile templates no longer pin a distro-specific image tag.

  • Adds sample configs and regenerated Petstore servers for ASP.NET Core 10.0 across all generator option combinations.
  • Adds a CI workflow that builds the .NET 10 sample servers.
  • Updates the generator docs to list ASP.NET Core 10.0 as a supported version.

Written for commit 197be13. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

60 issues found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile:4">
P1: Docker cannot pull .NET 10 images from the legacy `dotnet/core` path, so this sample's image build fails. Switch both base references to `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0`.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile:14">
P1: The documented `docker build` context makes this `COPY` source path unavailable, so the build fails at this instruction; the second `COPY` has the same mismatch. Use paths relative to the project-directory context or change the build context to the sample root.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj:19">
P1: Swashbuckle 10.2.3 uses OpenAPI.NET 2.x, which no longer provides `Microsoft.OpenApi.Models`; this project’s `Startup.cs` and generated filters still import it, so the sample fails to compile. Update the generated OpenAPI namespace usages before raising the package version.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Dockerfile:4">
P1: Both stages use the legacy `dotnet/core` image repository, which has no .NET 10 tags, so Docker cannot resolve either base image. Use `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Dockerfile:4">
P1: The .NET 10 base-image references use the retired `dotnet/core` namespace, so the documented Docker build cannot pull either stage. Change both references to `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0`.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Dockerfile:6">
P2: The application listens on port 8080, but the image exposes 80 and 443; `docker run -P` therefore does not publish the listening port. Expose 8080 instead.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Dockerfile:4">
P1: The .NET 10 images are not published under the retired `dotnet/core` namespace, so Docker cannot resolve either base image. Use `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0`.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Dockerfile:14">
P2: The documented `docker build` command uses `src/Org.OpenAPITools` as its context, but this `COPY` expects the sample root and fails to find the project file. Use the sample root as the Docker build context or update the COPY paths and related project paths to match the documented context.</violation>

<violation number="3" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Dockerfile:17">
P1: `dotnet restore` cannot resolve the `Org.OpenAPITools.Models` project reference because this Dockerfile never copies that project into the build image. Copy its `.csproj` before restore and its sources before build.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Org.OpenAPITools.csproj">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Org.OpenAPITools.csproj:19">
P1: Swashbuckle 10.2.3 uses Microsoft.OpenApi 2.x, which removed `Microsoft.OpenApi.Models`; the generated `Startup.cs` still imports that namespace, so this sample will not compile. Update the generated OpenAPI namespaces alongside this package upgrade.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Org.OpenAPITools.csproj">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Org.OpenAPITools.csproj:19">
P1: Swashbuckle 10.2.3 uses OpenAPI.NET 2, but this sample still imports `Microsoft.OpenApi.Models`, so the project fails to compile. Update the generated sources to the new namespace/API when enabling this package version.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs:30">
P1: `JsonSubtypes.KnownSubType` does not configure `System.Text.Json` polymorphism, so deserializing an `Animal` payload produces an `Animal` and drops subtype fields. Add `System.Text.Json` polymorphism metadata or register a compatible converter.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/README.md:47">
P2: This changes the build context to `src/Org.OpenAPITools`, but the Dockerfile’s `COPY` instructions require the sample root, so the documented build fails with missing files. Build from the sample root and pass the Dockerfile path explicitly.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs:86">
P2: `Cat.Equals` ignores the inherited `ClassName` and `Color` properties, so cats with different animal data compare equal. Include the base equality and hash contributions.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Dockerfile:4">
P1: The .NET 10 images are published under `mcr.microsoft.com/dotnet/{aspnet,sdk}:10.0`, not the legacy `/dotnet/core/` repositories, so Docker cannot resolve either `FROM` image. Use the current image paths in both stages.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Dockerfile:14">
P2: The documented `docker build .` uses the project directory as its context, so this `COPY` cannot find `src/Org.OpenAPITools/Org.OpenAPITools.csproj` and the build fails. Align both `COPY` sources with that context or change the documented build context.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/README.md:47">
P2: This build context makes the Dockerfile's `COPY src/Org.OpenAPITools/...` paths unavailable, so `docker build` fails. Build from the sample root and specify the Dockerfile path.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Dog.cs:81">
P2: `Dog.Equals(Dog)` ignores `Animal.ClassName` and `Animal.Color`, so dogs with different inherited state compare equal. Include the base equality and incorporate base state into `GetHashCode()`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/README.md:47">
P2: This changes the build context to `src/Org.OpenAPITools`, but the Dockerfile’s `COPY src/Org.OpenAPITools/...` paths are relative to the sample root, so the documented build fails. Keep the sample root as context and pass the Dockerfile path explicitly.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Org.OpenAPITools.csproj">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Org.OpenAPITools.csproj:15">
P2: This enables central package management, but the sample has no `Directory.Packages.props` to supply versions for its unversioned `PackageReference`s, so `dotnet restore` fails. Add a `Directory.Packages.props` with versions for each referenced package.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:100">
P2: The sample's `GetOrderById` parameter has `[Range(1, 5)]` and this filter is registered in `Startup`, but these assignments put string-only constraints on an integer schema and omit the numeric range. Set `Schema.Minimum` and `Schema.Maximum` instead.</violation>
</file>

<file name="modules/openapi-generator/src/main/resources/aspnetcore/3.0/Dockerfile.mustache">

<violation number="1" location="modules/openapi-generator/src/main/resources/aspnetcore/3.0/Dockerfile.mustache:4">
P1: The .NET 10 images are not published under the legacy `dotnet/core` repositories, so generated .NET 10 Docker builds fail to pull both base images. Use `mcr.microsoft.com/dotnet/aspnet` and `mcr.microsoft.com/dotnet/sdk` for the runtime and SDK stages.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs:61">
P1: Endpoint-routing authorization supplies `HttpContext` as `context.Resource`, so this branch skips valid API keys whenever the policy runs through `AuthorizationMiddleware`. Accept `HttpContext` as well as `AuthorizationFilterContext`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/build.bat:8">
P2: The suggested command selects `web`, but this sample defines only `IIS Express`, `OpenAPI`, and `Docker` launch profiles, so the command cannot select the intended profile. Print `--launch-profile OpenAPI` and remove the trailing period.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs:81">
P2: `Dog.Equals` ignores inherited `ClassName` and `Color`, so dogs with different Animal state compare equal. Include `base.Equals(other)` in the comparison and `base.GetHashCode()` in the hash code.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/README.md:47">
P2: This makes `src/Org.OpenAPITools` the build context, so the Dockerfile's `COPY src/Org.OpenAPITools/...` paths cannot be found and the documented build fails. Run the build from the sample root with `-f src/Org.OpenAPITools/Dockerfile`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Cat.cs:80">
P2: `Cat.Equals` ignores the inherited `ClassName` and `Color` values, so cats with different base properties compare equal. Include `base.Equals(other)` in the derived equality check.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs:79">
P2: `Dog` equality ignores inherited `Animal` properties, so dogs with the same `Breed` but different `ClassName` or `Color` compare equal. Include `base.Equals(other)` in this return condition.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-useSwashBuckle/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-useSwashBuckle/build.sh:8">
P2: This project is a library with no executable entry point, so the printed `dotnet run` command cannot start the sample. Replace it with accurate instructions for hosting the generated library, or add a runnable host project.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-useSwashBuckle/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-useSwashBuckle/build.bat:8">
P2: The suggested `dotnet run` command cannot start this sample because its project builds as a library and has no entry point. Make the project executable with a startup entry point, or remove this run instruction.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Dog.cs:81">
P2: `Equals(Dog)` ignores the inherited `ClassName` and `Color`, so dogs with the same breed but different base state compare equal. Include the base equality and hash code when comparing `Dog` instances.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:64">
P2: A `StringLength` attribute with only `ErrorMessage` has one named argument, so this branch calls `Single` for a missing `MinimumLength` and throws during Swagger generation. Check the member name instead.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:97">
P2: This treats every range as two `int`s and writes them as string-length constraints: the current `[Range(1, 5)]` loses its numeric bounds, and decimal ranges throw during Swagger generation. Convert the bounds and assign `Minimum`/`Maximum`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Cat.cs:79">
P2: `Cat.Equals(Cat)` compares only `Declawed`, so cats with different inherited `ClassName` or `Color` compare equal. Include `base.Equals(other)` in this comparison.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs:53">
P2: This strips `/v2` from every documented operation without adding it as an OpenAPI server URL, so Swagger UI calls `/pet...` while the controllers only serve `/v2/pet...`. Keep the prefix in the paths or add a matching `OpenApiServer` entry.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs:61">
P2: Endpoint-routing authorization supplies an `HttpContext` resource, so this branch never validates a key when the authorization middleware runs the policy. Accept `HttpContext` as well as `AuthorizationFilterContext` and read its request headers.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:97">
P2: These casts only accept `int` constructor arguments; a valid `[Range(0.5, 1.5)]` uses the `double` overload and throws `InvalidCastException` during Swagger generation. Handle the `RangeAttribute` overload and convert its bounds to numeric schema values instead of unboxing them as integers.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/README.md:47">
P2: The Docker build uses a context that does not contain the paths referenced by the Dockerfile, so this documented command fails at `COPY`. Build from the sample root and pass the Dockerfile path instead.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs:79">
P2: `Equals(Cat)` ignores inherited `ClassName` and `Color`, so cats with different Animal state compare equal. Include the base equality and hash state in these overrides.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/README.md:47">
P2: The Docker build uses the project directory as its context, but the Dockerfile expects paths rooted at the sample directory, so the `COPY` steps fail. Build from the sample root and pass the Dockerfile with `-f`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs:4">
P2: The sample configures this requirement with `my-secret-key`, so this handler rejects the advertised `special-key`. Align the configured key with the documented key, or correct the sample documentation.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:100">
P2: The `[Range(1, 5)]` constraint on `orderId` is written to string-length fields, so the integer parameter's OpenAPI schema omits its bounds. Set `Minimum` and `Maximum` instead.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:100">
P2: `[Range]` describes a numeric interval, but these assignments use string-length keywords; the sample’s `long orderId` therefore exposes no 1–5 numeric bound in OpenAPI. Assign the bounds to `Schema.Minimum` and `Schema.Maximum`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Dockerfile:4">
P2: These .NET 10 tags use the legacy `dotnet/core` image namespace, so Docker cannot pull either stage and the documented image build fails. Use the `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0` images for these stages.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Animal.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Animal.cs:29">
P2: The discriminator metadata uses `ClassName`, but the JSON and OpenAPI property is `className`, so generated polymorphism metadata points to the wrong field. Use `className` in both discriminator attributes.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Filters/BasePathFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Filters/BasePathFilter.cs:45">
P2: `Apply` strips `/v2` from documented paths without preserving it in the OpenAPI server URL, so Swagger UI targets `/pet` instead of the controller's `/v2/pet` route. Add an `OpenApiServer` using `BasePath` before rewriting the paths.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/build.sh:8">
P2: The printed run command selects the nonexistent `web` profile, so the sample's configured launch settings are not applied. Use `OpenAPI`, the project profile defined in `launchSettings.json`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/build.sh:8">
P2: The suggested command uses a `web` launch profile, but this sample defines only `IIS Express`, `OpenAPI`, and `Docker`; running it fails to select a profile. Change the instruction to use `--launch-profile OpenAPI`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/build.sh:8">
P2: The printed command references a `web` launch profile, but this sample defines only `OpenAPI`, `IIS Express`, and `Docker`; replace `web` with `OpenAPI` so users can start the project as instructed.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs:32">
P2: System.Text.Json ignores `DataMember.Name`, so the lower-camel-case JSON in `FakeApi` does not bind to these Pascal-case properties and the example endpoint returns null values; `ToJson()` also emits Pascal-case keys. Add `JsonPropertyName` attributes to both properties.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs:81">
P2: `Cat.Equals` ignores inherited `Animal` state, so cats with different colors or class names compare equal; `GetHashCode` also omits that state. Include the base equality and hash code in these overrides.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/build.sh:8">
P2: The printed run command selects a nonexistent `web` launch profile, so following the script's instructions fails. Change it to the defined `OpenAPI` profile.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/build.bat:8">
P2: The suggested run command names a `web` launch profile, but this sample defines `OpenAPI` instead. Print `--launch-profile OpenAPI` so users can start the sample with the provided command.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/ApiResponse.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/ApiResponse.cs:70">
P2: `ToJson()` emits `Code`, `Type`, and `Message` instead of the schema keys `code`, `type`, and `message`; set this serializer's naming policy to camel case.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Category.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Category.cs:64">
P2: `ToJson()` emits `Id`/`Name` and includes a null optional `Name`; `System.Text.Json` does not honor these `DataMember` attributes. Configure camel-case naming and null omission so this helper matches the `id`/`name` JSON contract.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs:84">
P2: `Dog.Equals(Dog)` ignores `Animal.ClassName` and `Animal.Color`, so Dogs with different inherited state compare equal. Include `base.Equals(other)` in this comparison.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/build.bat:8">
P2: The suggested command selects a `web` launch profile, but this sample only defines `OpenAPI`, `IIS Express`, and `Docker`; use `OpenAPI` so the documented command applies the sample's launch settings.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs:49">
P2: Raw enum values are not escaped before being wrapped as JSON, so values containing quotes or control characters fail conversion. Serialize `s` to JSON before deserializing it.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:64">
P2: This assumes the only named `StringLength` argument is `MinimumLength`; an `ErrorMessage`-only attribute throws here, and an `ErrorMessage` alongside `MinimumLength` skips the minimum. Test for a `MinimumLength` member instead of counting named arguments.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:100">
P2: This stores numeric `[Range]` bounds as string `minLength`/`maxLength`, so `GetOrderById` loses its numeric constraints in OpenAPI. The `int` casts also fail for valid floating-point ranges; map supported range overloads to numeric `Minimum`/`Maximum` values.</violation>
</file>

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Reply to a comment to ask cubic a question or push back. It learns from your replies.

Turn on auto-fix | Re-trigger cubic


# Copy the code into the container
WORKDIR /src
COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The documented docker build context makes this COPY source path unavailable, so the build fails at this instruction; the second COPY has the same mismatch. Use paths relative to the project-directory context or change the build context to the sample root.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile, line 14:

<comment>The documented `docker build` context makes this `COPY` source path unavailable, so the build fails at this instruction; the second `COPY` has the same mismatch. Use paths relative to the project-directory context or change the build context to the sample root.</comment>

<file context>
@@ -0,0 +1,32 @@
+
+# Copy the code into the container
+WORKDIR /src
+COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"]
+
+# NuGet restore
</file context>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.2.3" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Swashbuckle 10.2.3 uses OpenAPI.NET 2.x, which no longer provides Microsoft.OpenApi.Models; this project’s Startup.cs and generated filters still import it, so the sample fails to compile. Update the generated OpenAPI namespace usages before raising the package version.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Org.OpenAPITools.csproj, line 19:

<comment>Swashbuckle 10.2.3 uses OpenAPI.NET 2.x, which no longer provides `Microsoft.OpenApi.Models`; this project’s `Startup.cs` and generated filters still import it, so the sample fails to compile. Update the generated OpenAPI namespace usages before raising the package version.</comment>

<file context>
@@ -0,0 +1,26 @@
+    <ItemGroup>
+        <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
+        <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
+        <PackageReference Include="Swashbuckle.AspNetCore" Version="10.2.3" />
+        <PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="10.2.3" />
+        <PackageReference Include="JsonSubTypes" Version="1.8.0" />
</file context>

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

# Container we use for final publish
FROM mcr.microsoft.com/dotnet/core/aspnet:10.0 AS base

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Both stages use the legacy dotnet/core image repository, which has no .NET 10 tags, so Docker cannot resolve either base image. Use mcr.microsoft.com/dotnet/aspnet:10.0 and mcr.microsoft.com/dotnet/sdk:10.0.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Dockerfile, line 4:

<comment>Both stages use the legacy `dotnet/core` image repository, which has no .NET 10 tags, so Docker cannot resolve either base image. Use `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0`.</comment>

<file context>
@@ -0,0 +1,32 @@
+#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
+
+# Container we use for final publish
+FROM mcr.microsoft.com/dotnet/core/aspnet:10.0 AS base
+WORKDIR /app
+EXPOSE 80
</file context>

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

# Container we use for final publish
FROM mcr.microsoft.com/dotnet/core/aspnet:10.0 AS base

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The .NET 10 base-image references use the retired dotnet/core namespace, so the documented Docker build cannot pull either stage. Change both references to mcr.microsoft.com/dotnet/aspnet:10.0 and mcr.microsoft.com/dotnet/sdk:10.0.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Dockerfile, line 4:

<comment>The .NET 10 base-image references use the retired `dotnet/core` namespace, so the documented Docker build cannot pull either stage. Change both references to `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0`.</comment>

<file context>
@@ -0,0 +1,32 @@
+#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
+
+# Container we use for final publish
+FROM mcr.microsoft.com/dotnet/core/aspnet:10.0 AS base
+WORKDIR /app
+EXPOSE 80
</file context>

COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"]

# NuGet restore
RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: dotnet restore cannot resolve the Org.OpenAPITools.Models project reference because this Dockerfile never copies that project into the build image. Copy its .csproj before restore and its sources before build.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Dockerfile, line 17:

<comment>`dotnet restore` cannot resolve the `Org.OpenAPITools.Models` project reference because this Dockerfile never copies that project into the build image. Copy its `.csproj` before restore and its sources before build.</comment>

<file context>
@@ -0,0 +1,32 @@
+COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"]
+
+# NuGet restore
+RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj"
+COPY ["src/Org.OpenAPITools/", "Org.OpenAPITools/"]
+
</file context>


dotnet restore src\Org.OpenAPITools
dotnet build src\Org.OpenAPITools
echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The suggested command selects a web launch profile, but this sample only defines OpenAPI, IIS Express, and Docker; use OpenAPI so the documented command applies the sample's launch settings.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/build.bat, line 8:

<comment>The suggested command selects a `web` launch profile, but this sample only defines `OpenAPI`, `IIS Express`, and `Docker`; use `OpenAPI` so the documented command applies the sample's launch settings.</comment>

<file context>
@@ -0,0 +1,9 @@
+
+dotnet restore src\Org.OpenAPITools
+dotnet build src\Org.OpenAPITools
+echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web.
+echo.
</file context>
Suggested change
echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web.
echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile OpenAPI

return null;
}

return JsonConvert.DeserializeObject<T>(@"""" + value + @"""");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Raw enum values are not escaped before being wrapped as JSON, so values containing quotes or control characters fail conversion. Serialize s to JSON before deserializing it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs, line 49:

<comment>Raw enum values are not escaped before being wrapped as JSON, so values containing quotes or control characters fail conversion. Serialize `s` to JSON before deserializing it.</comment>

<file context>
@@ -0,0 +1,52 @@
+                return null;
+            }
+
+            return JsonConvert.DeserializeObject<T>(@"""" + value + @"""");
+        }
+    }
</file context>
Suggested change
return JsonConvert.DeserializeObject<T>(@"""" + value + @"""");
return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(s));

Comment on lines +6 to +7
EXPOSE 80
EXPOSE 443

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The application listens on port 8080, but the image exposes 80 and 443; docker run -P therefore does not publish the listening port. Expose 8080 instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Dockerfile, line 6:

<comment>The application listens on port 8080, but the image exposes 80 and 443; `docker run -P` therefore does not publish the listening port. Expose 8080 instead.</comment>

<file context>
@@ -0,0 +1,32 @@
+# Container we use for final publish
+FROM mcr.microsoft.com/dotnet/core/aspnet:10.0 AS base
+WORKDIR /app
+EXPOSE 80
+EXPOSE 443
+
</file context>
Suggested change
EXPOSE 80
EXPOSE 443
EXPOSE 8080

var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute));
if (stringLengthAttr != null)
{
if (stringLengthAttr.NamedArguments.Count == 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This assumes the only named StringLength argument is MinimumLength; an ErrorMessage-only attribute throws here, and an ErrorMessage alongside MinimumLength skips the minimum. Test for a MinimumLength member instead of counting named arguments.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs, line 64:

<comment>This assumes the only named `StringLength` argument is `MinimumLength`; an `ErrorMessage`-only attribute throws here, and an `ErrorMessage` alongside `MinimumLength` skips the minimum. Test for a `MinimumLength` member instead of counting named arguments.</comment>

<file context>
@@ -0,0 +1,107 @@
+                    var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute));
+                    if (stringLengthAttr != null)
+                    {
+                        if (stringLengthAttr.NamedArguments.Count == 1)
+                        {
+                            minLength = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value;
</file context>
Suggested change
if (stringLengthAttr.NamedArguments.Count == 1)
if (stringLengthAttr.NamedArguments.Any(p => p.MemberName == "MinimumLength"))

var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value;
var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value;

openapiParam.Schema.MinLength = rangeMin;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This stores numeric [Range] bounds as string minLength/maxLength, so GetOrderById loses its numeric constraints in OpenAPI. The int casts also fail for valid floating-point ranges; map supported range overloads to numeric Minimum/Maximum values.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs, line 100:

<comment>This stores numeric `[Range]` bounds as string `minLength`/`maxLength`, so `GetOrderById` loses its numeric constraints in OpenAPI. The `int` casts also fail for valid floating-point ranges; map supported range overloads to numeric `Minimum`/`Maximum` values.</comment>

<file context>
@@ -0,0 +1,107 @@
+                        var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value;
+                        var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value;
+
+                        openapiParam.Schema.MinLength = rangeMin;
+                        openapiParam.Schema.MaxLength = rangeMax;
+                    }
</file context>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

60 issues found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Org.OpenAPITools.csproj">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Org.OpenAPITools.csproj:15">
P1: This sample enables central package management with version-less `<PackageReference>` items but ships no `Directory.Packages.props` anywhere in the project's ancestor tree, so `dotnet restore` fails (NU1010: the PackageReference requires a package version that central management would supply from `Directory.Packages.props`). The 8.0 counterpart (`aspnetcore-8.0-use-centralized-package-version-management/src/Org.OpenAPITools/Directory.Packages.props`) contains the required `<PackageVersion>` entries for the same version-less references, and the new CI job in `.github/workflows/samples-dotnet10-server.yaml` builds this exact sample, so the restore/build failure is exercised by CI. Add a `Directory.Packages.props` next to the csproj (or inline versions).</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Dockerfile:4">
P2: The Dockerfile pulls from the deprecated `mcr.microsoft.com/dotnet/core/*` image repositories, which stopped receiving new .NET versions years before .NET 10 shipped. Tags like `dotnet/core/aspnet:10.0` were never published, so the `docker build` flow documented in the sample README fails at the pull step. Use the current repos: `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0`. The `aspnetcore/3.0/Dockerfile.mustache` template needs the same repo switch — this PR only dropped the distro tags (`-buster`/`-buster-slim`) while keeping the retired `dotnet/core` path.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Dockerfile:14">
P1: The documented `docker build` command uses `src/Org.OpenAPITools` as its context, but this `COPY` source is relative to the sample root and is missing from that context. Update both `COPY` sources for the documented context or change the build command to use the sample root as context.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs:53">
P1: This removes `/v2` from the documented paths without adding it to the OpenAPI server URL, so Swagger UI calls `/pet` while the controller is routed at `/v2/pet`. Preserve the prefix in the paths or add `/v2` as the server URL.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/README.md:47">
P2: This changes the Docker build context to `src/Org.OpenAPITools`, but the Dockerfile’s `COPY` paths are rooted at the sample directory, so `docker build` fails. Build from the sample root and pass the Dockerfile path explicitly.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/README.md:47">
P2: The Dockerfile copies files from paths rooted at the sample directory, so building from `src/Org.OpenAPITools` makes the documented command fail. Build from the sample root and specify the Dockerfile path.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/README.md:47">
P2: This changes the Docker build context to `src/Org.OpenAPITools`, but the Dockerfile copies files using paths rooted at the sample directory, so the documented build fails. Build from the sample root and pass the Dockerfile path explicitly.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Cat.cs:79">
P2: `Cat.Equals` ignores inherited `ClassName` and `Color`, so cats with different Animal state compare equal. Include `base.Equals(other)` in this comparison.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/README.md:47">
P2: This build context makes the documented Docker build fail: the Dockerfile copies from `src/Org.OpenAPITools/...`, which does not exist under this directory. Build from the sample root and pass `-f src/Org.OpenAPITools/Dockerfile`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Cat.cs:79">
P2: `Cat` equality ignores inherited `ClassName` and `Color`, so cats with different model data compare equal and can collapse in sets or dictionary keys. Include `base.Equals(other)` in this comparison and incorporate the base hash in `GetHashCode()`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:64">
P2: A valid `[StringLength(20, ErrorMessage = "...")]` makes this count equal 1, then `Single` throws because `MinimumLength` is absent, breaking Swagger generation. Look up `MinimumLength` by name without requiring it to be the only named argument.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:97">
P2: `RangeAttribute` also supports `double` and `(Type, string, string)` constructors; unboxing these arguments as `int` throws during Swagger generation for valid ranges. Read and convert the supported bound forms instead of assuming integer arguments.</violation>

<violation number="3" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:100">
P2: `[Range(1, 5)]` is a numeric constraint, but these assignments emit `minLength`/`maxLength`, which do not describe the `long` parameter’s bounds. Set the schema’s `Minimum` and `Maximum` instead.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-useSwashBuckle/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-useSwashBuckle/build.bat:6">
P2: The batch file continues after restore or build failures, and the final `echo` can make it return success. Add `|| exit /b 1` to both commands so callers can detect failures.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-useSwashBuckle/build.bat:8">
P2: This command cannot run the generated project because its `.csproj` sets `OutputType` to `Library` and the sample has no executable host. Replace this instruction with a runnable host command or state that the library must be hosted by an ASP.NET Core application.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:97">
P2: `Range` also accepts fractional bounds, but these casts unbox every bound as `int`; a generated `[Range(0.5, 4.5)]` therefore throws `InvalidCastException` during Swagger generation. Read the actual constructor argument types instead of casting both values to `int`.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:100">
P2: `GetOrderById` has `[Range(1, 5)]long`, but these assignments emit `minLength` and `maxLength` instead of numeric `minimum` and `maximum`, losing the bounds in the OpenAPI contract. Set `Schema.Minimum` and `Schema.Maximum`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Animal.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Animal.cs:29">
P1: Both discriminator annotations use `ClassName`, but the JSON wire property and OpenAPI schema use `className`. JsonSubTypes cannot find the discriminator in serialized payloads, and Swagger publishes the wrong discriminator name; use `className` in both annotations.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs:29">
P1: Both discriminator annotations use `ClassName`, but the JSON discriminator is `className`; polymorphic deserialization may not select `Cat`/`Dog`, and Swagger advertises the wrong discriminator property. Use `className` in both annotations.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Dog.cs:79">
P2: Dog equality ignores inherited `Animal` fields, so dogs with different `ClassName` or `Color` compare equal whenever `Breed` matches. Include `base.Equals(other)` in this comparison.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs:81">
P2: `Dog.Equals` ignores inherited `ClassName` and `Color`, so dogs with the same breed but different base properties compare equal. Include the base equality and hash code when comparing derived instances.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Cat.cs:81">
P2: `Equals(Cat)` ignores the inherited `ClassName` and `Color` values, so distinct cats can compare equal; `GetHashCode()` omits them too. Include the base equality and hash code along with `Declawed`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Cat.cs:86">
P2: `Cat.Equals` ignores the inherited `Animal` fields, so cats with the same `Declawed` but different `ClassName` or `Color` compare equal. Include `base.Equals(other)` in this comparison.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/BasePathFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/BasePathFilter.cs:45">
P2: Removing `/v2` leaves the generated OpenAPI document with paths such as `/pet` but no server URL carrying the prefix, while the controllers still require `/v2/pet`; Swagger UI requests therefore hit nonexistent routes. Add `BasePath` as an OpenAPI server URL before stripping the paths.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs:86">
P2: `Dog.Equals` ignores the inherited `ClassName` and `Color` properties, so Dogs with different animal data compare equal. Include `base.Equals(other)` in equality and `base.GetHashCode()` in the hash code.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Dockerfile:4">
P2: `FROM mcr.microsoft.com/dotnet/core/aspnet:10.0` (and `.../dotnet/core/sdk:10.0`) reference images that do not exist. The legacy `dotnet/core/*` MCR repos stopped at .NET 5.0; there are no 6.0–10.0 tags in `mcr.microsoft.com/dotnet/core/aspnet` or `dotnet/core/sdk`. .NET 10 images are published under `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0`, so `docker build` in `src/Org.OpenAPITools` (as documented in the added README) fails. Use the `dotnet/aspnet` / `dotnet/sdk` image names — this should be fixed in `modules/openapi-generator/src/main/resources/aspnetcore/3.0/Dockerfile.mustache` so all regenerated samples (6.0, 8.0, 10.0) emit working FROM lines.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/build.sh:8">
P2: The suggested command selects a nonexistent `web` launch profile, so running it fails. Use the existing `OpenAPI` profile.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:100">
P2: `GetOrderById` applies `[Range(1, 5)]` to numeric `orderId`, but these assignments create string-length constraints instead of numeric bounds, so the generated schema omits the valid range. Set `Schema.Minimum` and `Schema.Maximum`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs:4">
P2: The sample advertises `special-key`, but `Startup.ConfigureServices` configures only `my-secret-key`; requests using the documented key fail API-key authorization. Update this comment to `my-secret-key` or configure `special-key`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/build.bat:8">
P2: The sample has no `web` launch profile, so the printed startup command requests a nonexistent profile. Change it to `OpenAPI` (and remove the trailing period from the command).</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/README.md:47">
P2: The Docker build uses the project directory as its context, but the Dockerfile copies files from paths rooted at the sample directory, so `docker build` fails. Build from the sample root and pass the Dockerfile path explicitly.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/README.md">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/README.md:47">
P2: The documented Docker build fails because its context is `src/Org.OpenAPITools`, but the Dockerfile's `COPY` sources are relative to the sample root. Build from the sample root and specify the Dockerfile path.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:100">
P2: `[Range(1, 5)]` on `GetOrderById(long orderId)` is emitted as string-length constraints, so Swagger omits the integer parameter’s numeric bounds. Assign these values to `Minimum` and `Maximum` instead.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs:100">
P2: This maps `[Range(1, 5)]` on `GetOrderById(long orderId)` to the string-only `minLength`/`maxLength` keywords, so the generated OpenAPI omits its numeric bounds. Use `Schema.Minimum` and `Schema.Maximum`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json:24">
P2: `OpenAPI` launches at ports 5001/5000, but this sample's `Program.CreateHostBuilder` binds only HTTP port 8080, so the browser opens an address with no listener. Align the profile URL with that binding or update the `UseUrls` call.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Properties/launchSettings.json">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Properties/launchSettings.json:33">
P2: The Docker profile publishes the Dockerfile's exposed ports 80/443, but the app binds only port 8080, so the launched browser cannot reach the service. Expose and publish 8080, or bind the app to an exposed port.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Animal.cs:30">
P2: These `KnownSubType` attributes do not configure System.Text.Json polymorphism, so `Animal` request bodies cannot be deserialized as `Cat` or `Dog` and subtype fields are lost. Configure a System.Text.Json polymorphism converter for the `CAT`/`DOG` mappings.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs:61">
P2: Endpoint-routing authorization does not provide an `AuthorizationFilterContext`, so this handler rejects every valid API key when the policy runs through authorization middleware. Handle the `HttpContext` resource as well as MVC filter contexts.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Properties/launchSettings.json">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Properties/launchSettings.json:24">
P2: The OpenAPI profile launches the browser on ports 5001/5000, but `Program` binds only HTTP port 8080, so the launch fails. Set this profile URL to `http://localhost:8080` or align the listener with these URLs.</violation>

<violation number="2" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Properties/launchSettings.json:33">
P2: The Docker profile publishes the image's exposed ports 80/443, but the app listens on port 8080, so the launched container is unreachable. Align the Docker image's exposed/mapped port with the app listener.</violation>
</file>

<file name="modules/openapi-generator/src/main/resources/aspnetcore/3.0/Dockerfile.mustache">

<violation number="1" location="modules/openapi-generator/src/main/resources/aspnetcore/3.0/Dockerfile.mustache:4">
P2: This tag does not exist for the versions this template serves. `mcr.microsoft.com/dotnet/core/*` is the legacy .NET Core repository path and only hosts images up to 3.1; the new default `10.0` (and 5.0–8.0) are published at `mcr.microsoft.com/dotnet/aspnet:10.0` / `mcr.microsoft.com/dotnet/sdk:10.0`. Dropping `-buster-slim`/`-buster` fixes 3.0/3.1 (plain `dotnet/core` tags exist for them), but the 10.0 sample now regenerates as `FROM mcr.microsoft.com/dotnet/core/aspnet:10.0`, which fails `docker build` — the documented run path in README.mustache (`docker build -t {{dockerTag}} .`). Use the `dotnet/*` repo for 5.0+ (e.g., via a version-gated additional property such as `isNet5Plus`) and keep `dotnet/core/*` only for 3.x.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile:4">
P2: This Dockerfile pulls from the retired `mcr.microsoft.com/dotnet/core/*` image namespace, which has no .NET 10 tags, so `docker build` fails with `manifest unknown`. Microsoft stopped publishing to `dotnet/core` after .NET Core 3.1 (the legacy repos were removed from MCR registration), and .NET 10 images exist only at `mcr.microsoft.com/dotnet/aspnet:10.0` and `mcr.microsoft.com/dotnet/sdk:10.0`. Use those two image names.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/build.bat:8">
P2: The printed command selects a `web.` launch profile, but this project defines no such profile, so following the instructions cannot select the configured `OpenAPI` profile. Print `--launch-profile OpenAPI` and keep punctuation out of the command.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Dog.cs:79">
P2: `Equals(Dog)` ignores the inherited `Animal` properties, so Dogs with different `ClassName` or `Color` values compare equal. Include `base.Equals(other)` in this result.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/build.bat:8">
P2: The printed command selects `web.`, but this sample defines no such launch profile (`OpenAPI` is the project profile). Print `--launch-profile OpenAPI` without the trailing period so the documented command selects the configured profile.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/build.sh:8">
P2: The suggested command selects a `web` launch profile, but this sample defines `OpenAPI` instead. Change the command to `--launch-profile OpenAPI` so it uses the sample's configured launch settings.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/build.bat:8">
P2: This command names a `web` launch profile, but the sample defines `OpenAPI`, `Docker`, and `IIS Express` instead. Change it to `--launch-profile OpenAPI` so the documented command uses the configured project profile.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs:81">
P2: `Cat.Equals` ignores inherited `ClassName` and `Color`, so cats with different model data compare equal when `Declawed` matches. Include `base.Equals(other)` in this comparison.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Animal.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Models/Animal.cs:97">
P2: `Animal.Equals(Animal)` ignores subtype fields, so two animals can compare equal through an `Animal` reference even when their `Cat` state differs. Make equality consistent across the inheritance hierarchy, including subtype fields.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/build.sh:8">
P2: The suggested command selects a nonexistent `web` launch profile; this sample defines `OpenAPI`, so following the instruction fails. Use `--launch-profile OpenAPI`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/build.sh:8">
P2: The printed start command selects a launch profile this sample does not define; replace `web` with `OpenAPI` so users can run the project using its configured profile.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Animal.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Animal.cs:90">
P2: `IEquatable<Animal>.Equals` ignores subtype fields, so otherwise-identical `Cat` instances with different `Declawed` values compare equal through `Animal` references even though their hash codes differ. Make equality account for derived model members to preserve the equality/hash contract.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/FakeApi.cs:49">
P2: Default `JsonSerializer` options are case-sensitive, so `name` and `nullableName` leave `TestNullable.Name` and `.NullableName` null; the endpoint returns the wrong example. Pass case-insensitive options to deserialize.</violation>
</file>

<file name=".github/workflows/samples-dotnet10-server.yaml">

<violation number="1" location=".github/workflows/samples-dotnet10-server.yaml:26">
P2: The generated `aspnetcore-10.0-abstract-class` solution is omitted from this matrix, so this job never builds or tests that .NET 10 option. Add it to the matrix.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Models/Dog.cs:81">
P2: `Dog.Equals` ignores inherited `Animal` properties, so dogs with different `ClassName` or `Color` compare equal. Include the base state in both `Equals` and `GetHashCode`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs:49">
P2: This inserts the enum input into JSON without escaping it, so valid enum values containing quotes or backslashes fail or deserialize incorrectly. Serialize `s` with `JsonConvert.SerializeObject` before deserializing.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/build.bat">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/build.bat:8">
P2: The sample defines an `OpenAPI` launch profile, not `web`, so this printed command cannot select the configured profile; copying it also passes the trailing period as part of the name. Print `--launch-profile OpenAPI` without the period.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Properties/launchSettings.json">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Properties/launchSettings.json:33">
P2: `publishAllPorts` publishes the Dockerfile's exposed ports (80/443), but the app listens on 8080, so the Docker profile cannot reach it. Expose/map 8080 or align the app's bind port.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs:4">
P2: The sample documents `special-key`, but the policy accepts only `my-secret-key`, so requests using the documented key fail authorization. Update the documented key to match the configured value.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs:32">
P2: System.Text.Json ignores `EmitDefaultValue=false`, so a null optional `Name` is emitted as `"name": null` instead of being omitted. Add a `JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)` attribute for this property.</violation>
</file>

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.

Turn on auto-fix | Re-trigger cubic

<UserSecretsId>cb87e868-8646-48ef-9bb6-344b537d0d37</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: This sample enables central package management with version-less <PackageReference> items but ships no Directory.Packages.props anywhere in the project's ancestor tree, so dotnet restore fails (NU1010: the PackageReference requires a package version that central management would supply from Directory.Packages.props). The 8.0 counterpart (aspnetcore-8.0-use-centralized-package-version-management/src/Org.OpenAPITools/Directory.Packages.props) contains the required <PackageVersion> entries for the same version-less references, and the new CI job in .github/workflows/samples-dotnet10-server.yaml builds this exact sample, so the restore/build failure is exercised by CI. Add a Directory.Packages.props next to the csproj (or inline versions).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Org.OpenAPITools.csproj, line 15:

<comment>This sample enables central package management with version-less `<PackageReference>` items but ships no `Directory.Packages.props` anywhere in the project's ancestor tree, so `dotnet restore` fails (NU1010: the PackageReference requires a package version that central management would supply from `Directory.Packages.props`). The 8.0 counterpart (`aspnetcore-8.0-use-centralized-package-version-management/src/Org.OpenAPITools/Directory.Packages.props`) contains the required `<PackageVersion>` entries for the same version-less references, and the new CI job in `.github/workflows/samples-dotnet10-server.yaml` builds this exact sample, so the restore/build failure is exercised by CI. Add a `Directory.Packages.props` next to the csproj (or inline versions).</comment>

<file context>
@@ -0,0 +1,28 @@
+        <UserSecretsId>cb87e868-8646-48ef-9bb6-344b537d0d37</UserSecretsId>
+        <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
+        <DockerfileContext>..\..</DockerfileContext>
+        <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
+    </PropertyGroup>
+    <ItemGroup>
</file context>


# Copy the code into the container
WORKDIR /src
COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The documented docker build command uses src/Org.OpenAPITools as its context, but this COPY source is relative to the sample root and is missing from that context. Update both COPY sources for the documented context or change the build command to use the sample root as context.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Dockerfile, line 14:

<comment>The documented `docker build` command uses `src/Org.OpenAPITools` as its context, but this `COPY` source is relative to the sample root and is missing from that context. Update both `COPY` sources for the documented context or change the build command to use the sample root as context.</comment>

<file context>
@@ -0,0 +1,32 @@
+
+# Copy the code into the container
+WORKDIR /src
+COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"]
+
+# NuGet restore
</file context>

{
if (key.StartsWith(BasePath))
{
var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: This removes /v2 from the documented paths without adding it to the OpenAPI server URL, so Swagger UI calls /pet while the controller is routed at /v2/pet. Preserve the prefix in the paths or add /v2 as the server URL.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Filters/BasePathFilter.cs, line 53:

<comment>This removes `/v2` from the documented paths without adding it to the OpenAPI server URL, so Swagger UI calls `/pet` while the controller is routed at `/v2/pet`. Preserve the prefix in the paths or add `/v2` as the server URL.</comment>

<file context>
@@ -0,0 +1,60 @@
+            {
+                if (key.StartsWith(BasePath))
+                {
+                    var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty);
+                    openapiDoc.Paths.Remove(key);
+                    openapiDoc.Paths.Add(newKey, value);
</file context>

Comment on lines +29 to +30
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[SwaggerDiscriminator("ClassName")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Both discriminator annotations use ClassName, but the JSON wire property and OpenAPI schema use className. JsonSubTypes cannot find the discriminator in serialized payloads, and Swagger publishes the wrong discriminator name; use className in both annotations.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Animal.cs, line 29:

<comment>Both discriminator annotations use `ClassName`, but the JSON wire property and OpenAPI schema use `className`. JsonSubTypes cannot find the discriminator in serialized payloads, and Swagger publishes the wrong discriminator name; use `className` in both annotations.</comment>

<file context>
@@ -0,0 +1,142 @@
+    /// 
+    /// </summary>
+    [DataContract]
+    [JsonConverter(typeof(JsonSubtypes), "ClassName")]
+    [SwaggerDiscriminator("ClassName")]
+    [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")]
</file context>
Suggested change
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[SwaggerDiscriminator("ClassName")]
[JsonConverter(typeof(JsonSubtypes), "className")]
[SwaggerDiscriminator("className")]

Comment on lines +29 to +30
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[SwaggerDiscriminator("ClassName")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Both discriminator annotations use ClassName, but the JSON discriminator is className; polymorphic deserialization may not select Cat/Dog, and Swagger advertises the wrong discriminator property. Use className in both annotations.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs, line 29:

<comment>Both discriminator annotations use `ClassName`, but the JSON discriminator is `className`; polymorphic deserialization may not select `Cat`/`Dog`, and Swagger advertises the wrong discriminator property. Use `className` in both annotations.</comment>

<file context>
@@ -0,0 +1,142 @@
+    /// 
+    /// </summary>
+    [DataContract]
+    [JsonConverter(typeof(JsonSubtypes), "ClassName")]
+    [SwaggerDiscriminator("ClassName")]
+    [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")]
</file context>
Suggested change
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
[SwaggerDiscriminator("ClassName")]
[JsonConverter(typeof(JsonSubtypes), "className")]
[SwaggerDiscriminator("className")]


dotnet restore src\Org.OpenAPITools
dotnet build src\Org.OpenAPITools
echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The sample defines an OpenAPI launch profile, not web, so this printed command cannot select the configured profile; copying it also passes the trailing period as part of the name. Print --launch-profile OpenAPI without the period.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-abstract-class/build.bat, line 8:

<comment>The sample defines an `OpenAPI` launch profile, not `web`, so this printed command cannot select the configured profile; copying it also passes the trailing period as part of the name. Print `--launch-profile OpenAPI` without the period.</comment>

<file context>
@@ -0,0 +1,9 @@
+
+dotnet restore src\Org.OpenAPITools
+dotnet build src\Org.OpenAPITools
+echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web.
+echo.
</file context>
Suggested change
echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web.
echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile OpenAPI

"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi",
"publishAllPorts": true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: publishAllPorts publishes the Dockerfile's exposed ports (80/443), but the app listens on 8080, so the Docker profile cannot reach it. Expose/map 8080 or align the app's bind port.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Properties/launchSettings.json, line 33:

<comment>`publishAllPorts` publishes the Dockerfile's exposed ports (80/443), but the app listens on 8080, so the Docker profile cannot reach it. Expose/map 8080 or align the app's bind port.</comment>

<file context>
@@ -0,0 +1,37 @@
+      "commandName": "Docker",
+      "launchBrowser": true,
+      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi",
+      "publishAllPorts": true,
+      "useSSL": true
+    }
</file context>

/*
* OpenAPI Petstore
*
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The sample documents special-key, but the policy accepts only my-secret-key, so requests using the documented key fail authorization. Update the documented key to match the configured value.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs, line 4:

<comment>The sample documents `special-key`, but the policy accepts only `my-secret-key`, so requests using the documented key fail authorization. Update the documented key to match the configured value.</comment>

<file context>
@@ -0,0 +1,72 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
</file context>
Suggested change
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* This is a sample server Petstore server. For this sample, you can use the api key `my-secret-key` to test the authorization filters.

/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name="name", EmitDefaultValue=false)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: System.Text.Json ignores EmitDefaultValue=false, so a null optional Name is emitted as "name": null instead of being omitted. Add a JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull) attribute for this property.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestNullable.cs, line 32:

<comment>System.Text.Json ignores `EmitDefaultValue=false`, so a null optional `Name` is emitted as `"name": null` instead of being omitted. Add a `JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)` attribute for this property.</comment>

<file context>
@@ -0,0 +1,138 @@
+        /// <summary>
+        /// Gets or Sets Name
+        /// </summary>
+        [DataMember(Name="name", EmitDefaultValue=false)]
+        public string Name { get; set; }
+
</file context>
Suggested change
[DataMember(Name="name", EmitDefaultValue=false)]
[DataMember(Name="name", EmitDefaultValue=false)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]

Comment on lines +6 to +7
dotnet restore src\Org.OpenAPITools
dotnet build src\Org.OpenAPITools

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The batch file continues after restore or build failures, and the final echo can make it return success. Add || exit /b 1 to both commands so callers can detect failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-useSwashBuckle/build.bat, line 6:

<comment>The batch file continues after restore or build failures, and the final `echo` can make it return success. Add `|| exit /b 1` to both commands so callers can detect failures.</comment>

<file context>
@@ -0,0 +1,9 @@
+
+@echo off
+
+dotnet restore src\Org.OpenAPITools
+dotnet build src\Org.OpenAPITools
+echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web.
</file context>
Suggested change
dotnet restore src\Org.OpenAPITools
dotnet build src\Org.OpenAPITools
dotnet restore src\Org.OpenAPITools || exit /b 1
dotnet build src\Org.OpenAPITools || exit /b 1

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

56 existing issues remain and 23 new issues found across 343 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs:4">
P2: The documented `special-key` is rejected by this sample; change the example to `my-secret-key` or align the configured key so users can test protected endpoints as described.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Dockerfile:6">
P2: The .NET 10 ASP.NET container listens on 8080 by default, but this advertises port 80; `docker run -P` therefore publishes a port the app does not listen on. Change this to `EXPOSE 8080`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs:4">
P3: The documented `special-key` is rejected: `Startup.ConfigureServices` configures the `api_key` policy with only `my-secret-key`. Update this sample credential to `my-secret-key`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Filters/BasePathFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Filters/BasePathFilter.cs:53">
P2: This removes `/v2` from every documented path without adding it to `openapiDoc.Servers`, while the controllers still serve `/v2/...`; Swagger UI's Try it out requests therefore miss the routes. Keep the prefix in the paths or set the document server URL to `BasePath` before stripping it.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Tag.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Tag.cs:61">
P2: `ToJson()` emits `Id` and `Name` instead of the OpenAPI `id` and `name` fields because these options have no naming policy and `System.Text.Json` ignores `DataMember` names. Set `PropertyNamingPolicy = JsonNamingPolicy.CamelCase` so the returned JSON matches the API shape.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/ApiResponse.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/ApiResponse.cs:88">
P2: These equality methods handle null, but their non-null parameter annotations tell nullable-aware callers that passing null is invalid. Annotate the parameters as `object?` and `ApiResponse?` so the public contract matches the implementation.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestEnum.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/TestEnum.cs:33">
P2: `EnumMember` is ignored by the configured `System.Text.Json` enum converter, so this member serializes as `aEnum` instead of the schema value `A`. Use `JsonStringEnumMemberName` or a converter that honors `EnumMember` (and apply it to both members).</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs:60">
P2: Context-dependent validation attributes can throw instead of producing a 400 because `IsValid(args)` supplies no `ValidationContext`. Validate with `GetValidationResult` and a parameter `ValidationContext` so failures are added to `ModelState`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/DefaultApi.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Controllers/DefaultApi.cs:40">
P2: `testQuery=A` is a documented enum value, but query enum binding parses the C# member names (`AEnum`/`BEnum`), not their `EnumMember` aliases, so the request is rejected before the action runs. Add an `EnumMember`-aware model binder or accept and map the wire string.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/build.sh">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/build.sh:8">
P2: The printed startup command selects a nonexistent `web` launch profile, so following the script's instructions cannot start this sample. Use the defined `OpenAPI` profile.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs:43">
P3: `ToString()` omits the inherited `ClassName` and `Color` values, making the string representation incomplete. Append those properties alongside `Breed`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs:49">
P2: This call uses default `System.Text.Json` options, so converting an enum string throws instead of producing the enum value; the app-level `JsonStringEnumConverter` is not applied here, and generated `[EnumMember]` values need explicit mapping. Use an enum conversion that maps the generated wire values.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Dockerfile:6">
P2: The application listens on port 8080, not 80 or 443, so `docker run -P` and tools that infer ports from the image will publish ports with no listener. Expose 8080 instead.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/BasePathFilter.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/BasePathFilter.cs:45">
P1: The filter strips `/v2` from each documented path, but no OpenAPI server adds it back, so Swagger UI and generated clients call `/pet` instead of the controllers' `/v2/pet`. Set the OpenAPI server URL to `BasePath`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Models/Pet.cs:95">
P2: An unset `Status` defaults to 0, but this attribute serializes the default even though the schema only allows `available`, `pending`, or `sold`; clients receive an invalid status. Set `EmitDefaultValue=false` so the optional field is omitted until set.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs:4">
P2: This comment tells users to send `special-key`, but `Startup.ConfigureServices` accepts only `my-secret-key`, so protected requests using the documented key are rejected. Update the documented key to `my-secret-key`.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj:19">
P1: Swashbuckle 10.2.3 uses Microsoft.OpenApi 2.x, where the OpenAPI models moved out of `Microsoft.OpenApi.Models`; this sample still imports that namespace and uses its model types, so it will not compile. Update the generated OpenAPI imports and usage for v2 before selecting this dependency.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs:40">
P3: Nested generic types retain metadata arity suffixes because their argument count does not match each nested name segment's arity. Strip each arity suffix from `typeName` so generated schema IDs remain friendly.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Properties/launchSettings.json:34">
P2: The Docker profile launches the browser over HTTPS, but this host binds only HTTP on port 8080 while the Dockerfile exposes only ports 80 and 443. Align the Kestrel binding, Docker port mapping, and profile scheme so `/openapi` is reachable.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs:95">
P2: `Animal.Equals(Animal)` can equate an `Animal` and a `Cat`/`Dog` when their inherited fields match, while `Equals(object)` rejects different runtime types. Require matching runtime types before comparing the fields.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs:54">
P2: Repeatable validation attributes make `GetCustomAttribute(type)` throw `AmbiguousMatchException`, so requests fail before validation. Enumerate the attribute instances directly instead.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs:56">
P2: This singular lookup throws `AmbiguousMatchException` when a parameter has multiple instances of a legal `AllowMultiple` attribute, turning the request into a 500. Iterate instantiated attributes directly instead of re-fetching each by type.</violation>
</file>

<file name="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs">

<violation number="1" location="samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs:63">
P2: When the binding name differs from the generated C# parameter name, this records the validation error under the wrong key in the returned `ModelState`. Resolve the parameter’s binding name before calling `AddModelError`.</violation>
</file>

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Requires human review: Auto-approval blocked because this review re-detected 56 unresolved issues already reported by Cubic.

Turn on auto-fix | Re-trigger cubic

/// <param name="context">FilterContext</param>
public void Apply(OpenApiDocument openapiDoc, DocumentFilterContext context)
{
//openapiDoc.BasePath = BasePath;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The filter strips /v2 from each documented path, but no OpenAPI server adds it back, so Swagger UI and generated clients call /pet instead of the controllers' /v2/pet. Set the OpenAPI server URL to BasePath.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Filters/BasePathFilter.cs, line 45:

<comment>The filter strips `/v2` from each documented path, but no OpenAPI server adds it back, so Swagger UI and generated clients call `/pet` instead of the controllers' `/v2/pet`. Set the OpenAPI server URL to `BasePath`.</comment>

<file context>
@@ -0,0 +1,60 @@
+        /// <param name="context">FilterContext</param>
+        public void Apply(OpenApiDocument openapiDoc, DocumentFilterContext context)
+        {
+            //openapiDoc.BasePath = BasePath;
+
+            var pathsToModify = openapiDoc.Paths.Where(p => p.Key.StartsWith(BasePath)).ToList();
</file context>
Suggested change
//openapiDoc.BasePath = BasePath;
openapiDoc.Servers.Add(new OpenApiServer { Url = BasePath });

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="10.2.3" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Swashbuckle 10.2.3 uses Microsoft.OpenApi 2.x, where the OpenAPI models moved out of Microsoft.OpenApi.Models; this sample still imports that namespace and uses its model types, so it will not compile. Update the generated OpenAPI imports and usage for v2 before selecting this dependency.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj, line 19:

<comment>Swashbuckle 10.2.3 uses Microsoft.OpenApi 2.x, where the OpenAPI models moved out of `Microsoft.OpenApi.Models`; this sample still imports that namespace and uses its model types, so it will not compile. Update the generated OpenAPI imports and usage for v2 before selecting this dependency.</comment>

<file context>
@@ -0,0 +1,27 @@
+    <ItemGroup>
+        <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
+        <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
+        <PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="10.2.3" />
+        <PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.2.3" />
+        <PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="10.2.3" />
</file context>

/*
* OpenAPI Petstore
*
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The documented special-key is rejected by this sample; change the example to my-secret-key or align the configured key so users can test protected endpoints as described.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs, line 4:

<comment>The documented `special-key` is rejected by this sample; change the example to `my-secret-key` or align the configured key so users can test protected endpoints as described.</comment>

<file context>
@@ -0,0 +1,72 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
</file context>
Suggested change
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* This is a sample server Petstore server. For this sample, you can use the api key `my-secret-key` to test the authorization filters.

# Container we use for final publish
FROM mcr.microsoft.com/dotnet/core/aspnet:10.0 AS base
WORKDIR /app
EXPOSE 80

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The .NET 10 ASP.NET container listens on 8080 by default, but this advertises port 80; docker run -P therefore publishes a port the app does not listen on. Change this to EXPOSE 8080.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Dockerfile, line 6:

<comment>The .NET 10 ASP.NET container listens on 8080 by default, but this advertises port 80; `docker run -P` therefore publishes a port the app does not listen on. Change this to `EXPOSE 8080`.</comment>

<file context>
@@ -0,0 +1,32 @@
+# Container we use for final publish
+FROM mcr.microsoft.com/dotnet/core/aspnet:10.0 AS base
+WORKDIR /app
+EXPOSE 80
+EXPOSE 443
+
</file context>
Suggested change
EXPOSE 80
EXPOSE 8080

{
if (key.StartsWith(BasePath))
{
var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This removes /v2 from every documented path without adding it to openapiDoc.Servers, while the controllers still serve /v2/...; Swagger UI's Try it out requests therefore miss the routes. Keep the prefix in the paths or set the document server URL to BasePath before stripping it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-abstract-class/src/Org.OpenAPITools/Filters/BasePathFilter.cs, line 53:

<comment>This removes `/v2` from every documented path without adding it to `openapiDoc.Servers`, while the controllers still serve `/v2/...`; Swagger UI's Try it out requests therefore miss the routes. Keep the prefix in the paths or set the document server URL to `BasePath` before stripping it.</comment>

<file context>
@@ -0,0 +1,60 @@
+            {
+                if (key.StartsWith(BasePath))
+                {
+                    var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty);
+                    openapiDoc.Paths.Remove(key);
+                    openapiDoc.Paths.Add(newKey, value);
</file context>

{
foreach (var attributeData in parameter.CustomAttributes)
{
var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This singular lookup throws AmbiguousMatchException when a parameter has multiple instances of a legal AllowMultiple attribute, turning the request into a 500. Iterate instantiated attributes directly instead of re-fetching each by type.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs, line 56:

<comment>This singular lookup throws `AmbiguousMatchException` when a parameter has multiple instances of a legal `AllowMultiple` attribute, turning the request into a 500. Iterate instantiated attributes directly instead of re-fetching each by type.</comment>

<file context>
@@ -0,0 +1,69 @@
+        {
+            foreach (var attributeData in parameter.CustomAttributes)
+            {
+                var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType);
+
+                if (attributeInstance is ValidationAttribute validationAttribute)
</file context>

var isValid = validationAttribute.IsValid(args);
if (!isValid)
{
modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When the binding name differs from the generated C# parameter name, this records the validation error under the wrong key in the returned ModelState. Resolve the parameter’s binding name before calling AddModelError.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-project4Models/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs, line 63:

<comment>When the binding name differs from the generated C# parameter name, this records the validation error under the wrong key in the returned `ModelState`. Resolve the parameter’s binding name before calling `AddModelError`.</comment>

<file context>
@@ -0,0 +1,69 @@
+                    var isValid = validationAttribute.IsValid(args);
+                    if (!isValid)
+                    {
+                        modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name));
+                    }
+                }
</file context>

/*
* OpenAPI Petstore
*
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The documented special-key is rejected: Startup.ConfigureServices configures the api_key policy with only my-secret-key. Update this sample credential to my-secret-key.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs, line 4:

<comment>The documented `special-key` is rejected: `Startup.ConfigureServices` configures the `api_key` policy with only `my-secret-key`. Update this sample credential to `my-secret-key`.</comment>

<file context>
@@ -0,0 +1,72 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
</file context>
Suggested change
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* This is a sample server Petstore server. For this sample, you can use the api key `my-secret-key` to test the authorization filters.

{
var sb = new StringBuilder();
sb.Append("class Dog {\n");
sb.Append(" Breed: ").Append(Breed).Append("\n");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: ToString() omits the inherited ClassName and Color values, making the string representation incomplete. Append those properties alongside Breed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Dog.cs, line 43:

<comment>`ToString()` omits the inherited `ClassName` and `Color` values, making the string representation incomplete. Append those properties alongside `Breed`.</comment>

<file context>
@@ -0,0 +1,124 @@
+        {
+            var sb = new StringBuilder();
+            sb.Append("class Dog {\n");
+            sb.Append("  Breed: ").Append(Breed).Append("\n");
+            sb.Append("}\n");
+            return sb.ToString();
</file context>
Suggested change
sb.Append(" Breed: ").Append(Breed).Append("\n");
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
sb.Append(" Color: ").Append(Color).Append("\n");
sb.Append(" Breed: ").Append(Breed).Append("\n");

.ToArray();

return new StringBuilder(typeName)
.Replace($"`{genericArgumentIds.Count()}", string.Empty)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Nested generic types retain metadata arity suffixes because their argument count does not match each nested name segment's arity. Strip each arity suffix from typeName so generated schema IDs remain friendly.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/aspnetcore-10.0-pocoModels/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs, line 40:

<comment>Nested generic types retain metadata arity suffixes because their argument count does not match each nested name segment's arity. Strip each arity suffix from `typeName` so generated schema IDs remain friendly.</comment>

<file context>
@@ -0,0 +1,61 @@
+                    .ToArray();
+
+                return new StringBuilder(typeName)
+                    .Replace($"`{genericArgumentIds.Count()}", string.Empty)
+                    .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]")
+                    .ToString();
</file context>

@jonekdahl

jonekdahl commented Oct 6, 2026 •

Copy link
Copy Markdown
Author

Heh, I just found PR #25124 with .NET 10 support that was merged yesterday so I'll close this for now and got try that out.

@jonekdahl jonekdahl closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant