Azure / Azure/azure-functions-openapi-extension

Model casing is changed

Open
#83 6 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
388
Forks
202
PR merge metrics
No merged PRs in 30d

Description

I defined an XML request like the following :
` [OpenApiRequestBody(contentType: "text/xml", bodyType: typeof(Model.MyClass))]`

public class MyClass
{
public MySubClass MySubClass { get; set; }
}

public class MySubClass
{
public string MyProperty { get; set; }
}

Then when I look in the generated UI, the casing I have defined has changed:
``
``
` `
` string`
` `
``

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.