Skip to content

Raw value type strict validation #123

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
Mar 22, 2019
Merged

Conversation

p1c2u
Copy link
Collaborator

@p1c2u p1c2u commented Mar 22, 2019

Strict validation of raw value type.
Enabled for media type only. Parameters are disabled for now (backward compatibility). Parameters type strict validation should be enabled by default in version 1.0.

Fixes #105

@p1c2u p1c2u force-pushed the fix/raw-value-type-strict-validation branch from 11510f0 to bf330ee Compare March 22, 2019 02:23
@codecov
Copy link

codecov bot commented Mar 22, 2019

Codecov Report

Merging #123 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #123      +/-   ##
=========================================
+ Coverage   96.19%   96.2%   +0.01%     
=========================================
  Files          54      54              
  Lines        1444    1450       +6     
=========================================
+ Hits         1389    1395       +6     
  Misses         55      55
Impacted Files Coverage Δ
openapi_core/schema/schemas/models.py 95.59% <100%> (+1.36%) ⬆️
openapi_core/schema/parameters/models.py 96.82% <100%> (ø) ⬆️
openapi_core/compat.py 55.55% <0%> (-44.45%) ⬇️

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 395f68b...bf330ee. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 22, 2019

Codecov Report

Merging #123 into master will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #123      +/-   ##
=========================================
+ Coverage   96.19%   96.3%   +0.11%     
=========================================
  Files          54      54              
  Lines        1444    1460      +16     
=========================================
+ Hits         1389    1406      +17     
+ Misses         55      54       -1
Impacted Files Coverage Δ
openapi_core/schema/schemas/models.py 95.12% <100%> (+0.89%) ⬆️
openapi_core/schema/parameters/models.py 96.82% <100%> (ø) ⬆️
openapi_core/schema/schemas/util.py 93.75% <0%> (-6.25%) ⬇️

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 395f68b...cd0ca5d. Read the comment docs.

@p1c2u p1c2u force-pushed the fix/raw-value-type-strict-validation branch from bf330ee to 9d1de1d Compare March 22, 2019 10:08
@p1c2u p1c2u force-pushed the fix/raw-value-type-strict-validation branch from 9d1de1d to cd0ca5d Compare March 22, 2019 11:21
@p1c2u p1c2u merged commit 964302d into master Mar 22, 2019
@p1c2u p1c2u deleted the fix/raw-value-type-strict-validation branch March 22, 2019 11:35
return int(value)

def _unmarshal_number(self, value, custom_formatters=None, strict=True):
if strict and not isinstance(value, (float, )):

Choose a reason for hiding this comment

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

I have a case where I return a number with a value of 3
3 contrary to 3.0 is not recognized as a float.

bjmc pushed a commit to bjmc/openapi-core that referenced this pull request Jun 12, 2019
…trict-validation

Raw value type strict validation
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