Skip to content

fix: Treat leading underscore as a sign of invalid identifier #703

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 6, 2023

Conversation

maxkomarychev
Copy link
Contributor

There are 2 reasons for this change:

  • leading underscores have special meaning and therefore we should prefix those properties to avoid unexpected semantics
  • in my particular use case my team is working with a schema which has the following fields in an object: "field" and "_field" and current code strips leading underscore and produces invalid data object with 2 fields of the same name

@maxkomarychev maxkomarychev force-pushed the max/underscore branch 2 times, most recently from f245dfb to b26be85 Compare November 17, 2022 21:12
@maxkomarychev maxkomarychev changed the title Treat leading underscore as a sign of invalid identifier fix: Treat leading underscore as a sign of invalid identifier Nov 17, 2022
@ALexALed
Copy link

👍

@dbanty dbanty added ✨ enhancement New feature or improvement 🥚breaking This change breaks compatibility labels Nov 25, 2022
There are 2 reasons for this change:

- leading underscores have special meaning and therefore we should prefix
those properties to avoid unexpected semantics
- in my particular use case my team is working with a schema which has
the following fields in an object: "field" and "_field" and current code
strips leading underscore and produces invalid data object with 2 fields
of the same name
@maxkomarychev
Copy link
Contributor Author

I've fixed linter problems, could you please approve workflows again? Thanks!

@codecov
Copy link

codecov bot commented Nov 25, 2022

Codecov Report

Merging #703 (da22888) into main (b4142b2) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #703   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           49        49           
  Lines         1969      1969           
=========================================
  Hits          1969      1969           
Impacted Files Coverage Δ
openapi_python_client/utils.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@maxkomarychev
Copy link
Contributor Author

Hi, when can this be accepted? Are there any outstanding issues with this contribution? Looking forward for the feedback!

@dbanty
Copy link
Collaborator

dbanty commented Jan 6, 2023

I think I was just waiting to merge some other fixes before releasing a new breaking version... but honestly, I don't remember anymore 😅.

@dbanty
Copy link
Collaborator

dbanty commented Jan 6, 2023

FYI @jselig-rigetti I think this is relevant to you 😁

@dbanty dbanty merged commit f95dbe4 into openapi-generators:main Jan 6, 2023
dbanty added a commit that referenced this pull request Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🥚breaking This change breaks compatibility ✨ enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants