Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[CSHARP] Duplicate constructor parameters in generated models from Swagger JSON #12538

Open
@bytrus

Description

@bytrus

Description:
When generating C# models from the following Swagger JSON:
🔗https://www.zsrnext.ch/ApiGateway/swagger/1/swagger.json
some generated classes contain constructors with duplicate parameters, resulting in invalid and non-compilable code.

Example:
The following constructor was generated for the class SasisRegisterCareProviderCommonModelsApiGatewayV1ResponsesContractBank:

public SasisRegisterCareProviderCommonModelsApiGatewayV1ResponsesContractBank( SasisRegisterCareProviderCommonModelsApiGatewayV1BankGroup bankGroup = default(SasisRegisterCareProviderCommonModelsApiGatewayV1BankGroup), SasisRegisterCareProviderCommonModelsApiGatewayV1Translation bankGroupTranslations = default(SasisRegisterCareProviderCommonModelsApiGatewayV1Translation), SasisRegisterCareProviderCommonModelsApiGatewayV1BankIidType bankIidType = default(SasisRegisterCareProviderCommonModelsApiGatewayV1BankIidType), SasisRegisterCareProviderCommonModelsApiGatewayV1Translation bankIidTypeTranslations = default(SasisRegisterCareProviderCommonModelsApiGatewayV1Translation), int? iid = default(int?), int? newIid = default(int?), string branchId = default(string), string sicIid = default(string), int? headquarterIid = default(int?), string shortName = default(string), string name = default(string), string postalAccountNumber = default(string), string bic = default(string), SasisRegisterCareProviderCommonModelsApiGatewayV1ResponsesContractContact contact = default(SasisRegisterCareProviderCommonModelsApiGatewayV1ResponsesContractContact), SasisRegisterCareProviderCommonModelsApiGatewayV1BankGroup bankGroup = default(SasisRegisterCareProviderCommonModelsApiGatewayV1BankGroup), // duplicate SasisRegisterCareProviderCommonModelsApiGatewayV1ResponsesContractContact contact = default(SasisRegisterCareProviderCommonModelsApiGatewayV1ResponsesContractContact), // duplicate long? id = default(long?) )
As you can see, both bankGroup and contact are included twice!

Code generated withhttps://app.swaggerhub.com/
Codgen -> ClientSDK -> CSharp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp