I quite enjoy inventing parsers for docs and generating clients. You should try that approach instead of writing everything by hand.