Skip to content

Feature Request: Serialization attributes for .AddObject #1443

@CrustyJew

Description

@CrustyJew

Expected Behavior

calling .AddObject(obj) on a RestRequest would create parameters with names serialized by rules of the JsonProperty or other naming attributes of the property

Actual Behavior

Adds parameter with name of property

Steps to Reproduce the Problem

public class MyClass {
        [JsonProperty("created_at")]
        public DateTime CreatedOn { get; set; }
}

Request:

var req = new RestRequest("url");
req.AddObject(new MyClass { CreatedOn = DateTime.Now } );

This results in a query string parameter of "CreatedOn" instead of "created_at"

Specifications

Attributes JsonAttribute("created_at"), XmlElement(ElementName = "created_at"), or a new attribute like SerializeAs, (etc.?) would create query string parameters using the names specified in the serialization attributes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions