mike-north / jsonapi-typescript

TypeScript type information for JSON:API documents
52 stars 5 forks source link

ErrorObject's "links" member does not allow "about" link #134

Open ealtunyay opened 4 years ago

ealtunyay commented 4 years ago

Describe the bug

import * as JSONAPI from "jsonapi-typescript";

// ⛔️ Error: Object literal may only specify known properties, and 'about' does not
// exist in type 'Links'.ts(2322)
let doc: JSONAPI.Document = {
  errors: [
    {
      links: {
        about: "http://www.example.com/about"
      }
    }
  ]
};

ErrorObject.links is specified to be a Links type which does not allow an about member. The "Error Objects" section of the spec allows "about" to be a member of "links"

To Reproduce Steps to reproduce the behavior:

  1. Paste above code into an editor that gives typescript errors

Expected behavior No error

Additional context For now, I'm using Record<string, JSONAPI.Link> type for the links member