Skip to content

Test operation with enum member #30

Open
@MateuszGert

Description

@MateuszGert

I have model class with enum member annotated by LowerCaseJsonStringEnumConverter.
[JsonPropertyName("urlBuilder")] [JsonConverter(typeof(LowerCaseJsonStringEnumConverter))] [Required] public UrlBuilderMode? UrlBuilder { set; get; }
During executing test operation I got JsonPatchTestOperationException.

The problem is in controller I have JsonPatchDocument where value is string.
In TObj there is UrlBuilderMode type.
If I replace value from string to UrlBuilderMode then everything works.
Solution for that is to deserialize to proper enum value (because TObj is tagged with JsonConverter) or to support in test function operation with value string with enum member.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions