Skip to content

fix: include period as known delimiter #546

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
merged 4 commits into from
Jan 18, 2022

Conversation

alexifm
Copy link
Contributor

@alexifm alexifm commented Dec 17, 2021

An actual live example of period being a valid known delimiter is when using protoc and producing OpenApi2 with fully qualified names on. See here. The names generated from the protocol buffers will be of the form protoname.v1.MessageName.

Without this change, the processed name would be Protonamev1MessageName and the model filename would be protonamev_1_message_name.py. With the change, it's ProtonameV1MessageName and protoname_v1_message_name.py, respectively.

Tests included for utils.sanitize and utils.split_words as well as an e2e test for a model with periods in the reference name.

@alexifm alexifm force-pushed the fix/delims branch 2 times, most recently from b6142bf to 0855812 Compare December 17, 2021 17:06
@dbanty dbanty added this to the 0.11.0 milestone Dec 18, 2021
@dbanty
Copy link
Collaborator

dbanty commented Dec 18, 2021

Thanks for the contribution @alexifm, this seems like a good change but it is compatibility-breaking. For now I've added it to the next milestone which can contain breaking changes (0.11.0).

@codecov
Copy link

codecov bot commented Dec 18, 2021

Codecov Report

Merging #546 (28cb343) into main (12e8f92) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #546   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           48        48           
  Lines         1674      1674           
=========================================
  Hits          1674      1674           
Impacted Files Coverage Δ
openapi_python_client/utils.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 12e8f92...28cb343. Read the comment docs.

@alexifm
Copy link
Contributor Author

alexifm commented Dec 18, 2021

Cool, thanks @dbanty!

@dbanty dbanty added the 🥚breaking This change breaks compatibility label Jan 1, 2022
@dbanty dbanty merged commit 821dac8 into openapi-generators:main Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🥚breaking This change breaks compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants