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 JsonProcessingExceptionMapper #1440

Merged
merged 3 commits into from
Feb 2, 2024
Merged

Conversation

tylerwowen
Copy link
Contributor

@tylerwowen tylerwowen commented Feb 1, 2024

Before

curl -X PUT "http://localhost:8011/v1/envs/sample-service-1/canary/promotes" \
>  -H "authorization: token None"\
>  -H "content-type: application/json" \
>  -d '{"type":"AUTO","schedule":"string","delay":0,"envId":"YA9NEGBxRZC-GNSoOyVijw","lastOperator":"Anonymous","lastUpdate":1706754119336,"predStage":"string","queueSize":1,"disablePolicy":"MANUAL","avd":"CONTINUE"}' -v
*   Trying [::1]:8011...
* Connected to localhost (::1) port 8011
> PUT /v1/envs/sample-service-1/canary/promotes HTTP/1.1
> Host: localhost:8011
> User-Agent: curl/8.4.0
> Accept: */*
> authorization: token None
> content-type: application/json
> Content-Length: 209
> 
< HTTP/1.1 500 Internal Server Error
< Date: Thu, 01 Feb 2024 23:38:59 GMT
< Content-Type: application/json
< Content-Length: 464
< 

Message: Unrecognized field "avd" (class com.pinterest.deployservice.bean.PromoteBean), not marked as ignorable (10 known properties: "failPolicy", "queueSize", "delay", "schedule", "envId", "type", "predStage", "lastUpdate", "lastOperator", "disablePolicy"])
* Connection #0 to host localhost left intact
 at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 200] (through reference chain: com.pinterest.deployservice.bean.PromoteBean["avd"])

After

curl -X PUT "http://localhost:8011/v1/envs/sample-service-1/canary/promotes"  -H "authorization: token None" -H "content-type: application/json"  -d '{"type":"AUTO","schedule":"string","delay":0,"envId":"YA9NEGBxRZC-GNSoOyVijw","lastOperator":"Anonymous","lastUpdate":1706754119336,"predStage":"string","queueSize":1,"disablePolicy":"MANUAL","avd":"CONTINUE"}' -v
*   Trying [::1]:8011...
* Connected to localhost (::1) port 8011
> PUT /v1/envs/sample-service-1/canary/promotes HTTP/1.1
> Host: localhost:8011
> User-Agent: curl/8.4.0
> Accept: */*
> authorization: token None
> content-type: application/json
> Content-Length: 209
> 
< HTTP/1.1 400 Bad Request
< Date: Thu, 01 Feb 2024 23:44:18 GMT
< Content-Type: application/json
< Content-Length: 164
< 
* Connection #0 to host localhost left intact
{"code":400,"message":"Unable to process JSON","details":"Unrecognized field \"avd\" (class com.pinterest.deployservice.bean.PromoteBean), not marked as ignorable"}

@tylerwowen tylerwowen requested a review from a team as a code owner February 1, 2024 23:41
@github-actions github-actions bot added the deploy-service Includes changes to deploy-service label Feb 1, 2024
@tylerwowen tylerwowen merged commit 61b54dc into master Feb 2, 2024
5 checks passed
@tylerwowen tylerwowen deleted the touyang/jackson_exception branch February 2, 2024 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-service Includes changes to deploy-service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants