Skip to content

Better naming of sub-model classes #250

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

Merged

Conversation

packyg
Copy link
Contributor

@packyg packyg commented Nov 23, 2020

The new naming feature for classes with parent elements in 0.7.0 solves a problem for us, but the capitalization is not ideal.

Currently, if the parent is "parent" and the child is "child" it will generate classes like:

class Parentchild:
  # ...

After this change, it will be

class ParentChild:
  # ...

Which has better capitalization. This improves naming consistency when the model/enum is in-lined under a lower-case property and proper caps can't be enforced in the specs.


Also updated is list item property naming.

Before, it was doubling the child name when naming the items of a child list property of a parent class as:

class ParentChildchildItem:
  # ...

Now it just does

class ParentChildItem:
  # ...

@packyg
Copy link
Contributor Author

packyg commented Nov 23, 2020

CC @dbanty

@codecov
Copy link

codecov bot commented Nov 23, 2020

Codecov Report

Merging #250 (d173a6b) into main (fb4787e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #250   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           46        46           
  Lines         1302      1302           
=========================================
  Hits          1302      1302           
Impacted Files Coverage Δ
...penapi_python_client/parser/properties/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb4787e...d173a6b. Read the comment docs.

@packyg packyg changed the title Better naming of sub-models Better naming of sub-model classes Nov 23, 2020
Copy link
Collaborator

@dbanty dbanty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@dbanty dbanty added this to the 0.7.0 milestone Nov 24, 2020
@dbanty dbanty merged commit 802557a into openapi-generators:main Nov 24, 2020
@packyg packyg deleted the fix-subresource-capitalization branch November 24, 2020 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants