Skip to content

Ignore Getters #12

@koprivajakub

Description

@koprivajakub

Hi, is possible to add flag which would ignore all getters in the class?

I have class:

    /// <summary>
    /// DTO class which is used to login a player via HTTP request to OAuth server (Lonely Backend).
    /// </summary>
    public class PlayerLoginRequestDTO : AbstractRequestDTO
    {
        /// <summary>
        /// Grant type for the OAuth server
        /// </summary>
        public readonly string grant_type;

        /// <summary>
        /// Login name of the user / player
        /// </summary>
        public readonly string username;

        /// <summary>
        /// Password in plain text of the user / player
        /// </summary>
        public readonly string password;

        /// <summary>
        /// Constructor creates a player login DTO which is serialized to JSON before the HTTP request is send.
        /// </summary>
        /// <param name="username">Login name of the user / player</param>
        /// <param name="password">Password in plain text of the user / player</param>
        /// <param name="grantType">The type of the credentials used. Currently supported only "password"</param>
        public PlayerLoginRequestDTO(string username, string password, string grantType)
        {
            this.username = username;
            this.grant_type = grantType;
            this.password = password;
        }

        /// <summary>
        /// Grant type for the OAuth server
        /// </summary>
        public string GrantType
        {
            get { return grant_type; }
        }

        /// <summary>
        /// Login name of the user / player
        /// </summary>
        public string Username
        {
            get { return username; }
        }

        /// <summary>
        /// Password in plain text of the user / player
        /// </summary>
        public string Password
        {
            get { return password; }
        }
    }

Which resutl in json:

{
  "grant_type": "passwod",
  "username": "uname",
  "password": "pass",
  "GrantType": "password",
  "Username": "uname",
  "Password": "pass"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions