Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"enum": [":"] is raising an invalid exception while rendering Liquid template CSharp/Enum #5124

Open
ALCHEMY-ALAMBIK opened this issue Mar 21, 2025 · 0 comments

Comments

@ALCHEMY-ALAMBIK
Copy link

ALCHEMY-ALAMBIK commented Mar 21, 2025

Describe the bug

Use a json enum in a model with semi column as a value: "enum": [":"]

This raises the follwing exception:
System.InvalidOperationException: Error while rendering Liquid template CSharp/Enum:
Index was outside the bounds of the array.
at NJsonSchema.ConversionUtilities.ConvertToUpperCamelCase(String input, Boolean firstCharacterMustBeAlpha)

Version of NSwag toolchain, computer and .NET runtime used

All

To Reproduce

Typical API case:

"preferenceHourMinuteSeparator": { "type": "string", "description": "preferred separator between hour and minute", "enum": [ ":", "." ] }

Expected behavior

No error

Additional context

Thsi was found using API from SAP CONCUR wich JSON can be found here:
https://api.sap.com/api/ConcurIdentityV41/overview

@ALCHEMY-ALAMBIK ALCHEMY-ALAMBIK changed the title "enum": ["."] is raising an invalid exception while rendering Liquid template CSharp/Enum "enum": [":"] is raising an invalid exception while rendering Liquid template CSharp/Enum Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant