Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Wrong identity object in schema in getting started guide of schema-record #9985

Copy link
Copy link
Open
@Jopie01

Description

@Jopie01
Issue body actions

I upgraded my packages from 5.4.0-alpha.120 to 5.6.0-alpha.2 and walked into a problem with the schema-record package. I got the error Expected a resource schema and didn't know where it came from. So I digged into the code and found the change at https://github.com/emberjs/data/blob/245ba3cde61cb0690ba7f13739c3b03e5af2e193/packages/schema-record/src/-private/hooks.ts#L17C11-L17C37. As it seems there is now a test to check if the identifier is really a schema.

Looking at

export function isResourceSchema(schema: ResourceSchema | ObjectSchema): schema is ResourceSchema {
where the check is defined, I saw that it looks for a key called kind in the identity object. So I added that data and everything worked again.

However, looking into the getting started guide

identity: { type: '@id', name: 'id' },
I see that there is not a kind key but a type. Shouldn't be that kind as well? Otherwise you will get the same error as I had.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    needs triage
    Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.