Shaddix / react-query-swagger

Generates react-query hooks based on Swagger API definitions
MIT License
122 stars 4 forks source link

Support nested `deepObject` serialization style for Query (e.g. nested dictionary) #26

Open Shaddix opened 1 year ago

Shaddix commented 1 year ago
          `deepObject` serialization style is required when I try write endpoint like this:
[HttpGet]
public async Task<PagedResult<AnswerDto>> GetAnswers([FromQuery] AnswerFilters filters)  {
    // Do something
};

public class AnswerFilters {
    public DateTime? Since { get; set; }
    public DateTime? Until { get; set; }

    public Dictionary<string, string>? Tags { get; set; }
}

Here Tags cannot be bound if the query parameter isn't serialized with deepObject style.

Originally posted by @Rudomitori in https://github.com/Shaddix/react-query-swagger/issues/25#issuecomment-1541755225