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

Required section property casing #227

Open
MrWolfPST opened this issue Sep 3, 2021 · 4 comments
Open

Required section property casing #227

MrWolfPST opened this issue Sep 3, 2021 · 4 comments
Labels
oca-issue For participants from OSS Contribution Academy

Comments

@MrWolfPST
Copy link

I have some properties decorated with JsonRequired attribute and JsonProperty attribute with custom property name specified.
In the properties section of swagger.json, property name respect casing of property name value of JSonProperty attribute, but in the required section the name is with first letter lower cased.

@choipureum
Copy link
Contributor

I think it's related to #83

@github-actions github-actions bot added the oca-issue For participants from OSS Contribution Academy label Sep 6, 2021
@MrWolfPST
Copy link
Author

MrWolfPST commented Sep 6, 2021

Yes, it can be related. My problem is on required section only, but I use JsonProperty with custom property name, that is the workaround suggested in the issue #83.

@justinyoo
Copy link
Contributor

As a default, camelCasing is applied to all unless it's specified through JsonProperty(...). It's because of this line:

public virtual NamingStrategy NamingStrategy { get; } = new CamelCaseNamingStrategy();

and here:

public virtual NamingStrategy NamingStrategy { get; } = new CamelCaseNamingStrategy();

Let me take a look how I can configure the default behaviour.

@MrWolfPST
Copy link
Author

As workaroud I added Required = Required.Always on JsonPropertyAttributes that have PropertyName specified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oca-issue For participants from OSS Contribution Academy
Projects
None yet
Development

No branches or pull requests

3 participants