The OpenAPI specification aims at standardizing the representation of REST based systems in json and yaml formats. A short version of the petstore is below:

 "swagger": "2.0",
 "info": {},
 "host": "petstore.swagger.io",
 "basePath": "/v2",
  "tags": [],
  "schemes": [
 "paths": {},
 "securityDefinitions": {},
 "definitions": {},
 "externalDocs": {
 "description": "Find out more about Swagger",
 "url": "http://swagger.io"

Based on this document, client and server stubs can be generated in different programming languages/frameworks using the OpenAPI codegen project. Is there a computer science theory behind this ? To be more precise, I want to specifically know if there are theoretical concepts behind taking an input, (in this case a json/yaml document) and getting a source code representation in one or more programming languages that represents the initial input ?

  • $\begingroup$ @DavidRicherby +1 for the wikipedia reference. It included the information I was looking for. I understand now that generative programming , (which falls under automatic programming), deals with automatic code generation. I also found some academic papers that give more insights into the theory and related research :) I can accept your answer if you move it to the appropriate place. $\endgroup$
    – SyCode
    Commented Jun 13, 2018 at 16:38
  • $\begingroup$ OK. We generally discourage answers that are just a link to some other resource so, if somebody posts a proper answer that isn't just a link, please unaccept mine and give them the credit that I don't deserve. :-) $\endgroup$ Commented Jun 13, 2018 at 16:49

1 Answer 1


I don't know anything about it but the field as a whole is called "automatic programming", which should give you pointers of where to look.

  • $\begingroup$ If anyone has an answer that isn't just a link, please do post it! $\endgroup$ Commented Jun 13, 2018 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.