Skip to content

Commit

Permalink
Use camel-case as default property naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
monstermichl committed Oct 31, 2024
1 parent de7278e commit 9072df2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/ninja_bear/base/generator_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@ def dump(self) -> str:
# Remove hidden properties.
properties_copy = [property for property in properties_copy if not property.hidden]

# If not naming conventation has been provided, use camel-case as default.
if not self._naming_conventions.properties_naming_convention:
self._naming_conventions.properties_naming_convention = NamingConventionType.CAMEL_CASE

# Update property names according to naming convention.
if self._naming_conventions.properties_naming_convention:
for property in properties_copy:
property.name = NameConverter.convert(
property.name,
self._naming_conventions.properties_naming_convention
)
for property in properties_copy:
property.name = NameConverter.convert(
property.name,
self._naming_conventions.properties_naming_convention
)

s = self._dump(DumpInfo(
self._type_name,
Expand Down

0 comments on commit 9072df2

Please sign in to comment.