Comments (6)
Observation
XML definition said both element should be boolean
type but error message says properties/6/type","keyword":"type","params":{"type":"integer"},"message":"must be integer"
from asset-tracker-cloud-coiote-aws-converter-js.
This is the json schema generated by LwM2M types lib
"1:[email protected]": {
"type": "array",
"minItems": 1,
"title": "LwM2M Server",
"description": "This LwM2M Objects provides the data related to a LwM2M Server. A Bootstrap-Server has no such an Object Instance associated to it. LWM2MVersion: 1.2 ObjectVersion: 1.2 MultipleInstances: true Mandatory: true",
"items": {
"type": "object",
"$id": "https://github.com/OpenMobileAlliance/lwm2m-registry/raw/prod/1.xml",
"title": "LwM2M Server",
"description": "This LwM2M Objects provides the data related to a LwM2M Server. A Bootstrap-Server has no such an Object Instance associated to it. LWM2MVersion: 1.2 ObjectVersion: 1.2 MultipleInstances: true Mandatory: true",
"additionalProperties": false,
"properties": {
"6": {
"type": "integer",
"minimum": 0,
"maximum": 1,
"title": "Notification Storing When Disabled or Offline",
"description": "If true, the LwM2M Client stores \"Notify\" operations to the LwM2M Server while the LwM2M Server account is disabled or the LwM2M Client is offline. After the LwM2M Server account is enabled or the LwM2M Client is online, the LwM2M Client reports the stored \"Notify\" operations to the Server.\r\nIf false, the LwM2M Client discards all the \"Notify\" operations or temporarily disables the Observe function while the LwM2M Server is disabled or the LwM2M Client is offline.\r\nThe default value is true.\r\nThe maximum number of storing Notifications per Server is up to the implementation."
},
"23": {
"type": "integer",
"minimum": 0,
"maximum": 1,
"title": "Mute Send",
"description": "If true or the Resource is not present, the LwM2M Client Send command capability is de-activated. \r\nIf false, the LwM2M Client Send Command capability is activated."
},
},
"required": ["0", "1", "6", "7"]
}
}
Both values are defined as integer
.
Why those are defined as integer
in Json Schema if XML definition says those are boolean
?
from asset-tracker-cloud-coiote-aws-converter-js.
In the LwM2M types definition, both values are defined as boolean
type NotificationStoringWhenDisabledorOffline_6 = boolean
type MuteSend_23 = boolean
from asset-tracker-cloud-coiote-aws-converter-js.
In lwM2MDefinitionToJSONSchema method from LwM2M types, booleans are transformed to integers
case LwM2MType.Boolean:
// In LwM2M Boolean is an 8 bit unsigned integer with the value 0 for False and the value 1 for True.
prop = S.integer().minimum(0).maximum(1)
break
This is why the Json Schema expect an integer
but the xml definition says boolean
.
So, there is string
that is defined as boolean
but expect to be integer
from asset-tracker-cloud-coiote-aws-converter-js.
- Update lwM2MDefinitionToJSONSchema to add link reference of LwM2M Boolean definition
Done: NordicSemiconductor/lwm2m-types-js#32
from asset-tracker-cloud-coiote-aws-converter-js.
🎉 This issue has been resolved in version 1.0.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
from asset-tracker-cloud-coiote-aws-converter-js.
Related Issues (14)
- Dependency Dashboard
- Test HOT 2
- Conflic with HOT 1
- What should happen when a resource with repeated name is trying to be converted to LwM2M format HOT 2
- Error when converting prop as `date` type with value `1970-01-01T00:00:00Z` HOT 3
- Unknown resource name: Location Assistance HOT 1
- Convert shadow
- Two methods with same name HOT 1
- Coiote's shadow composition
- Using `names` as key to transform coiote json is not recommended HOT 1
- Migrate tests to Node.js test runner
- convert(): remove invalid object definitions instead of rejecting the entire document.
- Set up release to NPM
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asset-tracker-cloud-coiote-aws-converter-js.