Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displayed model schema should match the EDM Model #59

Closed
bigred8982 opened this issue Jan 26, 2016 · 5 comments
Closed

Displayed model schema should match the EDM Model #59

bigred8982 opened this issue Jan 26, 2016 · 5 comments
Labels

Comments

@bigred8982
Copy link
Contributor

When using automatic property name conversion via the EnableLowerCamelCase() method on the ODataConventionModelBuilder, the models displayed in the Swagger UI do not match the models in the payload.

For example, the C# model will have a property called 'Id' The service is returning the property as 'id' in the payload. The Model and Model Schema sections are displaying the C# property name in Pascal case.

I have prepared an example to illustrate the issue. Please refer to Swashbuckle.OData.Sample project in the branch below:

https://github.com/bigred8982/Swashbuckle.OData/tree/property_casing_sample

@rbeauchamp rbeauchamp added the bug label Jan 26, 2016
@rbeauchamp
Copy link
Owner

Thanks Harrison, I'll checkout your sample.

@ghost ghost closed this as completed in 3d277c7 Jan 27, 2016
@ghost
Copy link

ghost commented Jan 27, 2016

@bigred8982 Fix is available in v2.12.1. Give it a shot and let me know if you find any issues. Thanks!

@bigred8982
Copy link
Contributor Author

The casing has definitely been taken care of.

I discovered a related issue. The model may still not match what is in the EDM is you customize the EDM model with ignored properties. I haven't had the chance to investigate the origin of this specific issue myself, but I did update a sample project to demonstrate it.

https://github.com/bigred8982/Swashbuckle.OData/tree/property_casing_sample.

The Customers model has been updated with sample "private" properties. They are still public properties in the C# model, but the EDM model was configured to ignore them. The config is specified in the ODataConfig.cs file.

Thanks for all the hard work!

@ghost ghost changed the title Displayed model schema casing does not always match payload Displayed model schema should match the EDM Model Jan 28, 2016
@ghost ghost reopened this Jan 28, 2016
@ghost ghost closed this as completed in d37bfb0 Jan 28, 2016
@ghost
Copy link

ghost commented Jan 28, 2016

Hey @bigred8982, you bet! Ignored properties issue is fixed in v2.12.3. Thanks for the heads up!

@bigred8982
Copy link
Contributor Author

You're the best! Thanks!!
On Wed, Jan 27, 2016 at 11:54 PM Richard Beauchamp notifications@github.com
wrote:

Hey @bigred8982 https://github.com/bigred8982, you bet! Ignored
properties issue is fixed in v2.12.3. Thanks for the heads up!


Reply to this email directly or view it on GitHub
#59 (comment)
.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants