Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3b9c7a6
Add basic set up for the new flag with translations by Copilot
sander1095 Feb 12, 2025
734817a
Add conditional logic to use OpenAPI
sander1095 Feb 12, 2025
5be274c
Add OpenAPI test to WebAPIAOT template tests
sander1095 Feb 12, 2025
d8693b2
Fix tests
sander1095 Feb 12, 2025
d0b3ce9
Add missing endif in the csproj
sander1095 Feb 12, 2025
ffee0b2
Add more metadata to get 404 not found in the openapi doc correctly
sander1095 Feb 12, 2025
94e40fd
Also add the 404 metadata to the other file
sander1095 Feb 12, 2025
d918e32
Change elif to else
sander1095 Feb 14, 2025
664bec6
Remove unnecessary 118n changes
sander1095 Feb 14, 2025
e225cc2
Add english translation back
sander1095 Feb 14, 2025
539ba41
Keep the semicolon on the same line as requested by PR review
sander1095 Feb 14, 2025
06112f2
Use TypedResults instead of extension methods and reduce the if else …
sander1095 Feb 14, 2025
8dc2ceb
Add template strings back after running `bash build.sh -test -configu…
sander1095 Feb 14, 2025
98332af
Merge branch 'main' into GH-59564-webapiaot-openapi
sander1095 Mar 3, 2025
a442d80
Add usings for TypedResults and Results/NotFound/Ok etc..
sander1095 Mar 3, 2025
0891a99
Add OpenAPI services to Program.Main.cs
sander1095 Mar 3, 2025
3c4d854
Remove http using because thats already part of the implicit usings
sander1095 Mar 3, 2025
63cf302
TEMP COMMIT - Removing EnableOpenAPI flags to find out why tests fail
sander1095 Mar 4, 2025
9674e32
Revert "TEMP COMMIT - Removing EnableOpenAPI flags to find out why te…
sander1095 Mar 4, 2025
983ec24
Fix assertions where we expected OpenAPI to be enabled for published …
sander1095 Mar 4, 2025
102bbb4
Added consistent indentation in test methods
sander1095 Mar 4, 2025
7cf3a0b
Fix build errors
sander1095 Mar 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@
<PublishAot>true</PublishAot>
</PropertyGroup>

<!--#if (EnableOpenAPI) -->
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="${MicrosoftAspNetCoreOpenApiVersion}" Condition="'$(EnableOpenAPI)' == 'True'" />
</ItemGroup>
<!--#endif -->

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
"UseProgramMain": {
"longName": "use-program-main",
"shortName": ""
},
"DisableOpenAPI": {
"longName": "no-openapi",
"shortName": ""
}
},
"usageExamples": [
""
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@
"isVisible": true,
"persistenceScope": "shared",
"persistenceScopeName": "Microsoft"
},
{
"id": "DisableOpenAPI",
"name": {
"text": "Enable _OpenAPI support",
"overrideDefaultText": true
},
"description": {
"text": "Enables OpenAPI (Swagger) support",
"overrideDefaultText": true
},
"invertBoolean": true,
"isVisible": true,
"defaultValue": "true",
"persistenceScope": "templateGroup"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "ASP.NET Core Web API (native AOT)",
"description": "Šablona projektu pro vytvoření webového rozhraní RESTful API s využitím minimálních rozhraní API ASP.NET Core publikovaných jako native AOT.",
"description": "Šablona projektu pro vytvoření webového rozhraní RESTful API s využitím minimálních rozhraní API ASP.NET Core publikovaných jako native AOT, s volitelnou podporou OpenAPI.",
"symbols/ExcludeLaunchSettings/description": "Určuje, jestli se má z vygenerované šablony vyloučit soubor launchSettings.json.",
"symbols/kestrelHttpPort/description": "Číslo portu, který se má použít pro koncový bod HTTP v souboru launchSettings.json.",
"symbols/iisHttpPort/description": "Číslo portu, který se má použít pro koncový bod IIS Express HTTP v souboru launchSettings.json.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "Pokud se tato možnost zadá, přeskočí automatické obnovení projektu při vytvoření.",
"symbols/UseProgramMain/displayName": "Nepoužívat _příkazy nejvyšší úrovně",
"symbols/UseProgramMain/description": "Určuje, jestli se má místo příkazů nejvyšší úrovně generovat explicitní třída Program a metoda Main.",
"symbols/DisableOpenAPI/description": "Zakázání podpory OpenAPI (Swagger)",
"postActions/restore/description": "Obnoví balíčky NuGet vyžadované tímto projektem.",
"postActions/restore/manualInstructions/default/text": "Spustit dotnet restore"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "ASP.NET Core Web-API (native AOT)",
"description": "Eine Projektvorlage zum Erstellen einer RESTful-Web-API mit ASP.NET Core minimalen APIs, die als native AOT veröffentlicht wurden.",
"description": "Eine Projektvorlage zum Erstellen einer RESTful-Web-API mit ASP.NET Core minimalen APIs, die als native AOT veröffentlicht wurden, mit optionaler Unterstützung für OpenAPI.",
"symbols/ExcludeLaunchSettings/description": "Ob launchSettings.json aus der generierten Vorlage ausgeschlossen werden soll.",
"symbols/kestrelHttpPort/description": "Portnummer, die für den HTTP Endpunkt in launchSettings.json verwendet werden soll.",
"symbols/iisHttpPort/description": "Portnummer, die für den IIS Express HTTP Endpunkt in launchSettings.json verwendet werden soll.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "Wenn angegeben, wird die automatische Wiederherstellung des Projekts beim Erstellen übersprungen.",
"symbols/UseProgramMain/displayName": "Keine Anweisungen_der obersten Ebene verwenden",
"symbols/UseProgramMain/description": "Gibt an, ob anstelle von Anweisungen der obersten Ebene eine explizite Programmklasse und eine Main-Methode generiert werden soll.",
"symbols/DisableOpenAPI/description": "Deaktivieren Sie die OpenAPI (Swagger) Unterstützung",
"postActions/restore/description": "„NuGet-Pakete“ wiederherstellen, die für dieses Projekt erforderlich sind.",
"postActions/restore/manualInstructions/default/text": "„dotnet restore“ ausführen"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "ASP.NET Core Web API (native AOT)",
"description": "A project template for creating a RESTful Web API using ASP.NET Core minimal APIs published as native AOT.",
"description": "A project template for creating a RESTful Web API using ASP.NET Core minimal APIs published as native AOT, with optional support for OpenAPI.",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/UseProgramMain/displayName": "Do not use _top-level statements",
"symbols/UseProgramMain/description": "Whether to generate an explicit Program class and Main method instead of top-level statements.",
"symbols/DisableOpenAPI/description": "Disable OpenAPI (Swagger) support",
"postActions/restore/description": "Restore NuGet packages required by this project.",
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "API web ASP.NET Core (native AOT)",
"description": "Una plantilla de proyecto para crear una API web RESTful utilizando las API mínimas de ASP.NET Core publicadas como native AOT.",
"description": "Una plantilla de proyecto para crear una API web RESTful utilizando las API mínimas de ASP.NET Core publicadas como native AOT, con soporte opcional para OpenAPI.",
"symbols/ExcludeLaunchSettings/description": "Indica si se va a excluir launchSettings.json de la plantilla generada.",
"symbols/kestrelHttpPort/description": "Número de puerto que se va a usar para el punto de conexión HTTP en launchSettings.json.",
"symbols/iisHttpPort/description": "Número de puerto que se va a usar para el punto de conexión HTTP de IIS Express en launchSettings.json.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "Si se especifica, se omite la restauración automática del proyecto durante la creación.",
"symbols/UseProgramMain/displayName": "No usar instrucciones de _nivel superior",
"symbols/UseProgramMain/description": "Indica si se debe generar una clase Program explícita y un método Main en lugar de instrucciones de nivel superior.",
"symbols/DisableOpenAPI/description": "Deshabilitar la compatibilidad con OpenAPI (Swagger)",
"postActions/restore/description": "Restaure los paquetes NuGet necesarios para este proyecto.",
"postActions/restore/manualInstructions/default/text": "Ejecutar \"dotnet restore\""
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "API web ASP.NET Core (AOT natif)",
"description": "Modèle de projet pour la création d’une API web RESTful à l’aide de ASP.NET Core api minimales publiées en tant qu’AOT natif.",
"description": "Modèle de projet pour la création d’une API web RESTful à l’aide de ASP.NET Core api minimales publiées en tant qu’AOT natif, avec prise en charge optionnelle d’OpenAPI.",
"symbols/ExcludeLaunchSettings/description": "Indique s’il faut exclure launchSettings.json du modèle généré.",
"symbols/kestrelHttpPort/description": "Numéro de port à utiliser pour le point de terminaison HTTP dans launchSettings.json.",
"symbols/iisHttpPort/description": "Numéro de port à utiliser pour le point de terminaison HTTP IIS Express dans launchSettings.json.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "S’il est spécifié, ignore la restauration automatique du projet lors de la création.",
"symbols/UseProgramMain/displayName": "N’utilisez pas _d’instructions de niveau supérieur.",
"symbols/UseProgramMain/description": "Indique s’il faut générer une classe Programme explicite et une méthode Main au lieu d’instructions de niveau supérieur.",
"symbols/DisableOpenAPI/description": "Désactiver la prise en charge d’OpenAPI (Swagger)",
"postActions/restore/description": "Restaurez les packages NuGet requis par ce projet.",
"postActions/restore/manualInstructions/default/text": "Exécuter « dotnet restore »"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "API Web di ASP.NET Core (native AOT)",
"description": "Modello di progetto per la creazione di un'API Web RESTful tramite API minime di ASP.NET Core pubblicate come native AOT.",
"description": "Modello di progetto per la creazione di un'API Web RESTful tramite API minime di ASP.NET Core pubblicate come native AOT, con supporto opzionale per OpenAPI.",
"symbols/ExcludeLaunchSettings/description": "Indica se escludere launchSettings.json dal modello generato.",
"symbols/kestrelHttpPort/description": "Numero di porta da usare per l'endpoint HTTP in launchSettings.json.",
"symbols/iisHttpPort/description": "Numero di porta da usare per l'endpoint HTTP in launchSettings.json.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "Se specificato, ignora il ripristino automatico del progetto durante la creazione.",
"symbols/UseProgramMain/displayName": "Non usare_istruzioni di primo livello",
"symbols/UseProgramMain/description": "Indica se generare una classe Program esplicita e un metodo Main anziché istruzioni di primo livello.",
"symbols/DisableOpenAPI/description": "Disabilita il supporto di OpenAPI (Swagger)",
"postActions/restore/description": "Ripristina i pacchetti NuGet richiesti da questo progetto.",
"postActions/restore/manualInstructions/default/text": "Esegui 'dotnet restore'"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "ASP.NET Core Web API (native AOT)",
"description": "最小限の API.NET Core API を使用して RESTful Web API を作成するプロジェクト テンプレート。native AOT として公開されます。",
"description": "最小限の API.NET Core API を使用して RESTful Web API を作成するプロジェクト テンプレート。native AOT として公開されます。OpenAPI のサポートもオプションで利用できます。",
"symbols/ExcludeLaunchSettings/description": "生成されたテンプレートから launchSettings.json を除外するかどうか。",
"symbols/kestrelHttpPort/description": "launchSettings.json の HTTP エンドポイントに使用するポート番号。",
"symbols/iisHttpPort/description": "launchSettings.json の IIS Express HTTP エンドポイントに使用するポート番号。",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "指定した場合、作成時にプロジェクトの自動復元がスキップされます。",
"symbols/UseProgramMain/displayName": "最上位レベルのステートメントを使用しない(_T)",
"symbols/UseProgramMain/description": "最上位レベルのステートメントではなく、明示的な Program クラスと Main メソッドを生成するかどうか。",
"symbols/DisableOpenAPI/description": "OpenAPI (Swagger) サポートを無効にする",
"postActions/restore/description": "このプロジェクトに必要な NuGet パッケージを復元します。",
"postActions/restore/manualInstructions/default/text": "'dotnet restore' を実行する"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "ASP.NET Core 웹 API(native AOT)",
"description": "native AOT로 게시된 ASP.NET Core 최소 API를 사용하여 RESTful 웹 API를 만들기 위한 프로젝트 템플릿입니다.",
"description": "native AOT로 게시된 ASP.NET Core 최소 API를 사용하여 RESTful 웹 API를 만들기 위한 프로젝트 템플릿입니다. OpenAPI 지원도 선택적으로 사용할 수 있습니다.",
"symbols/ExcludeLaunchSettings/description": "생성된 템플릿에서 launchSettings.json을 제외할지 여부입니다.",
"symbols/kestrelHttpPort/description": "launchSettings.json의 HTTP 엔드포인트에 사용할 포트 번호입니다.",
"symbols/iisHttpPort/description": "launchSettings.json의 IIS Express HTTP 엔드포인트에 사용할 포트 번호입니다.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "지정된 경우, 프로젝트 생성 시 자동 복원을 건너뜁니다.",
"symbols/UseProgramMain/displayName": "최상위 문 사용 안 함(_T)",
"symbols/UseProgramMain/description": "최상위 문 대신 명시적 Program 클래스 및 Main 메서드를 생성할지 여부입니다.",
"symbols/DisableOpenAPI/description": "OpenAPI(Swagger) 지원 비활성화",
"postActions/restore/description": "이 프로젝트에 필요한 NuGet 패키지를 복원합니다.",
"postActions/restore/manualInstructions/default/text": "'dotnet restore' 실행"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "Internetowy interfejs API platformy ASP.NET Core (native AOT)",
"description": "Szablon projektu służący do tworzenia internetowego interfejsu API RESTful przy użyciu minimalnych interfejsów API platformy ASP.NET Core publikowanego jako native AOT.",
"description": "Szablon projektu służący do tworzenia internetowego interfejsu API RESTful przy użyciu minimalnych interfejsów API platformy ASP.NET Core publikowanego jako native AOT, z opcjonalnym wsparciem dla OpenAPI.",
"symbols/ExcludeLaunchSettings/description": "Określa, czy wykluczyć plik launchSettings.json z wygenerowanego szablonu.",
"symbols/kestrelHttpPort/description": "Numer portu do użycia dla punktu końcowego HTTP w pliku launchSettings.json.",
"symbols/iisHttpPort/description": "Numer portu do użycia dla punktu końcowego HTTP usług IIS Express w pliku launchSettings.json.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "Jeśli ta opcja jest określona, pomija automatyczne przywracanie projektu podczas tworzenia.",
"symbols/UseProgramMain/displayName": "Nie używaj ins_trukcji najwyższego poziomu",
"symbols/UseProgramMain/description": "Określa, czy wygenerować jawną klasę Program i metodę Main zamiast instrukcji najwyższego poziomu.",
"symbols/DisableOpenAPI/description": "Włącz obsługę interfejsu OpenAPI (Swagger)",
"postActions/restore/description": "Przywróć pakiety NuGet wymagane przez ten projekt.",
"postActions/restore/manualInstructions/default/text": "Uruchom polecenie \"dotnet restore\""
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "ASP.NET Core API Web (native AOT)",
"description": "Um modelo de projeto para criar uma API Web RESTful usando ASP.NET Core APIs mínimas publicadas como native AOT.",
"description": "Um modelo de projeto para criar uma API Web RESTful usando ASP.NET Core APIs mínimas publicadas como native AOT, com suporte opcional para OpenAPI.",
"symbols/ExcludeLaunchSettings/description": "Se deve excluir launchSettings.json do modelo gerado.",
"symbols/kestrelHttpPort/description": "Número da porta a ser usada para o ponto de extremidade HTTP em launchSettings.json.",
"symbols/iisHttpPort/description": "Número da porta a ser usada para o ponto de extremidade HTTP do IIS Express em launchSettings.json.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "Se especificado, ignora a restauração automática do projeto sendo criado.",
"symbols/UseProgramMain/displayName": "Não use ins_truções de nível superior",
"symbols/UseProgramMain/description": "Se deve gerar uma classe de Programa explícita e um método principal em vez de instruções de nível superior.",
"symbols/DisableOpenAPI/description": "Desabilitar suporte a OpenAPI (Swagger)",
"postActions/restore/description": "Restaure os pacotes NuGet exigidos por este projeto.",
"postActions/restore/manualInstructions/default/text": "Executa 'dotnet restore'"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "Веб-API ASP.NET Core (native AOT)",
"description": "Шаблон проекта для создания веб-API на основе REST с использованием минимальных API ASP.NET Core, опубликованных как «native AOT».",
"description": "Шаблон проекта для создания веб-API на основе REST с использованием минимальных API ASP.NET Core, опубликованных как «native AOT», с поддержкой OpenAPI по желанию.",
"symbols/ExcludeLaunchSettings/description": "Следует ли исключить launchSettings.json из созданного шаблона.",
"symbols/kestrelHttpPort/description": "Номер порта, используемый для конечной точки HTTP в launchSettings.json.",
"symbols/iisHttpPort/description": "Номер порта, используемый для конечной точки HTTP IIS Express в launchSettings.json.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "Если установлено, автоматическое восстановление проекта при создании пропускается.",
"symbols/UseProgramMain/displayName": "Не использовать _операторы верхнего уровня",
"symbols/UseProgramMain/description": "Следует ли создавать явный класс Program и метод Main вместо операторов верхнего уровня.",
"symbols/DisableOpenAPI/description": "Отключение поддержки OpenAPI (Swagger)",
"postActions/restore/description": "Восстановление пакетов NuGet, необходимых для этого проекта.",
"postActions/restore/manualInstructions/default/text": "Выполнить команду \"dotnet restore\""
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Microsoft",
"name": "ASP.NET Core Web API'si (yerel AOT)",
"description": "Yerel AOT olarak yayımlanan ASP.NET Core minimal API’ları kullanarak RESTful Web API oluşturmaya yönelik proje şablonu.",
"description": "Yerel AOT olarak yayımlanan ASP.NET Core minimal API’ları kullanarak RESTful Web API oluşturmaya yönelik proje şablonu, isteğe bağlı OpenAPI desteği ile.",
"symbols/ExcludeLaunchSettings/description": "launchSettings.json öğesinin oluşturulan şablondan dışlanıp dışlanmayacağı.",
"symbols/kestrelHttpPort/description": "launchSettings.json içinde HTTP uç noktası için kullanılacak bağlantı noktası numarası.",
"symbols/iisHttpPort/description": "launchSettings.json içinde IIS Express HTTP uç noktası için kullanılacak bağlantı noktası numarası.",
Expand All @@ -10,6 +10,7 @@
"symbols/skipRestore/description": "Belirtilirse, oluşturma sırasında projenin otomatik geri yüklenmesini atlar.",
"symbols/UseProgramMain/displayName": "_Üst düzey deyimler kullanmayın",
"symbols/UseProgramMain/description": "Üst düzey deyimler yerine açık bir Program sınıfı ve Ana yöntem oluşturup oluşturulmayacağını belirtir.",
"symbols/DisableOpenAPI/description": "OpenAPI (Swagger) desteğini devre dışı bırak",
"postActions/restore/description": "Bu projenin gerektirdiği NuGet paketlerini geri yükleyin.",
"postActions/restore/manualInstructions/default/text": "'dotnet restore' çalıştır"
}
}
Loading
Loading