API Casing in Typesense and Dotnet Client Code
TLDR satish sought clarification on API casing standards. Jason explained that Typesense API uses snake_case, while the dotnet client code uses camelCase. Rune further elaborated on how to override the default properties in dotnet.
Apr 04, 2022 (19 months ago)
satish
04:38 PMJason
06:05 PMCC: Rune who authored the dot net client
Rune
06:08 PM[JsonPropertyName("house_number")]
public int HouseNumber { get; set; }
So you can set the names to whatever you like. 🙂
You could also do something weird like:
[JsonPropertyName("hOuse_NumBer")]
public int HouseNumber { get; set; }
Full class example using snake_case:
public class Address
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("house_number")]
public int HouseNumber { get; set; }
[JsonPropertyName("access_address")]
public string AccessAddress { get; set; }
[JsonPropertyName("metadata_notes")]
public string MetadataNotes { get; set; }
}
Also all API params are translated to snake_case if you use the default implementation shown in the docs, example doing a search.
var query = new SearchParameters("Smed", "access_address");
var searchResult = await typesenseClient.Search<Address>("Addresses", query);
Apr 05, 2022 (19 months ago)
satish
02:10 AMTypesense
Indexed 2776 threads (79% resolved)
Similar Threads
Troubleshooting TypeScript Error with Typesense
GM experienced an error with Typesense in TypeScript, requiring help to correct the issues. Jason helped propose solutions and adjustments to the code. Ultimately, they were able to resolve the errors and successfully implement a search function.
Query Parameters Issue in Using Typesense with Flutter
Shane was having issues with query parameters when using the Typesense package in a Flutter app. Kishore Nallan advised to avoid using the preset parameter, and the issue was resolved when Shane directly specified 'query_by'. Kishore Nallan will investigate the likely issue with the Flutter client.
Troubleshooting Issues with DocSearch Hits and Scraper Configuration
Rubai encountered issues with search result priorities and ellipsis. Jason helped debug the issue and suggested using different versions of typesense-docsearch.js, updating initialization parameters, and running the scraper on a Linux-based environment. The issues related to hits structure and scraper configuration were resolved.