OpenAPI.NET.CSharpAnnotations icon indicating copy to clipboard operation
OpenAPI.NET.CSharpAnnotations copied to clipboard

IgnoreDataMember attribute is not honored

Open alexeygrantmyob opened this issue 5 years ago • 0 comments

The contract XXXX I am using for my API has two similar properties - "IntProperty" and "StringProperty". IntProperty has IgnoreDataMemberAttribute does not have DataMember attribute. StringProperty has an attribute DataMember(Name = "IntProperty"). When trying to generate the OpenAPI documentation from that contract I get the following error:

Adding schema "XXXX" to the schema reference registry failed with the error: Adding schema "XXXX" to the schema reference registry failed with the error: Adding schema "XXXX" to the schema reference registry failed with the error: Adding schema "XXXX" to the schema reference registry failed with the error: A property with the name "IntProperty" already exists on "XXXX".

So it looks like that the parser ignores IgnoreDataMemberAttribute, and tries to add IntProperty (one from IntProperty and another one from StringProperty) twice and fails there.

Is it an expected behavior, and if yes, what's the workaround?

alexeygrantmyob avatar Oct 03 '19 03:10 alexeygrantmyob