Skip to content

fix(parser): Prevent crash when providing a non-string default to a string attribute. Fixes #414 #415

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 1 commit into from
May 12, 2021

Conversation

dbanty
Copy link
Collaborator

@dbanty dbanty commented May 6, 2021

  1. Fixes AttributeError: 'int' object has no attribute 'replace' #414
  2. Changes __main__ to actually do what it's supposed to for debugging 😅
  3. Catches attribute errors when converting defaults to prevent similar future crashes
  4. Provides more detail in parse errors on endpoint bodies (needed while debugging)

@dbanty dbanty requested a review from emann May 6, 2021 14:43
@codecov
Copy link

codecov bot commented May 6, 2021

Codecov Report

Merging #415 (125d3e0) into main (a731477) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #415   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           47        47           
  Lines         1549      1551    +2     
=========================================
+ Hits          1549      1551    +2     
Impacted Files Coverage Δ
openapi_python_client/__main__.py 100.00% <100.00%> (ø)
openapi_python_client/parser/openapi.py 100.00% <100.00%> (ø)
...enapi_python_client/parser/properties/converter.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 a731477...125d3e0. Read the comment docs.

@dbanty dbanty added this to the Next milestone May 12, 2021
@dbanty dbanty merged commit fddf68a into main May 12, 2021
@dbanty dbanty deleted the convert-invalid-string-defaults branch May 12, 2021 14:41
p1-ra pushed a commit to P1sec/openapi-python-client that referenced this pull request May 14, 2021
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.

AttributeError: 'int' object has no attribute 'replace'
2 participants