Project

General

Profile

Feature #35710

Handle nulls properly as arguments in the API

Added by William Grzybowski over 1 year ago. Updated 7 months ago.

Status:
Done
Priority:
No priority
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Estimated time:
Severity:
Med High
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:

Description

The API currently accepts null for almost every argument type.
We should handle that properly, making null being allowed or not explicitly.

Risk
The risk is this change is that new UI will break for API calls that is sending "null" values for methods it wont be allowed anymore. New UI will have to change the calls to not include said attributes or use correct argument type.

Acceptance criteria
When this is done calls to middleware websocket/REST 2.0 methods will no longer accept "null" values for methods that should be requiring a specific type (e.g. bool or dict)

Associated revisions

Revision fc8f6714 (diff)
Added by William Grzybowski over 1 year ago

feat(middlewared): disable null/None values by default in schemas Allowing null/None will now require null=True in schemas. Ticket: #35710

Revision ad803bf8 (diff)
Added by William Grzybowski over 1 year ago

feat(middlewared): catch up schema changes on a few services Ticket: #35710

Revision 6e8043db (diff)
Added by William Grzybowski over 1 year ago

feat(middlewaerd/pytest): add schema unit tests Ticket: #35710

Revision a81a54c4 (diff)
Added by William Grzybowski over 1 year ago

feat(middlewared): catch up schema changes on a few services Ticket: #35710

Revision 1dd72e29 (diff)
Added by William Grzybowski over 1 year ago

feat(middlewaerd/pytest): add schema unit tests Ticket: #35710

Revision b79d74d2 (diff)
Added by William Grzybowski over 1 year ago

feat(middlewaerd/pytest): add schema unit tests Ticket: #35710

Revision add54633 (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/schema): use deepcopy and check value on validate Ticket: #35710

Revision b38b6173 (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/schema): float validation Ticket: #35710

Revision 2dc4835f (diff)
Added by William Grzybowski over 1 year ago

feat(middlewared): disable null/None values by default in schemas Allowing null/None will now require null=True in schemas. Ticket: #35710

Revision 53f399c6 (diff)
Added by William Grzybowski over 1 year ago

feat(middlewared): catch up schema changes on a few services Ticket: #35710

Revision 5c1945b6 (diff)
Added by William Grzybowski over 1 year ago

feat(middlewaerd/pytest): add schema unit tests Ticket: #35710

Revision e3094fa5 (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/schema): use deepcopy and check value on validate Ticket: #35710

Revision ae1c7a92 (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/schema): float validation Ticket: #35710

Revision a474f7be (diff)
Added by William Grzybowski over 1 year ago

feat(middlewared/schema): List should not have a default Having a default is confusing and may break usage when using within a Dict, making it so we cant know if a value has been provided by the user or not. Ticket: #35710

Revision 9a0c23ad (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/schema): missing default for List Ticket: #35710

Revision e14935db (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/schema): missing default for List Ticket: #35710

Revision 565a7f57 (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/account): use default in List instead Ticket: #35710

Revision ab33598a (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/account): use default in List instead Ticket: #35710

Revision 1679c873 (diff)
Added by William Grzybowski over 1 year ago

feat(middlewared/schema): List should not have a default Having a default is confusing and may break usage when using within a Dict, making it so we cant know if a value has been provided by the user or not. Ticket: #35710

Revision 6440ae88 (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/schema): missing default for List Ticket: #35710

Revision 13c26ff8 (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/account): use default in List instead Ticket: #35710

Revision 801aaa01 (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared/auth): schema for auth.generate_token Ticket: #35710

History

#1 Updated by William Grzybowski over 1 year ago

  • Description updated (diff)
  • Status changed from Unscreened to Screened

#2 Updated by William Grzybowski over 1 year ago

  • Tracker changed from Bug to Feature
  • Seen in deleted (11.2-BETA1)
  • ChangeLog Required deleted (No)

#3 Updated by William Grzybowski over 1 year ago

  • Status changed from Screened to In Progress

#4 Updated by William Grzybowski over 1 year ago

#5 Updated by William Grzybowski over 1 year ago

  • Status changed from In Progress to Passed Testing
  • Needs QA changed from Yes to No

This cant really be QA'ed. Automation test will do it.

#6 Updated by William Grzybowski over 1 year ago

#7 Updated by William Grzybowski over 1 year ago

Additional commit 801aaa01ab136053150a0efca1da639d871e72d7

#8 Updated by Dru Lavigne 12 months ago

  • Status changed from Passed Testing to Done

#9 Updated by Dru Lavigne 10 months ago

  • Target version changed from 11.3 to 11.3-BETA1

#10 Updated by Dru Lavigne 7 months ago

  • Target version changed from 11.3-BETA1 to 11.3-ALPHA1

Also available in: Atom PDF