Repository navigation
Don't strip invalid characters from ImplementationGuide name (#1271) - #1639
Merged
Merged
Conversation
Leave sushi-config.yaml name as authored and warn when it violates the FHIR name constraint, instead of silently removing non-alphanumerics.
This was referenced Sep 13, 2026
cmoesel
approved these changes
Sep 17, 2026
cmoesel
left a comment
Member
There was a problem hiding this comment.
Thanks for the contribution, @cpruijsen. This looks great. The warning message is helpful too. Approved!
Thanks again!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
SUSHI was quietly removing non-alphanumeric characters from
ImplementationGuide.name(except_) and not capitalizing the first letter, so the result could still violate FHIRname.matches('[A-Z]([A-Za-z0-9_]){0,254}').initIGnow assignsconfig.nameas authored. If the name is present and does not match that constraint, SUSHI logs a warning that quotes the constraint and points at the"name"property insushi-config.yaml. It does not auto-capitalize and does not keep stripping.This matches how Profile / ValueSet / CodeSystem names are already handled (
HasName.setName): leave the value, warn, let the author fix it.What I chose and the alternative: leave the name as authored and warn. The alternative is to keep stripping (and maybe capitalize the first letter) and also warn. I chose leave-and-warn because that is what #1271 asks for, and because silent cleanup was the confusing part, including cases like
Minimal IGthat used to become a FHIR-validMinimalIGwith no log. Happy to switch if maintainers would rather sharenameRegexfrommixins.ts, keep a sanitized export plus a warn, or treat this as an error instead of a warning.Testing Instructions:
npm test -- test/ig/IGExporter.test.tssushi-config.yamlhasname: Minimal IG, confirm the generatedImplementationGuide-*.jsonkeepsname: "Minimal IG"and the build log warns with[A-Z]([A-Za-z0-9_]){0,254}.name: MinimalIG, confirm the name is unchanged and that constraint warning is not emitted.Note: authors who previously relied on SUSHI stripping spaces or hyphens will now export the invalid name and see a warning (and IG Publisher may reject it) until they fix
sushi-config.yaml. Usetitlefor the human label;nameis the machine identifier.Related Issue:
Fixes #1271