-
-
Notifications
You must be signed in to change notification settings - Fork 778
Open
Labels
Description
Describe the bug ๐
I ran into this error:
The JSON payload for polymorphic interface or abstract type 'CleanAspCore.Api.Endpoints.Weapons.CreateWeaponRequest' must specify a type discriminator. Path: $ | LineNumber: 0 | BytePositionInLine: 10
It seems refit is not taking into account JsonDerivedType. I assume because its not using the base type that contains those attributes.
Step to reproduce
- Use json serialization with derived classes: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/polymorphism
- Send a request
- Notice the type discriminator property is missing which causes problems when deserializing
Reproduction repository
https://github.com/reactiveui/refit
Expected behavior
The type disriminator is included in the json payload
Screenshots ๐ผ๏ธ
No response
IDE
Rider
Operating system
Windows
Version
11
Device
PC
Refit Version
8.0.0
Additional information โน๏ธ
No response
Reactions are currently unavailable