Skip to content

Make json, cbor, xml, html enforce data types #1006

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 7, 2024
Merged

Make json, cbor, xml, html enforce data types #1006

merged 4 commits into from
Jan 7, 2024

Conversation

jmthomas
Copy link
Member

closes #990

@jmthomas jmthomas requested a review from ryanmelt December 28, 2023 20:21
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (dd13990) 75.42% compared to head (b7d3581) 75.42%.
Report is 9 commits behind head on main.

Files Patch % Lines
openc3/python/openc3/accessors/accessor.py 91.66% 2 Missing ⚠️
openc3/lib/openc3/accessors/accessor.rb 94.44% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1006   +/-   ##
=======================================
  Coverage   75.42%   75.42%           
=======================================
  Files         589      589           
  Lines       42801    42832   +31     
  Branches      746      747    +1     
=======================================
+ Hits        32283    32308   +25     
- Misses      10440    10446    +6     
  Partials       78       78           
Flag Coverage Δ
frontend 54.82% <ø> (-0.15%) ⬇️
python 84.09% <92.30%> (+0.02%) ⬆️
ruby-api 48.69% <ø> (+0.07%) ⬆️
ruby-backend 80.52% <95.23%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

when :UINT, :INT
if item.array_size
value = JSON.parse(value) if value.is_a? String
value = value.map(&:to_i)
Copy link
Member

Choose a reason for hiding this comment

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

to_i and to_f do not handle as many cases as Integer() and Float(). ie hex

Copy link

sonarqubecloud bot commented Jan 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

23.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@jmthomas jmthomas merged commit 78a534d into main Jan 7, 2024
@jmthomas jmthomas deleted the json_types branch January 7, 2024 19:13
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.

Data of type "FLOAT" is auto-converted to "INT" if there are no non-zero decimals
2 participants