Skip to content

RC2: Include resource type name in resource #59

Description

@csantero

https://github.com/dgeb/json-api/blob/v1rc2/format/index.md#resource-objects-

A resource object MUST contain at least the following top-level members:

"id"
"type"

I hate the naming for this - my project has a bunch of models that have a property called Type. But I haven't seen anyone complain about it, so I guess I'm the one who has to change.

We do have to handle the possibility that someone's model has a property that would serialize as type, though. Either we can throw an exception, or we can transform the name somehow (like prepending an underscore).

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions