Skip to content

[Endpoint] Support message override and position it after label in API docs - #12235

Merged
LitoMore merged 2 commits into
badges:masterfrom
LitoMore:endpoint/override-message
Nov 22, 2026
Merged

LitoMore merged 2 commits into
badges:masterfrom
LitoMore:endpoint/override-message

Conversation

@LitoMore

@LitoMore LitoMore commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Adds an optional message query parameter to Endpoint badges to override the message returned by the JSON endpoint:

/endpoint?url=https://example.com/badge&message=custom

When omitted, the endpoint’s message is preserved. Empty overrides are rejected, and response validation errors remain visible.

Updates the API documentation and adds displayAfter / x-display-after support to place message immediately after label.

@github-actions

Copy link
Copy Markdown
Contributor
Messages
📖 ✨ Thanks for your contribution to Shields, @LitoMore!

Generated by 🚫 dangerJS against d3a2016

@PyvesB

PyvesB commented Oct 24, 2026

Copy link
Copy Markdown
Member

👋🏻 I haven't wrapped my head around this yet, but I'm seeing that two past maintainers were opposed to this feature. What's your take on this?

@LitoMore

Copy link
Copy Markdown
Member Author

I was planning to use an API to call the Endpoint Badge to display this badge. However, I've found that I can't customize the message because the message is always hardcoded into the Endpoint Badge's JSON.

For example:

Let's use this example JSON for endpoint response. And the logoSvg might be very long (more than 8192 characters); that's why I chose an endpoint.

GET https://example.com/social-badge?logo=linkedin&label=LinkedIn&message=LitoMore (will request the example JSON at the backend and carry all parameters to Shields.io)

As a social badge provider, I'd like to allow users to customize the badge label and message however they want. They can simply use label=foo to customize the label, but there's no equivalent for the message. As the provider, we have to implement backend logic to generate a different endpoint response.

It would be simpler if we could customize it using the endpoint badge’s parameter. I want the service to care only about changes to the logo and leave everything else to Shields.io's endpoint. This way, I won't have to deal with character security issues on my own server.

Comment thread core/base-service/openapi.js Resolved
Comment thread services/endpoint/endpoint.tester.js Resolved

@PyvesB PyvesB left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me! 👍🏻

@LitoMore
LitoMore added this pull request to the merge queue Nov 22, 2026
Merged via the queue into badges:master with commit 8ecf533 Nov 22, 2026
17 checks passed
@LitoMore
LitoMore deleted the endpoint/override-message branch November 22, 2026 21:47
@LitoMore LitoMore mentioned this pull request Nov 24, 2026
2 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Enable overriding the message of a json endpoint through the query string in the URL

2 participants