Change the return type of create_mapping() from MappingResponse to Mapping#99
Merged
oleg-nenashev merged 1 commit intowiremock:masterfrom Dec 12, 2023
hassomehide:fix-create-mapping-response
Merged
Change the return type of create_mapping() from MappingResponse to Mapping#99oleg-nenashev merged 1 commit intowiremock:masterfrom hassomehide:fix-create-mapping-response
create_mapping() from MappingResponse to Mapping#99oleg-nenashev merged 1 commit intowiremock:masterfrom
hassomehide:fix-create-mapping-response
Conversation
…onse which despite its name is not the correct type
|
Who is responsible for PRs merging? Nice fix, I've faced with the same issue |
Member
|
Sorry for the delay, there was no codeowner on this repo so I missed the PRs submitted while I was on the sick leave |
create_mapping() from MappingResponse to Mapping
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.
I am not too familiar with this library or WireMock, however I need to create a mapping and remember its ID so I can delete it later. It turns out that the object returned by create_mapping is a
MappingResponsefull of None values and there is noidproperty at all.This PR changes the return type to
Mapping, which seems to be what the WireMock server actually returns.MappingResponseis just the type of theresponseproperty inMapping.The existing unit test did not catch the bug because the mocked response was already wrong to begin with. Weirdly enough this bug has existed since the initial commit.
I did not add any integration tests because I could not get them to work. Integration tests are also failing in CI.