OpenAPI.NET.CSharpAnnotations
OpenAPI.NET.CSharpAnnotations copied to clipboard
IgnoreDataMember attribute is not honored
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?