-
Notifications
You must be signed in to change notification settings - Fork 195
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
Model casing is changed #83
Comments
At the moment it doesn't look like there is a way to override this using the main package that provides the templates, but if you copy in the three OpenAPI template files ( |
@gsimardnet Thanks for the issue! You can use the suggestion by @ssa3512 as a workaround. In the meantime, I'll have a look at the configuration that can be overrideable, which is on: Lines 10 to 21 in 7f70286
|
@justinyoo if you want to assign this to me I should be able to get a PR up later this week or weekend. |
@ssa3512 Thanks for your support! |
This is still an issue, or atleast also an issue in .NET isolated using 'Microsoft.Azure.Functions.Worker.Extensions.OpenApi'. 'UseNewtonsoftJson' uses the 'CamelCasePropertyNamesContractResolver', see: Line 37 in ab184cb
This seems like a strange choice as default, as it differs from default serializer (System.Text.Json) in a new isolated Function App. For anyone looking to disable this, you can do the following:
Is there a reason camel case is defaulted? |
Implemented and opened as PR #646. |
I defined an XML request like the following :
[OpenApiRequestBody(contentType: "text/xml", bodyType: typeof(Model.MyClass))]
Then when I look in the generated UI, the casing I have defined has changed:
<?xml version="1.0" encoding="UTF-8"?>
<myClass>
<mySubClass>
<myProperty>string</myProperty>
</mySubClass>
</myClass>
So far, the only solution I have found is to redefine the name of each property using the JsonProperty decorator.
For instance:
[JsonProperty("MyProperty")]
Also does it make sense to use that decorator when my request is 'text/xml' ?
It looks like this extension is made for JSON and XML is an afterthought.
The text was updated successfully, but these errors were encountered: