I am building an Android, Java-based app that connects to a PHP server and retrieves data from it. As there are only a few different types of entities for now, it doesn't cost that much to encode these entities into JSON in the PHP service's response, decode them when the JSON data is retrieved in Java and recreate entities there. However this means that entities have to be defined once in PHP and once in Java.
I was thinking about JSON-schema as a solution to create a data structure definition once (with the JSON-schema format) and generate entities in both languages from it, unfortunately I didn't find any JSON schema to entity mapper in PHP. Are there any anternatives that allow entities to be generated in both languages ?
edit: I have used PHP Java-bridge in the past but I'm looking for something lighter.