Skip to content

Code breaks when trying to convert to an enum #175

@YotamhGithub

Description

@YotamhGithub

Where

ConvertEnumValue at fhir-codegen-main\fhir-codegen-main\src\Microsoft.Health.Fhir.CodeGen\Language\Firely\CSharpFirelyCommon.cs

at
foreach (string bit in bits) { result += bit.Substring(0, 1).ToUpperInvariant(); result += bit.Substring(1); }

What

If the bit is empty, the code crashes.
Is it OK to have empty "bit"? Probably not. but it happens!
So, I think, assuming the bit is non empty, is too harsh.

Example

For instance, try to run

"Firely ILHDP": {
"commandName": "Project",
"commandLineArgs": "generate FirelyNetIg -p il.hdp.fhir.r4#0.2.4 --auto-load-expansions --resolve-dependencies true --include-experimental",
"workingDirectory": "$(MSBuildProjectDirectory)"
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions