Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 37 additions & 0 deletions .github/workflows/samples-dotnet10-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Samples C# .Net 10 Server

on:
push:
paths:
- samples/server/petstore/aspnetcore-10.0/**
- samples/server/petstore/aspnetcore-10.0-*/**
pull_request:
paths:
- samples/server/petstore/aspnetcore-10.0/**
- samples/server/petstore/aspnetcore-10.0-*/**
jobs:
build:
name: Build .Net 10 servers
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/server/petstore/aspnetcore-10.0
- samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse
- samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes
- samples/server/petstore/aspnetcore-10.0-pocoModels
- samples/server/petstore/aspnetcore-10.0-project4Models
- samples/server/petstore/aspnetcore-10.0-useSwashBuckle
- samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management

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 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.

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 .github/workflows/samples-dotnet10-server.yaml, line 26:

<comment>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.</comment>

<file context>
@@ -0,0 +1,37 @@
+          - samples/server/petstore/aspnetcore-10.0-pocoModels
+          - samples/server/petstore/aspnetcore-10.0-project4Models
+          - samples/server/petstore/aspnetcore-10.0-useSwashBuckle
+          - samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management
+    steps:
+      - uses: actions/checkout@v7
</file context>

steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6.0.0
with:
dotnet-version: '10.0.x'
- name: Build
working-directory: ${{ matrix.sample }}
run: dotnet build Org.OpenAPITools.sln
- name: Test
working-directory: ${{ matrix.sample }}
run: dotnet test Org.OpenAPITools.sln
9 changes: 9 additions & 0 deletions bin/configs/aspnetcore-10.0-NewtonsoftFalse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: aspnetcore
outputDir: samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
additionalProperties:
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
aspnetCoreVersion: "10.0"
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
useNewtonsoft: false
9 changes: 9 additions & 0 deletions bin/configs/aspnetcore-10.0-abstract-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: aspnetcore
outputDir: samples/server/petstore/aspnetcore-10.0-abstract-class
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
additionalProperties:
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
aspnetCoreVersion: "10.0"
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
classModifier: abstract
9 changes: 9 additions & 0 deletions bin/configs/aspnetcore-10.0-nullableReferenceTypes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: aspnetcore
outputDir: samples/server/petstore/aspnetcore-10.0-nullableReferenceTypes
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
additionalProperties:
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
aspnetCoreVersion: "10.0"
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
nullableReferenceTypes: true
9 changes: 9 additions & 0 deletions bin/configs/aspnetcore-10.0-pocoModels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: aspnetcore
outputDir: samples/server/petstore/aspnetcore-10.0-pocoModels
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
additionalProperties:
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
aspnetCoreVersion: "10.0"
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
pocoModels: true
9 changes: 9 additions & 0 deletions bin/configs/aspnetcore-10.0-project4Models.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: aspnetcore
outputDir: samples/server/petstore/aspnetcore-10.0-project4Models
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
additionalProperties:
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
aspnetCoreVersion: "10.0"
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
useSeparateModelProject: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
generatorName: aspnetcore
outputDir: samples/server/petstore/aspnetcore-10.0-use-centralized-package-version-management
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
additionalProperties:
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
aspnetCoreVersion: "10.0"
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
centralizedPackageVersionManagement: "enable"
11 changes: 11 additions & 0 deletions bin/configs/aspnetcore-10.0-useSwashBuckle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
generatorName: aspnetcore
outputDir: samples/server/petstore/aspnetcore-10.0-useSwashBuckle
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
additionalProperties:
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
aspnetCoreVersion: "10.0"
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
useSwashBuckle: false
buildTarget: library
isLibrary: true
8 changes: 8 additions & 0 deletions bin/configs/aspnetcore-10.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
generatorName: aspnetcore
outputDir: samples/server/petstore/aspnetcore-10.0
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
additionalProperties:
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
aspnetCoreVersion: "10.0"
userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
4 changes: 2 additions & 2 deletions docs/generators/aspnetcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl

| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|aspnetCoreVersion|ASP.NET Core version: 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|<dl><dt>**2.0**</dt><dd>ASP.NET Core 2.0</dd><dt>**2.1**</dt><dd>ASP.NET Core 2.1</dd><dt>**2.2**</dt><dd>ASP.NET Core 2.2</dd><dt>**3.0**</dt><dd>ASP.NET Core 3.0</dd><dt>**3.1**</dt><dd>ASP.NET Core 3.1</dd><dt>**5.0**</dt><dd>ASP.NET Core 5.0</dd><dt>**6.0**</dt><dd>ASP.NET Core 6.0</dd><dt>**7.0**</dt><dd>ASP.NET Core 7.0</dd><dt>**8.0**</dt><dd>ASP.NET Core 8.0</dd></dl>|8.0|
|aspnetCoreVersion|ASP.NET Core version: 10.0, 8.0, 7.0, 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)|<dl><dt>**2.0**</dt><dd>ASP.NET Core 2.0</dd><dt>**2.1**</dt><dd>ASP.NET Core 2.1</dd><dt>**2.2**</dt><dd>ASP.NET Core 2.2</dd><dt>**3.0**</dt><dd>ASP.NET Core 3.0</dd><dt>**3.1**</dt><dd>ASP.NET Core 3.1</dd><dt>**5.0**</dt><dd>ASP.NET Core 5.0</dd><dt>**6.0**</dt><dd>ASP.NET Core 6.0</dd><dt>**7.0**</dt><dd>ASP.NET Core 7.0</dd><dt>**8.0**</dt><dd>ASP.NET Core 8.0</dd><dt>**10.0**</dt><dd>ASP.NET Core 10.0</dd></dl>|10.0|
|buildTarget|Target to build an application or library|<dl><dt>**program**</dt><dd>Generate code for a standalone server</dd><dt>**library**</dt><dd>Generate code for a server abstract class library</dd></dl>|program|
|centralizedPackageVersionManagement|Option to control the usage of centralized package version management. https://devblogs.microsoft.com/nuget/introducing-central-package-management/#disabling-central-package-management|<dl><dt>**optout**</dt><dd>Opt out of centralized package version management. Set this if you have a Directory.Packages.pros file but want this project to ignore it.</dd><dt>**default**</dt><dd>Property in project won't be used</dd><dt>**enable**</dt><dd>Centralized package version management will be used</dd></dl>|null|
|classModifier|Class Modifier for controller classes: Empty string or abstract.| ||
Expand Down Expand Up @@ -46,7 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|returnICollection|Return ICollection&lt;T&gt; instead of the concrete type.| |false|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src|
|swashbuckleVersion|Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0|<dl><dt>**3.0.0**</dt><dd>Swashbuckle 3.0.0</dd><dt>**4.0.0**</dt><dd>Swashbuckle 4.0.0</dd><dt>**5.0.0**</dt><dd>Swashbuckle 5.0.0</dd><dt>**6.4.0**</dt><dd>Swashbuckle 6.4.0</dd></dl>|6.4.0|
|swashbuckleVersion|Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0, 10.2.3|<dl><dt>**3.0.0**</dt><dd>Swashbuckle 3.0.0</dd><dt>**4.0.0**</dt><dd>Swashbuckle 4.0.0</dd><dt>**5.0.0**</dt><dd>Swashbuckle 5.0.0</dd><dt>**6.4.0**</dt><dd>Swashbuckle 6.4.0</dd><dt>**10.2.3**</dt><dd>Swashbuckle 10.2.3</dd></dl>|10.2.3|
|useCollection|Deserialize array types to Collection&lt;T&gt; instead of List&lt;T&gt;.| |false|
|useDateTimeForDate|Use DateTime to model date properties even if DateOnly supported. (.net 6.0+ only)| |false|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen {
private boolean useSeparateModelProject = false;
protected int serverPort = 8080;
protected String serverHost = "0.0.0.0";
protected CliOption swashbuckleVersion = new CliOption(SWASHBUCKLE_VERSION, "Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0");
protected CliOption aspnetCoreVersion = new CliOption(ASPNET_CORE_VERSION, "ASP.NET Core version: 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)");
protected CliOption swashbuckleVersion = new CliOption(SWASHBUCKLE_VERSION, "Swashbuckle version: 3.0.0 (deprecated), 4.0.0 (deprecated), 5.0.0 (deprecated), 6.4.0, 10.2.3");
protected CliOption aspnetCoreVersion = new CliOption(ASPNET_CORE_VERSION, "ASP.NET Core version: 10.0, 8.0, 7.0, 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0 (deprecated)");
private CliOption classModifier = new CliOption(CLASS_MODIFIER, "Class Modifier for controller classes: Empty string or abstract.");
private CliOption operationModifier = new CliOption(OPERATION_MODIFIER, "Operation Modifier can be virtual or abstract");
private CliOption modelClassModifier = new CliOption(MODEL_CLASS_MODIFIER, "Model Class Modifier can be nothing or partial");
Expand Down Expand Up @@ -199,15 +199,17 @@ public AspNetServerCodegen() {
aspnetCoreVersion.addEnum("6.0", "ASP.NET Core 6.0");
aspnetCoreVersion.addEnum("7.0", "ASP.NET Core 7.0");
aspnetCoreVersion.addEnum("8.0", "ASP.NET Core 8.0");
aspnetCoreVersion.setDefault("8.0");
aspnetCoreVersion.addEnum("10.0", "ASP.NET Core 10.0");
aspnetCoreVersion.setDefault("10.0");
aspnetCoreVersion.setOptValue(aspnetCoreVersion.getDefault());
cliOptions.add(aspnetCoreVersion);

swashbuckleVersion.addEnum("3.0.0", "Swashbuckle 3.0.0");
swashbuckleVersion.addEnum("4.0.0", "Swashbuckle 4.0.0");
swashbuckleVersion.addEnum("5.0.0", "Swashbuckle 5.0.0");
swashbuckleVersion.addEnum("6.4.0", "Swashbuckle 6.4.0");
swashbuckleVersion.setDefault("6.4.0");
swashbuckleVersion.addEnum("10.2.3", "Swashbuckle 10.2.3");
swashbuckleVersion.setDefault("10.2.3");
swashbuckleVersion.setOptValue(swashbuckleVersion.getDefault());
cliOptions.add(swashbuckleVersion);

Expand Down Expand Up @@ -739,6 +741,7 @@ private void setAspnetCoreVersion(String packageFolder) {

private String determineTemplateVersion(String frameworkVersion) {
switch (frameworkVersion) {
case "10.0":
case "8.0":
case "7.0":
case "6.0":
Expand Down Expand Up @@ -834,6 +837,13 @@ private void setIsFramework() {
useFrameworkReference = true;
additionalProperties.put(USE_FRAMEWORK_REFERENCE, useFrameworkReference);
additionalProperties.put(TARGET_FRAMEWORK, "net8.0");
} else if (aspnetCoreVersion.getOptValue().startsWith("10.")) {
LOGGER.warn(
"ASP.NET core version is {} so changing to use frameworkReference instead of packageReference ",
aspnetCoreVersion.getOptValue());
useFrameworkReference = true;
additionalProperties.put(USE_FRAMEWORK_REFERENCE, useFrameworkReference);
additionalProperties.put(TARGET_FRAMEWORK, "net10.0");
} else {
if (additionalProperties.containsKey(USE_FRAMEWORK_REFERENCE)) {
useFrameworkReference = convertPropertyToBooleanAndWriteBack(USE_FRAMEWORK_REFERENCE);
Expand All @@ -850,7 +860,8 @@ private void setAdditionalPropertyForFramework() {
String targetFramework = ((String) additionalProperties.get(TARGET_FRAMEWORK));
if (targetFramework.startsWith("net6.0") ||
targetFramework.startsWith("net7.0") ||
targetFramework.startsWith("net8.0")) {
targetFramework.startsWith("net8.0") ||
targetFramework.startsWith("net10.0")) {
additionalProperties.put(NET_60_OR_LATER, true);
}
}
Expand Down Expand Up @@ -900,6 +911,14 @@ private void setSwashbuckleVersion() {
LOGGER.warn("ASP.NET core version is {} so changing default Swashbuckle version to 6.4.0.", aspnetCoreVersion.getOptValue());
swashbuckleVersion.setOptValue("6.4.0");
additionalProperties.put(SWASHBUCKLE_VERSION, swashbuckleVersion.getOptValue());
} else if (aspnetCoreVersion.getOptValue().startsWith("8.")) {
LOGGER.warn("ASP.NET core version is {} so changing default Swashbuckle version to 6.4.0.", aspnetCoreVersion.getOptValue());
swashbuckleVersion.setOptValue("6.4.0");
additionalProperties.put(SWASHBUCKLE_VERSION, swashbuckleVersion.getOptValue());
} else if (aspnetCoreVersion.getOptValue().startsWith("10.")) {
LOGGER.warn("ASP.NET core version is {} so changing default Swashbuckle version to 10.2.3.", aspnetCoreVersion.getOptValue());
swashbuckleVersion.setOptValue("10.2.3");
additionalProperties.put(SWASHBUCKLE_VERSION, swashbuckleVersion.getOptValue());
} else {
// default, do nothing
LOGGER.info("Swashbuckle version: {}", swashbuckleVersion.getOptValue());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#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:{{aspnetCoreVersion}}-buster-slim AS base
FROM mcr.microsoft.com/dotnet/core/aspnet:{{aspnetCoreVersion}} 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 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.

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 modules/openapi-generator/src/main/resources/aspnetcore/3.0/Dockerfile.mustache, line 4:

<comment>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.</comment>

<file context>
@@ -1,13 +1,13 @@
 
 # Container we use for final publish
-FROM mcr.microsoft.com/dotnet/core/aspnet:{{aspnetCoreVersion}}-buster-slim AS base
+FROM mcr.microsoft.com/dotnet/core/aspnet:{{aspnetCoreVersion}} AS base
 WORKDIR /app
 EXPOSE 80
</file context>

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 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.

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 modules/openapi-generator/src/main/resources/aspnetcore/3.0/Dockerfile.mustache, line 4:

<comment>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.</comment>

<file context>
@@ -1,13 +1,13 @@
 
 # Container we use for final publish
-FROM mcr.microsoft.com/dotnet/core/aspnet:{{aspnetCoreVersion}}-buster-slim AS base
+FROM mcr.microsoft.com/dotnet/core/aspnet:{{aspnetCoreVersion}} AS base
 WORKDIR /app
 EXPOSE 80
</file context>

WORKDIR /app
EXPOSE 80
EXPOSE 443

# Build container
FROM mcr.microsoft.com/dotnet/core/sdk:{{aspnetCoreVersion}}-buster AS build
FROM mcr.microsoft.com/dotnet/core/sdk:{{aspnetCoreVersion}} AS build

# Copy the code into the container
WORKDIR /{{sourceFolder}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Org.OpenAPITools.sln
README.md
build.bat
build.sh
src/Org.OpenAPITools/.gitignore
src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
src/Org.OpenAPITools/Controllers/DefaultApi.cs
src/Org.OpenAPITools/Controllers/FakeApi.cs
src/Org.OpenAPITools/Controllers/PetApi.cs
src/Org.OpenAPITools/Controllers/StoreApi.cs
src/Org.OpenAPITools/Controllers/UserApi.cs
src/Org.OpenAPITools/Converters/CustomEnumConverter.cs
src/Org.OpenAPITools/Dockerfile
src/Org.OpenAPITools/Filters/BasePathFilter.cs
src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs
src/Org.OpenAPITools/Formatters/InputFormatterStream.cs
src/Org.OpenAPITools/Models/Animal.cs
src/Org.OpenAPITools/Models/ApiResponse.cs
src/Org.OpenAPITools/Models/Cat.cs
src/Org.OpenAPITools/Models/Category.cs
src/Org.OpenAPITools/Models/Dog.cs
src/Org.OpenAPITools/Models/Order.cs
src/Org.OpenAPITools/Models/Pet.cs
src/Org.OpenAPITools/Models/Tag.cs
src/Org.OpenAPITools/Models/TestEnum.cs
src/Org.OpenAPITools/Models/TestNullable.cs
src/Org.OpenAPITools/Models/User.cs
src/Org.OpenAPITools/OpenApi/TypeExtensions.cs
src/Org.OpenAPITools/Org.OpenAPITools.csproj
src/Org.OpenAPITools/Program.cs
src/Org.OpenAPITools/Properties/launchSettings.json
src/Org.OpenAPITools/Startup.cs
src/Org.OpenAPITools/appsettings.Development.json
src/Org.OpenAPITools/appsettings.json
src/Org.OpenAPITools/wwwroot/index.html
src/Org.OpenAPITools/wwwroot/openapi-original.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.26.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2043
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
50 changes: 50 additions & 0 deletions samples/server/petstore/aspnetcore-10.0-NewtonsoftFalse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Org.OpenAPITools - ASP.NET Core 10.0 Server

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

## Upgrade NuGet Packages

NuGet packages get frequently updated.

To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool.


Install dotnet-outdated tool:

```
dotnet tool install --global dotnet-outdated-tool
```

Upgrade only to new minor versions of packages

```
dotnet outdated --upgrade --version-lock Major
```

Upgrade to all new versions of packages (more likely to include breaking API changes)

```
dotnet outdated --upgrade
```


## Run

Linux/OS X:

```
sh build.sh
```

Windows:

```
build.bat
```
## Run in Docker

```
cd src/Org.OpenAPITools
docker build -t org.openapitools .
Comment on lines +47 to +48

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 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.

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/README.md, line 47:

<comment>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`.</comment>

<file context>
@@ -0,0 +1,50 @@
+## Run in Docker
+
+```
+cd src/Org.OpenAPITools
+docker build -t org.openapitools .
+docker run -p 5000:8080 org.openapitools
</file context>
Suggested change
cd src/Org.OpenAPITools
docker build -t org.openapitools .
docker build -f src/Org.OpenAPITools/Dockerfile -t org.openapitools .

docker run -p 5000:8080 org.openapitools
Comment on lines +47 to +49

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 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.

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/README.md, line 47:

<comment>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.</comment>

<file context>
@@ -0,0 +1,50 @@
+## Run in Docker
+
+```
+cd src/Org.OpenAPITools
+docker build -t org.openapitools .
+docker run -p 5000:8080 org.openapitools
</file context>
Suggested change
cd src/Org.OpenAPITools
docker build -t org.openapitools .
docker run -p 5000:8080 org.openapitools
docker build -f src/Org.OpenAPITools/Dockerfile -t org.openapitools .
docker run -p 5000:8080 org.openapitools

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:: Generated by: https://openapi-generator.tech
::

@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.

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 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).

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/build.bat, line 8:

<comment>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).</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

echo.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
#
# Generated by: https://openapi-generator.tech
#

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 nonexistent web launch profile; this sample defines OpenAPI, so following the instruction fails. Use --launch-profile OpenAPI.

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/build.sh, line 8:

<comment>The suggested command selects a nonexistent `web` launch profile; this sample defines `OpenAPI`, so following the instruction fails. Use `--launch-profile OpenAPI`.</comment>

<file context>
@@ -0,0 +1,8 @@
+
+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
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"

Loading