Skip to content

How to work around id and type field names? #206

@jacobq

Description

@jacobq

I have some Mongoose models/Schema that include id and/or type keys. If I pass these models to JSON_API.dbAdapters.Mongoose(...) and then use that to set up JSON_API.ResourceTypeRegistry it runs fine until a request comes in. Then, if I have debug logging enabled, I can see json-api:warn Errors converted to json-api Result Error: typeandid cannot be used as field names. How can I handle this situation? Perhaps there's a way I can tell json-api that these fields should be remapped/renamed somehow (e.g. type -> typeField)?

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