Skip to content

[BUG] csharp-generichost build errors  #19626

@leorg99

Description

@leorg99

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
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
  • Create csharp.config file
  • Execute the following:
nvm install latest
nvm use latest
npm install -g npm@latest
npm install @openapitools/openapi-generator-cli -D
curl -o filescom-v1.json https://app.files.com/api/rest/v1/swagger_doc.json
npx @openapitools/openapi-generator-cli generate -i .\filescom-v1.json -o .\generated -g csharp -c csharp.config

Build

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions