Making required properties on Device Schema nullable. #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR makes the required
Device
properties,category
,make
,model
, andserial
, null-able properties.Rationale
In
graph-rumble
, there arerumble_asset
entities. These assets are all networked devices such as servers, desktops, phones, etc. These entities would be best classified asDevices
. However, the response from Rumble API does not contain enough information to fill the required properties. Information about thecategory
,make
, andmodel
are sometimes available, butserial
could never be populated with the data from the response.If a
rumble_asset
cannot use theDevice
schema, then the entity would be misclassified. By making required properties optionally null-able, the data model can encourage using common properties when available while retaining the flexibility to classify entities correctly when not all information is available.There are other ways of achieving the same goal, so any ideas or feedback is appreciated!
Related Issues
Previous discussion on allowing all properties to be
null
during graph validation: #13Possibility of using data-model to generate types for typescript or any other typed language: #12
References
graph-rumble repo
rumble_asset pull request
example Rumble asset response