kontent-ai / delivery-sdk-net

Kontent.ai Delivery .NET SDK
https://www.nuget.org/packages/Kontent.Ai.Delivery
MIT License
32 stars 42 forks source link

Calling client.GetItemAsync with codename that contains a dash will throw NotFound error #177

Closed jmojiwat closed 4 years ago

jmojiwat commented 4 years ago

Brief bug description

I noticed the new single content method and tried to use it in our app: await client.GetItemAsync("about-us")

Always throws NotFound error when there is a dash in the Content Item Name.

This method works if I remove the dash in the Content Item Name. e.g.: await client.GetItemAsync("aboutus")

What went wrong?

Throws Unknown error. HTTP status code: NotFound. Reason phrase: Not Found.

Expected behavior

What the correct behavior is?

Expected the client to be able to find content with Content Item Name that contains dashes.

Test environment

jmojiwat commented 4 years ago

After some poking around. I noticed that when there are dashes in the Content Item Name, the generated Codename will replace the dashes with underscores.