Skip to content

Support for models (classes) with danish letters (æ, ø, å) and in capitalized form ('Æ', 'Ø', 'Å') #151

@fasilhayat

Description

@fasilhayat

I am having issues using a model that contains danish letters as part of my domain model.
The letters 'æ', 'ø', 'å' and capitalized ('Æ', 'Ø', 'Å') are not working as I get the following exception:

Bruger.Køn' declares an invalid route of ''. Each segment of the route must conform to standard graphql naming rules. (Regex: ^([_A-Za-z][0-9A-Za-z]|[0-9A-Za-z]+)[_0-9A-Za-z]*$ )

Is there a way to fix this? We cannot rename our field or classes.

The exception is thrown in this class: 'src/graphql-aspnet/Internal/TypeTemplates/SchemaItemTemplateBase.cs'
Line:

$"Each segment of the route must conform to standard graphql naming rules. (Regex: {Constants.RegExPatterns.NameRegex} )",

Would it be safe to add the special characters to the regex pattern?

public static readonly Regex NameRegex = new Regex(@"^([_A-Za-z][0-9A-Za-z]|[0-9A-Za-z]+)[_0-9A-Za-z]*$");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions