Open statler opened 6 years ago
Did you register the custom contract resolver in the generator settings?
Yes. I have ignores working perfectly, and as per the original issue, it works if I set both PropertyName and UnderlyingName
Strange that you also have to rename the UnderlyingName... any idea why? If this is the case, I should probably update the blog...
Don't know why - not that it really matters when you think about it, because renaming an item in the contract is inherently useless if you can't also include the original name in the swagger json. In the end, I have done the renaming in the client (refer https://github.com/statler/NJsonSchema)
Did you register the custom contract resolver in the generator settings?
How do you register a custom contract resolver in the generator settings?
Register it in the mvc json options
Renaming properties per the blog examples does affect the swagger document. The property is properly renamed in the CreateProperty method, but the generated swagger JSON is unchanged. Do I misunderstand how this works?
If I change both the PropertyName and UnderlyingName like this, it works. But just changing the UnderlyingName doesnt.
I was hoping the way it worked was that both the original (UnderlyingName) and PropertyName were stored in the JSON. In this case, the swagger doc should show the underlyingname (because there is no point accessing the wrong name for the interface), and the new name (propertyname) could be stored in the JSON so that the client generators could create new models based which expose the renamed property, but create JSON that works with the API