OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.81k stars 6.58k forks source link

[BUG] csharp-generichost build errors #19626

Closed leorg99 closed 1 month ago

leorg99 commented 1 month ago

Bug Report Checklist

Description

The generated .NET code has a few errors when using https://app.files.com/api/rest/v1/swagger_doc.json. The main issue I see is in the generated xml doc. Other issues are duplicates and missing types.

> dotnet build
FilesCom\Model\AutomationEntity.cs(685,1): warning CS1570: XML comment has badly formed XML -- 'Expected an end tag for element 'example'.' 
FilesCom\Model\GroupEntity.cs(109,1): warning CS1570: XML comment has badly formed XML -- 'Expected an end tag for element 'example'.' 
FilesCom\Model\PatchUserRequest.cs(647,1): warning CS1570: XML comment has badly formed XML -- 'Expected an end tag for element 'example'.' 
FilesCom\Model\PatchGroupsIdRequest.cs(177,1): warning CS1570: XML comment has badly formed XML -- 'Expected an end tag for element'example'.' 
FilesCom\Model\PostGroupsGroupIdUsersRequest.cs(639,1): warning CS1570: XML comment has badly formed XML -- 'Expected an end tag for element 'example'.' 
FilesCom\Model\PostUsersRequest.cs(655,1): warning CS1570: XML comment has badly formed XML -- 'Expected an end tag for element 'example'.' 
FilesCom\Model\UserEntity.cs(558,1): warning CS1570: XML comment has badly formed XML -- 'Expected an end tag for element 'example'.' 
FilesCom\Model\PostGroupsRequest.cs(184,1): warning CS1570: XML comment has badly formed XML -- 'Expected an end tag for element 'example'.' 
FilesCom\Client\ClientUtils.cs(51,15): error CS1003: Syntax error, ',' expected 
FilesCom\Client\ClientUtils.cs(51,23): error CS1003: Syntax error, ',' expected
FilesCom\Client\ClientUtils.cs(51,24): error CS1003: Syntax error, ',' expected 
FilesCom\Model\AutomationEntity.cs(685,3): error CS1519: Invalid token '2' in class, record, struct, or interface member declaration
FilesCom\Model\AutomationEntity.cs(685,19): error CS1002: ; expected 
FilesCom\Model\GroupEntity.cs(109,1): error CS1519: Invalid token '127.0' in class, record, struct, or interface member declaration
FilesCom\Model\GroupEntity.cs(109,19): error CS1519: Invalid token '>' in class, record, struct, or interface member declaration
FilesCom\Model\AutomationEntity.cs(685,28): error CS1001: Identifier expected 
FilesCom\Model\AutomationEntity.cs(685,28): error CS1003: Syntax error, ',' expected 
FilesCom\Model\AutomationEntity.cs(685,29): error CS1003: Syntax error, ',' expected 
FilesCom\Model\PatchUserRequest.cs(647,1): error CS1519: Invalid token '127.0' in class, record, struct, or interface member declaration 
FilesCom\Model\AutomationEntity.cs(685,32): error CS1001: Identifier expected 
FilesCom\Model\AutomationEntity.cs(685,32): error CS1026: ) expected 
FilesCom\Model\PatchUserRequest.cs(647,19): error CS1519: Invalid token '>' in class, record, struct, or interface member declaration 
FilesCom\Model\AutomationEntity.cs(685,40): error CS1519: Invalid token ')' in class, record, struct, or interface member declaration 
FilesCom\Model\AutomationEntity.cs(687,9): error CS1585: Member modifier 'public' must precede the member type and name 
FilesCom\Model\PatchGroupsIdRequest.cs(177,1): error CS1519: Invalid token '127.0' in class, record, struct, or interface member declaration 
FilesCom\Model\AutomationEntity.cs(685,45): error CS1031: Type expected 
FilesCom\Model\PatchGroupsIdRequest.cs(177,19): error CS1519: Invalid token '>' in class, record, struct, or interface member declaration 
FilesCom\Model\AutomationEntity.cs(685,45): error CS1003: Syntax error, ',' expected 
FilesCom\Model\AutomationEntity.cs(685,46): error CS1003: Syntax error, ',' expected 
FilesCom\Model\PostGroupsGroupIdUsersRequest.cs(639,1): error CS1519: Invalid token '127.0' in class, record, struct, or interface member declaration 
FilesCom\Model\PostGroupsGroupIdUsersRequest.cs(639,19): error CS1519: Invalid token '>' in class, record, struct, or interface member declaration 
FilesCom\Model\PostUsersRequest.cs(655,1): error CS1519: Invalid token '127.0' in class, record, struct, or interface member declaration 
FilesCom\Model\PostUsersRequest.cs(655,19): error CS1519: Invalid token '>' in class, record, struct, or interface member declaration 
FilesCom\Model\UserEntity.cs(558,1): error CS1519: Invalid token '127.0' in class, record, struct, or interface member declaration
FilesCom\Model\UserEntity.cs(558,19): error CS1519: Invalid token '>' in class, record, struct, or interface member declaration 
FilesCom\Model\PostGroupsRequest.cs(184,1): error CS1519: Invalid token '127.0' in class, record, struct, or interface member declaration 
FilesCom\Model\PostGroupsRequest.cs(184,19): error CS1519: Invalid token '>' in class, record, struct, or interface member declaration 
    8 Warning(s)
    30 Error(s)
openapi-generator version

7.8.0

OpenAPI declaration file content or url
Generation Details

csharp.config

{
    "apiName": "FilesComClient",
    "library": "generichost",
    "netCoreProjectFile": true,
    "nullableReferenceTypes": true,
    "optionalAssemblyInfo": true,
    "packageName": "FilesCom",
    "targetFramework": "net8.0",
    "sourceFolder": "src",
    "optionalProjectFile": "FilesCom"
}
Steps to reproduce

Build

cd generated
dotnet new globaljson --sdk-version 8.0.400 --roll-forward feature
dotnet build
Related issues/PRs
Suggest a fix
leorg99 commented 1 month ago

I believe @devhl-labs maintains this source generator library. Thanks in advance!