Skip to content

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

@ealtunyay

Description

@ealtunyay

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions