RESTful API: How to handle translated textfields in representations?
Posted
by Jan P.
on Stack Overflow
See other posts from Stack Overflow
or by Jan P.
Published on 2010-04-22T10:05:28Z
Indexed on
2010/04/22
13:13 UTC
Read the original article
Hit count: 183
I am designing a RESTful API for a booking application. There are accommodations that you can request a list or the details. As the application targets a multi-language audience, the descriptions are (sometimes) available in different languages.
Now I'm not sure how to handle these translations in the representation of an accommodation. Without the multiple languages I would make "description" a field or the accommodation object, quite simple.
Any idea how to solve this elegantly?
My current idea: Add a list of descriptions with text<->culture pairs instead of the description field and an additional subressource /descriptions
to the accommodation for the creating (POST), updating (PUT) and deleting (DELETE) of new translations.
© Stack Overflow or respective owner