Skip to content

Allows for alternate foreign key attribute names, eg snake case (post_id). Defaults to 'Id'#556

Merged
typicode merged 1 commit into
typicode:masterfrom
bbruneau:master
Jun 27, 2017
Merged

Allows for alternate foreign key attribute names, eg snake case (post_id). Defaults to 'Id'#556
typicode merged 1 commit into
typicode:masterfrom
bbruneau:master

Conversation

@bbruneau
Copy link
Copy Markdown
Contributor

I've been using json-server to mock responses from a Rails API. Rails idiomatically uses snake_case for foreign keys-- postId would instead be post_id. This allows users to set a foreign key suffix option. The default remains Id.

@typicode
Copy link
Copy Markdown
Owner

Thank you 👍 looks great

@typicode typicode merged commit f1d7677 into typicode:master Jun 27, 2017
EsrefDurna pushed a commit to EsrefDurna/json-server that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants