@@ -270,16 +270,35 @@ There are four options:
270270
271271### Property naming {#schema-schemagen-property-names}
272272
273- In addition to the `[JsonPropertyName ]` attribute , the configuration exposes a ` PropertyNamingMethod ` that allows you to define a custom method for altering property names from your code into the schema . The ` PropertyNamingMethods ` static class defines a few commonly - used conventions :
273+ In addition to the `[JsonPropertyName ]` attribute , ` SchemaGeneratorConfiguration . PropertyNameResolver ` allows you to define a custom method for altering property names from your code into the schema . The system will adjust property names accordingly .
274274
275- - `camelCase `
276- - `PascalCase `
277- - `kebab - case `
278- - `UPPER - KEBAB - CASE `
279- - `snake_case `
280- - `UPPER_SNAKE_CASE `
275+ ```C #
276+ SchemaGeneratorConfiguration config = new ()
277+ {
278+ // All property names will be lowercase!
279+ PropertyNameResolver = x => x .Name .ToLower ()
280+ };
281+ ```
282+
283+ For your convenience , the `PropertyNameResolvers ` static class defines a few commonly - used conventions :
284+
285+ | ResolvedName | Example |
286+ | ---------------------------------------- | -------------------- - |
287+ | PropertyNameResolvers .CamelCase | `camelCase ` |
288+ | PropertyNameResolvers .PascalCase | `PascalCase ` |
289+ | PropertyNameResolvers .KebabCase | `kebab - case ` |
290+ | PropertyNameResolvers .UpperKebabCase | `UPPER - KEBAB - CASE ` |
291+ | PropertyNameResolvers .SnakeCase | `snake_case ` |
292+ | PropertyNameResolvers .UpperSnakeCase | `UPPER_SNAKE_CASE ` |
281293
282- Just set this property and the system will adjust property names accordingly .
294+ They can be applied directly to the configuration property :
295+
296+ ```c #
297+ SchemaGeneratorConfiguration config = new ()
298+ {
299+ PropertyNameResolver = PropertyNameResolvers .CamelCase
300+ };
301+ ```
283302
284303Note that the `[JsonPropertyName ]` attribute takes precedence , so you can still use this to get custom naming when you 've configured a method.
285304
0 commit comments