Skip to content

The WithContext type is invalid #98

Description

@jasongerbes

The WithContext type accepts all Thing types:

/** Used at the top-level node to indicate the context for the JSON-LD objects used. The context provided in this type is compatible with the keys and URLs in the rest of this generated file. */
export declare type WithContext<T extends Thing> = T & {
    "@context": "https://schema.org";
};

However, Thing allows string values. For example:

export const thing: Thing = '';

It's not possible to intersect string and object, which makes the WithContext type invalid.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions