Skip to content

Feature Request: Serialization attributes for .AddObject #1443

Closed

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.

Activity

  1. stale commented on Aug 4, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  2. repo-ranger commented on Aug 4, 2020

    @repo-ranger

    ⚠️ This issue has been marked wontfix and will be closed in 3 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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