-
We have a custom JSON endpoint that returns badge data to shields.io. Whenever the tests are pending the badges show up as invalid but I can't figure out what's wrong with the JSON. Here's the JSON that's returned: It results in the right-most badge here (label param is overridden): It displays correctly when the tests have finished. Here's an example response that renders correctly: The only thing I can think that's wrong is the colour but orange is used in the example JSON on the shields.io site. Any ideas what could be wrong or how to debug it? I could try using a different colour for the pending status but I'd prefer to keep it orange. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
I've changed the color from 'orange' to 'important' and it still shows up as invalid. I've looked at the headers and they also look fine (they match the headers when a non-pending response is returned). |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thanks for reaching out. To be honest, it's a bit hard to follow the thread here since we're trying to match up screenshots of badges without knowing what the actual badges are. You mentioned that you were overriding the label value defined in the Endpoint response, but I'm also puzzled by the mismatch between the message values of your snippet (all test related) relative to the final "in progress" message. Would it be possible for you to share the actual badge urls for those badges? |
Beta Was this translation helpful? Give feedback.
-
For prosperity: When tests were pending the status code I returned was 201, which shields.io doesn't support. I fixed this by returning a 200 status instead of 201. |
Beta Was this translation helpful? Give feedback.
For prosperity: When tests were pending the status code I returned was 201, which shields.io doesn't support. I fixed this by returning a 200 status instead of 201.