dashevo / js-dash-sdk

DEPRECATED Dash client-side library for wallet payment/signing and application development. (Wallet, DAPI, Primitives, BLS, ...)
https://dashevo.github.io/platform/SDK/
MIT License
36 stars 21 forks source link

doc: [StateTransitionBroadcastError: strict mode: missing type "object" for keyword "required" #300

Closed dashameter closed 2 years ago

dashameter commented 2 years ago

This example throws an error:

https://dashplatform.readme.io/docs/reference-data-contracts#document-properties

const contractDocuments = {
  message: {
    properties: {
      body: {
        type: "object",
        properties: {
          objectProperty: {
            type: "string"
          },
        },
        additionalProperties: false,
      },
      header: {
        type: "string"
      }
    },
    additionalProperties: false
  }
};

[StateTransitionBroadcastError: strict mode: missing type "object" for keyword "required" at "1118mFsAYpA3Pefu5eaNwuo19Ch3LXRh6w3xwuhF5Lp#/documents/message" (strictTypes)]

It should be:

const contractDocuments = {
  message: {
    type: "object",
    properties: {
      body: {
        type: "object",
        properties: {
          objectProperty: {
            type: "string"
          },
        },
        additionalProperties: false,
      },
      header: {
        type: "string"
      }
    },
    additionalProperties: false
  }
};

Fix supplied via commit @ https://dashplatform.readme.io/ waiting for merge.

SamKirby22 commented 2 years ago

Added to triage sheet for tracking.

thephez commented 2 years ago

Fix merged on Readme :+1: