Skip to content

JSON-LD: field may have more data than just `@value`

When sending content in JSON-LD with @language set, for example:

{'http://happy-dev.fr/owl/#title': 'titre', '@context': {'@language': 'fr'}}

it is compressed into this format

'title': {'@language': 'fr', '@value': 'titre'}

I am currently thrown a 400 - Bad Request, because the serializer.is_valid() returns False... 'title': [ErrorDetail(string='Not a valid string.', code='invalid')]

Obviously, parsing the @language of the content is the responsibility of DjangoLDP-i18n to extend. But DjangoLDP should be able to parse the field in this format as well, probably overriding is_valid to analyse the @value of the field, if need be

Edited by Calum Mackervoy