Coder Social home page Coder Social logo

Comments (6)

MLopezJ avatar MLopezJ commented on May 28, 2024

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.

MLopezJ avatar MLopezJ commented on May 28, 2024

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.

MLopezJ avatar MLopezJ commented on May 28, 2024

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.

MLopezJ avatar MLopezJ commented on May 28, 2024

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.

MLopezJ avatar MLopezJ commented on May 28, 2024

Done: NordicSemiconductor/lwm2m-types-js#32

from asset-tracker-cloud-coiote-aws-converter-js.

github-actions avatar github-actions commented on May 28, 2024

🎉 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.