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

[#38] Add instance default value #39

Merged
merged 4 commits into from
Mar 30, 2021
Merged

Conversation

lwitkowski
Copy link
Collaborator

@lwitkowski lwitkowski commented Mar 27, 2021

For explanation 'why' refer to #38

Changes in this PR from end user point of view: NotFoundException thrown from /country/pl:

Before:

{
  "title": "Not Found",
  "status": 404,
  "detail": "Country not found"
}

After:

{
  "title": "Not Found",
  "status": 404,
  "detail": "Country not found",
  "instance": "/country/pl"
}

What is important is that adding default values happens after problem is logged to console. This means type and instance fields are not logged, otherwise it could lead to personal info (like ssn sent as path param) being logged, which is usually not a good idea.

Closes #38

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@lwitkowski lwitkowski force-pushed the feat/type-and-instance branch 3 times, most recently from 353203c to 06a3588 Compare March 27, 2021 10:21
@github-actions

This comment has been minimized.

@lwitkowski lwitkowski requested a review from pazkooda March 27, 2021 10:26
@lwitkowski lwitkowski marked this pull request as ready for review March 27, 2021 10:26
@lwitkowski lwitkowski requested a review from amasnik as a code owner March 27, 2021 10:26
@lwitkowski lwitkowski force-pushed the feat/type-and-instance branch from 06a3588 to eb05637 Compare March 29, 2021 11:55
@github-actions

This comment has been minimized.

@lwitkowski lwitkowski force-pushed the feat/type-and-instance branch from eb05637 to d090e29 Compare March 29, 2021 12:00
@github-actions

This comment has been minimized.

@lwitkowski lwitkowski changed the title [#38] Add type and instance members default values [#38] Add instance default value Mar 29, 2021
@github-actions

This comment has been minimized.

Copy link
Collaborator

@pazkooda pazkooda left a comment

Choose a reason for hiding this comment

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

Approved (with one comment - could be fixed later).


Problem enhancedProblem = processor.apply(originalProblem, simpleContext());

assertThat(enhancedProblem.getInstance()).hasPath("/endpoint");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Quite not-self-contained test :(.
Why I need to go outside of this class to understand why path has /endpoint?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True that, will address that in separate PR, where I already have made some changes to this class.

@lwitkowski lwitkowski merged commit 07c9347 into master Mar 30, 2021
@lwitkowski lwitkowski deleted the feat/type-and-instance branch March 30, 2021 07:45
@github-actions
Copy link

Unit Test Results

15 files  ±0  15 suites  ±0   22s ⏱️ ±0s
47 tests ±0  47 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 07c9347. ± Comparison against base commit 07c9347.

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.

Add instance member default value
2 participants