Skip to content

Commit ffefebd

Browse files
authored
[csharp] Process webhook operations (OpenAPITools#21082)
* process webhook operations * process webhook operations * build samples
1 parent 7a57b80 commit ffefebd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3658
-316
lines changed

.github/workflows/openapi-generator.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ jobs:
142142
path: modules/openapi-generator-cli/target
143143
- name: Delete samples that are entirely generated
144144
run: |
145+
rm -rf samples/client/petstore/csharp/generichost/latest/HelloWorld
145146
rm -rf samples/client/petstore/csharp/generichost/latest/Tags
146147
147148
rm -rf samples/client/petstore/csharp/generichost/net8/AllOf

.github/workflows/samples-dotnet9.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
matrix:
2525
sample:
2626
- samples/client/petstore/csharp/generichost/latest/Tags
27+
- samples/client/petstore/csharp/generichost/latest/HelloWorld
2728
- samples/client/petstore/csharp/generichost/net9/AllOf
2829
- samples/client/petstore/csharp/generichost/net9/AnyOf
2930
- samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare

appveyor.yml

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ build_script:
4343
#- dotnet build samples\client\petstore\csharp\OpenAPIClient-ConditionalSerialization\Org.OpenAPITools.sln
4444

4545
test_script:
46+
- dotnet test samples\client\petstore\csharp\generichost\latest\Tags\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
47+
- dotnet test samples\client\petstore\csharp\generichost\latest\HelloWorld\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
48+
4649
- dotnet test samples\client\petstore\csharp\generichost\net9\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
4750
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
4851
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# for csharp generichost
2+
generatorName: csharp
3+
outputDir: samples/client/petstore/csharp/generichost/latest/HelloWorld
4+
inputSpec: modules/openapi-generator/src/test/resources/3_1/csharp/hello-world.yaml
5+
templateDir: modules/openapi-generator/src/main/resources/csharp
6+
additionalProperties:
7+
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
8+
modelPropertySorting: alphabetical
9+
operationParameterSorting: alphabetical

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java

+332-316
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Minimal reproduction for csharp webhook bug
4+
version: 1.0.0
5+
description: This is an example API to reproduce a bug with webhooks in csharp codegen
6+
tags:
7+
- name: Test
8+
description: This is a test
9+
webhooks:
10+
helloWorld:
11+
post:
12+
summary: Example webhook
13+
responses:
14+
"204":
15+
description: Webhook processed
16+
"500":
17+
description: Webhook not processed
18+
description: Send when an example is needed
19+
requestBody:
20+
content:
21+
application/json:
22+
schema:
23+
type: object
24+
properties:
25+
message:
26+
type: string
27+
description: The payload of the HelloWorld webhook
28+
description: Contains the details of the hello world webhook

0 commit comments

Comments
 (0)