Swagger validation failed for application health check issue.
Issue #126
closed
Hi All,
I'm added swagger request/response validation and it is working fine. But applications health check calls request/response also getting validated and failed with below issue. Can you please help me to fix this issue?
Thanks in advance.
Swagger validation: The REST request is invalid: xxx:xxx:null:/apps/applicationname/admin/health:GET::500:[ERROR - Request Accept header '; q=.2' is not a valid media type: []]Request Accept header '; q=.2' is not a valid media type
Harinath.
Comments (4)
-
-
Thanks, Sven. I'm getting this issue from Zuul , so i'm just thinking how to make it work in Zuul code.
-
Is this issue still open?
-
- changed status to closed
Closing due to inactivity. If this is still an issue please feel free to re-open.
- Log in to comment
Ahh, I remember this issue. You are using a RestTemplate or TestRestTemplate by Spring, aren't you.
The RestTemplate unfortunately does not send the correct accept header.
Please look here on how to set the correct accept header: https://stackoverflow.com/questions/46159097/adding-headers-to-postforobject-method-of-resttemplate-in-spring