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

Unable to specify custom IPropertyNameResolver in SchemaGenerationSettings

Open mskowron-orthofi opened this issue 4 years ago • 1 comments

I have a use case where my Json property names need to be formatted as lower-case, and I would prefer to not use the Newtonsoft JsonProperty attribute on every property to accomplish this. I figured using a custom IPropertyNameResolver would do the trick, but found that CamelCasePropertyNameResolver is the only non-default IPropertyNameResolver that works, due to this section of code: https://github.com/microsoft/OpenAPI.NET.CSharpAnnotations/blob/master/src/Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration/AssemblyLoader/AssemblyLoader.cs#L180

Open Api generation should allow for any class that implements IPropertyNameResolver to be accepted and used.

mskowron-orthofi avatar Sep 10 '20 20:09 mskowron-orthofi

I too am having the exact same issue, and found the same line of code mentioned above preventing using a custom IPropertyNameResolver.

WesTunn avatar May 04 '21 01:05 WesTunn