Skip to content

Commit

Permalink
Merge pull request #349 from davidebriani/use-less-strict-parsing-for…
Browse files Browse the repository at this point in the history
…-astarte-devices

Relax validation on data coming from Astarte
  • Loading branch information
bettio authored Nov 21, 2022
2 parents 01f5103 + 67b8ea9 commit 5064e75
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/astarte-client/models/Device/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,7 @@ const astarteDeviceInterfaceStatsSchema: yup.ObjectSchema<AstarteDeviceInterface
.object({
name: yup.string().required(),
major: yup.number().integer().min(0).required(),
minor: yup
.number()
.integer()
.min(0)
.required()
.when('major', {
is: 0,
then: yup.number().integer().min(1).required(),
otherwise: yup.number().integer().min(0).required(),
}),
minor: yup.number().integer().min(0).required(),
exchangedMessages: yup.number().integer().min(0).required(),
exchangedBytes: yup.number().integer().min(0).required(),
})
Expand Down

0 comments on commit 5064e75

Please sign in to comment.