Open Closed

Model JSON properties #1107


User avatar
0
Dicky.tech@gmail.com created

I don't seem to get json property names working.

abp seems to normalise every request response regardless of the json property names. see below sample and how have set my field properties. how can I.get it to work and have my API responses reflect well i.e CityName ? I also want to return 5,000 records per page for this service, the default seems to be 1,000 max.

public class Videogame { [JsonProperty("CityName")] public string City_Name { get; set; } [JsonProperty("ReleaseDate")] public DateTime Release_Date { get; set; } }


7 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I.get it to work and have my API responses reflect well i.e CityName ?

    What is your ABP Framework version?

    I also want to return 5,000 records per page for this service, the default seems to be 1,000 max.

    I think you can change this.

    https://github.com/abpframework/abp/blob/3fcdeeeb05810b7a2e162f212ef435b81d412aa5/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs#L25

  • User Avatar
    0
    Dicky.tech@gmail.com created

    What is your ABP Framework version?

    2.3 am also planning to upgrading to 4.3

    https://github.com/abpframework/abp/blob/3fcdeeeb05810b7a2e162f212ef435b81d412aa5/framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs#L25

    Any shortcut to change this without passing through the ABP source code ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    2.3 am also planning to upgrading to 4.3

    The JsonProperty attribute namespace should belong Newtonsoft.Json, Can you check?

    Any shortcut to change this without passing through the ABP source code ?

    Default value of MaxMaxResultCount will be 1,000. Set LimitedResultRequestDto.MaxMaxResultCount static property to increase it.

  • User Avatar
    0
    Dicky.tech@gmail.com created

    2.3 am also planning to upgrading to 4.3

    The JsonProperty attribute namespace should belong Newtonsoft.Json, Can you check? Yes this belongs to Newtonsoft.json but it doesn't work on abp, seems the abp api generator doesn't recognise property names

    Any shortcut to change this without passing through the ABP source code ?

    Default value of MaxMaxResultCount will be 1,000. Set LimitedResultRequestDto.MaxMaxResultCount static property to increase it. Which specific file in my project can I set this?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    the abp api generator doesn't recognise property names

    It will support in v4.3. https://github.com/abpframework/abp/issues/7776

    Which specific file in my project can I set this?

    This is a static property, you can change it in places, such as Program.cs, Startup.cs

  • User Avatar
    0
    Dicky.tech@gmail.com created

    Thank you.

  • User Avatar
    0
    Dicky.tech@gmail.com created

    This two works well. thank for the great work.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 18, 2024, 05:54