Repository navigation
[aspnetcore] Add support for .NET 10 #25161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| 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 | ||
| 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 |
| 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 |
| 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 |
| 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 |
| 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" |
| 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 |
| 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' |
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: The .NET 10 images are not published under the legacy Prompt for AI agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: This tag does not exist for the versions this template serves. Prompt for AI agents |
||
| 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}} | ||
|
|
||
| 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 |
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Prompt for AI agents
Suggested change
|
||||||||||||
| docker run -p 5000:8080 org.openapitools | ||||||||||||
|
Comment on lines
+47
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The documented Docker build fails because its context is Prompt for AI agents
Suggested change
|
||||||||||||
| ``` | ||||||||||||
| 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. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The sample has no Prompt for AI agents
Suggested change
|
||||||
| 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" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The suggested command selects a nonexistent Prompt for AI agents
Suggested change
|
||||||
There was a problem hiding this comment.
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-classsolution 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