MockServer JSONAPI version#494
Open
jackiekircher wants to merge 4 commits into
Open
Conversation
this version is configurable when creating the mock server via the
`jsonapiVersion` option. It will only be included in responses
leveraging the backend store - if you are using responseOverrides, then
you should provide the version in your mocked response as needed. This
enables mixed version responses in a single MockServer (e.g. if you are
migratiing some endpoints to another version).
if using the provided `serverResponse` utility to compose your response
overrides, you can pass the version in via a new options parameter
```js
mockServer.responseOverrides = [
{
path: '/users/1',
method: 'GET',
response: (mockServer) => serverResponse(mockServer.store.getOne('users', 1), { version: '1.0' }),
}
]
```
9ae6483 to
30ca468
Compare
5e6559b to
0c3f7f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
return JSONAPI version in MockServer responses
this version is configurable when creating the mock server via the
jsonapiVersionoption. It will only be included in responsesleveraging the backend store - if you are using responseOverrides, then
you should provide the version in your mocked response as needed. This
enables mixed version responses in a single MockServer (e.g. if you are
migratiing some endpoints to another version).
if using the provided
serverResponseutility to compose your responseoverrides, you can pass the version in via a new options parameter