Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom id generation #69

Merged
merged 9 commits into from
Jun 4, 2024
Merged

Add support for custom id generation #69

merged 9 commits into from
Jun 4, 2024

Conversation

djhi
Copy link
Contributor

@djhi djhi commented May 3, 2024

Follow #68

  • Support string identifiers
  • Support custom identifier generation

@djhi djhi added the RFR Ready For Review label May 3, 2024
@djhi djhi added this to the 4.0.0 milestone May 3, 2024
@djhi djhi added WIP Work In Progress RFR Ready For Review and removed RFR Ready For Review WIP Work In Progress labels May 3, 2024
Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rebase now that I've merged the other PR?

README.md Outdated
import FakeRest from 'fakerest';
import uuid from 'uuid';

const restServer = new FakeRest.Server('http://my.custom.domain', () => uuid.v5());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're in for a breaking change, we can afford changing the signature to a params object. Same for Fakerest.Server.

Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nitpicks

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@slax57 slax57 added WIP Work In Progress and removed RFR Ready For Review labels May 29, 2024
@slax57 slax57 force-pushed the support-string-ids branch from aed08b2 to f5e2506 Compare May 29, 2024 16:23
Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @fzaninotto

However I noticed a bug with some operations (such as DELETE) with the MSW implementation, which I'll need to fix before the release.

Hence this PR is still WIP.

@djhi djhi added RFR Ready For Review and removed WIP Work In Progress labels Jun 3, 2024
@djhi djhi mentioned this pull request Jun 3, 2024
2 tasks
@djhi djhi requested review from slax57 and fzaninotto June 3, 2024 09:17
UPGRADE.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -205,7 +224,7 @@ export class BaseServer {

// handle collections
const matches = request.url?.match(
new RegExp(`^${this.baseUrl}\\/([^\\/?]+)(\\/(\\d+))?(\\?.*)?$`),
new RegExp(`^${this.baseUrl}\\/([^\\/?]+)(\\/(\\w))?(\\?.*)?$`),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this may break things

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't noticed any and I don't see any other way to support custom ids

Co-authored-by: Francois Zaninotto <[email protected]>
@djhi djhi merged commit f09da18 into master Jun 4, 2024
3 checks passed
@djhi djhi deleted the support-string-ids branch June 4, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants