question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[C#] Issue with enum members

See original GitHub issue

I very recently started to study the migration of our API from swagger-codegen to openapi-generator and I encounter a problem with enumeration members.

Our API is C# .NET Core based and the Swagger JSON is generated through the latest swashbuckle-aspnetcore I believe almost everyone is using in this context.

I’m using the latest stable of openapi-generator: 3.1.1

What the swagger-codegen generation looks like:
/// <summary>
/// Enum DataMatrix for value: DataMatrix
/// </summary>
[EnumMember(Value = "DataMatrix")]
DataMatrix = 2
What the openapi-generator generation looks like:
/// <summary>
/// Enum DataMatrix for value: DataMatrix
/// </summary>            
DataMatrix = DataMatrix

This generation does not compile and gives a “The evaluation of the constant value for ‘BarcodeInfo.TypeEnum.DataMatrix’ involves a circular definition” error.

Any idea what is going on ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
wing328commented, Aug 9, 2018

Yes, he also mentioned that. Let me dig into it and hopefully file a PR shortly.

(sorry I missed your issue report earlier. busy with too many things…)

0reactions
zdarovkacommented, Jun 23, 2021

Hello all, the problem seem to be still present in all version above 5.1.1

I have just tried to generate csharp-netcore client from the onfido yml specs available here https://github.com/onfido/onfido-openapi-spec image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enumeration (or enum) in C - GeeksforGeeks
Enumeration (or enum) is a user defined data type in C. It is mainly used to assign names to integral constants, the names...
Read more >
Using enum members with enum name in C - Stack Overflow
enum is a list of values, an "enumeration". It is not a struct/container class with members. Now what you should do for clarity...
Read more >
C enum (Enumeration) - Programiz
In C programming, an enumeration type (also called enum) is a data type that consists of integral constants. To define enums, the enum...
Read more >
What is Enum Data Type in C? How to Use It? - Simplilearn
Enumeration or enum in C is a special kind of user-defined data type. Learn its syntax, and how to implement enum in the...
Read more >
"enum" members other than the first one should not be ...
C static code analysis: "enum" members other than the first one should not be explicitly initialized unless all members are explicitly initialized.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found