Here are five thoughtfully considered name alternatives for your publishedTemplate parameter — each aimed at clearly conveying its intent in a public API, and keeping in mind clarity, purpose, and configurability:
1. publishedUrlPattern
- ✅ Very descriptive: makes it clear this is a pattern for a URL
- ✅ Signals the string is templated and requires interpolation
- 🔄 Similar to route patterns in web frameworks
2. publishedUrlTemplate
- ✅ Keeps the use of "template", which clearly signals that this is not a full URL yet
- ✅ Based on common naming conventions (e.g., in mail templates or document templates)
- 🔁 More readable and user-friendly than
publishedTemplate
3. publishedEndpointTemplate
- ✅ Emphasizes that this is an endpoint, not just a raw URL
- ✅ Useful if your API has other configurable endpoints or templates
- 📌 More technical tone — good for power users
4. publishedPathFormat
- ✅ Aligns with
.format() style string substitutions
- ✅ Implies structure and dynamic construction
- 🌐 Slightly more compact than "Template"
5. publishedResourceUri
- ✅ "Resource URI" reflects RESTful terminology
- ✅ Could imply this is a resource locator with placeholder segments
- 📚 Better if your system is working with content-addressable or file-based resources
Bonus Tip:
If this templating system is used in multiple parts of your API (e.g., not just "published" URLs but maybe draft, preview, etc.), consider scoping it under a common config namespace, like:
{
urlTemplates: {
published: string;
draft: string;
preview: string;
}
}
This would let you pick names like:
urlTemplates.published
endpointPatterns.published
Summary Table
| Option | Pros | Style |
|---|
publishedUrlPattern | Clear, expressive | Practical |
publishedUrlTemplate | Intuitive, user-friendly | Balanced |
publishedEndpointTemplate | Technical, REST-aligned | Technical |
publishedPathFormat | Compact, format-driven | Precise |
publishedResourceUri | REST-flavored, abstract | Semantic |
Let me know your API style and I'll help you narrow it down further — or suggest some idiomatic patterns based on similar frameworks or ecosystems!