Code Monkey home page Code Monkey logo

jsonld-lint's People

Contributors

barendb avatar dependabot[bot] avatar diogo-sousa-mattr avatar jhill-mattr avatar marcus-mattr avatar pablodenadai avatar shinitiandrei avatar shnydercom avatar thomas-pearson-mattr avatar tplooker avatar wayne-shih avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsonld-lint's Issues

Linter shows incorrect warning for typed literal values

Linter shows:

  • Usage of JSON-LD syntax token "type" in the JSON-LD object type of "GraphObject" is invalid, or
  • Usage of JSON-LD syntax token "@value" in the JSON-LD object type of "NodeObject" is invalid

in cases where the JSON-LD contains a typed datatype value, e.g.:

{
    "@context": {
        "ex": "http://example.com/"
    },
    "@id": "ex:test123",
    "ex:myAttribute": {
        "@value": "123",
        "@type": "ex:myDataType"
    }
}

But this is perfectly valid, as it is the mechanism for assigning a datatype to a literal. See https://www.w3.org/TR/json-ld11/#typed-values

Problem with linting for document with undefined term

The following DID Document has undefined terms but passes linting:

Steps to reproduce: https://runkit.com/embed/8xg4vm8d3lj4

var jsonldLint = require("jsonld-lint")
await jsonldLint.lint('{"@context":["https://www.w3.org/ns/did/v1"],"id":"did:xxx:123","verificationMethod":[{"id":"did:xxx:123#key-1","controller":"did:xxx:123","type":"ED25519","publicKeyHex":"b0..."}],"authentication":["did:xxx:123#key-1"],"service":[{"type":"DIDDecrypt","id":"did:xxx:123#resolver","serviceEndpoint":"https://example.com","serverType":0,"protocol":2}],"alsoKnownAs":[{"id":"did:xxx:123","type":101}],"extension":{"attributes":[{"encrypt":1,"format":"text","value":"BID文档","key":"name","desc":"名称"}],"delegateSign":{"signatureValue":"03...","signer":"did:xxx:123#key-1"},"recovery":["did:xxx:123#key-2"],"ttl":86400,"type":102,"verifiableCredentials":[{"id":"did:xxx:123","type":"201"}]},"version":"1.0.0"}')

returns no errors

Using JSON-LD Playground errors are identified: link

expected behaviour: jsonld-lint should also report errors

Prevent console output from jsonld.js

Currently jsonld.js reports some warnings during processing such as the following

WARNING: terms beginning with "@" are reserved for future use and ignored { term: '@notAValidProperty' }

We need to prevent output like this when running the CLI

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.