Improve API Error Message for Collection Alias Validation
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 564
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 29
Description
Description:
When attempting to create a collection with an alias consisting only of numbers (e.g., 888), the API returns a technical error message:
"Identifier is not valid. Valid characters are a-Z, 0-9, '_', and '-'."
This message is misleading to the end user because it suggests that numbers are allowed, but in reality, an alias must contain at least one letter.
Proposed Fix:
Update backend validation logic to return a clearer message, e.g.:
"Invalid alias. Use letters (A–Z, a–z), numbers (0–9), underscores (_), or hyphens (-), and include at least one letter."
Steps to Reproduce:
- Go to API endpoint for creating a Dataverse collection.
- Set alias to a numeric-only string (e.g., 888).
- Observe returned error message.
Expected Result:
A user-friendly and accurate error message explaining that numeric-only aliases are not allowed.
https://github.com/user-attachments/assets/45c804b6-7d30-4912-8eb5-648d83816262
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the backend alias validation used by the collection-creation API and reproduce the behavior with the numeric-only alias 888. Trace where the current identifier error is formed, then verify that the response explains the requirement for at least one letter while still documenting the permitted characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100