Systems and methods for a code generation tool for software development systems
Systems and methods for code generation are described. The method may include accessing an application programming interface (API) specification written in a first computer programming language. The method may also include processing the API specification in the first computer programming language with a code generation tool. Furthermore, the method may include generating, from the API specification, code in each of a plurality of different computer programming languages different from the first computer programming language and different from each other.
1. A code generation method, comprising:
accessing, by a computer processing system, an application programming interface (API) specification written in a first computer programming language;
processing, by the computer processing system, the API specification in the first computer programming language with a code generation tool; and
generating, by the computer processing system from the API specification, code in each of a plurality of different computer programming languages different from the first computer programming language and different from each other, wherein the first computer programming language is a declarative computer programming language, and each of the plurality of different computer programming languages are not declarative computer programming languages, and wherein the generating further comprises:
interpreting by the code generation tool, a declarative statement in the first computer programming language in which the API specification is written, and
outputting, by the code generation tool, a plurality of snippets of code corresponding to the declarative statement, wherein each output snippet of code is expressed in one of the plurality of different computer programming languages, and each output snippet of code is in a compliable or near compliable form for a computer programming language to which the output snippet of code belongs.
2. The method of claim 1 , further comprising:
when an output snippet of code is in a near compilable form, generating a notification for a developer comprising the output snippet of code and the status of the code;
receiving an update to the output snippet of code from the developer, the updated output snippet in compilable form; and
replacing the near compilable form of the output snippet of code with the received updated output snippet in compilable form.
3. The method of claim 1 wherein processing the API specification in the first computer programming language with the code generation tool, further comprises:
generating, by the code generation tool, an abstract syntax tree from a plurality of declarative statements in the API specification, the abstract syntax tree modeling source code of the application programming interface (API) specification written in the first computer programming language;
accessing, by one or more printers of the code generation tool, the outputted plurality of snippets of code corresponding to each declarative statement in the API specification; and
transforming, by the one or more printers of the code generation tool, the outputted plurality of snippets of code corresponding to each declarative statement in the API specification into the code in each of a plurality of different computer programming languages different from the first computer programming language.
4. The method of claim 3 , further comprising:
embedding the code in each of a plurality of different computer programming languages in a different API client library associated with the programming language to which the API client library applies.
5. The method of claim 1 , further comprising:
outputting, by the code generation tool, one of the plurality of snippets of code, commenting associated with the one of the plurality of snippets of code, or a combination thereof to a predefined location within documentation for an API library to which the snipped of code belongs.
6. The method of claim 1 , wherein the declarative statement comprises a declarative statement of a function, component, construct, or operation of the API specification written in the first computer programming language.
7. The method of claim 1 , wherein the first computer programming language comprises REACT, and the different programming languages comprises two or more of JAVA, JAVASCRIPT, PHP, RUBY, .NET, NODE, and GO.
8. A code generation system comprising:
a memory; and
a processor coupled with the memory to perform operations, comprising:
accessing, from the memory, an application programming interface (API) specification written in a first computer programming language,
processing the API specification in the first computer programming language with a code generation tool, and
generating, from the API specification, code in each of a plurality of different computer programming languages different from the first computer programming language and different from each other, wherein the first computer programming language is a declarative computer programming language, and each of the plurality of different computer programming languages are not declarative computer programming languages, and wherein the generating further comprises:
interpreting by the code generation tool, a declarative statement in the first computer programming language in which the API specification is written; and
outputting, by the code generation tool, a plurality of snippets of code corresponding to the declarative statement, wherein each output snippet of code is expressed in one of the plurality of different computer programming languages, and each output snippet of code is in a compliable or near compliable form for a computer programming language to which the output snippet of code belongs.
9. A non-transitory computer readable medium comprising instructions, which when executed by a computer processing system, cause the computer processing system to perform operations for generating code, the operations comprising,
accessing, by the computer processing system, an application programming interface (API) specification written in a first computer programming language;
processing, by the computer processing system, the API specification in the first computer programming language with a code generation tool; and
generating, by the computer processing system from the API specification, code in each of a plurality of different computer programming languages different from the first computer programming language and different from each other, wherein the first computer programming language is a declarative computer programming language, and each of the plurality of different computer programming languages are not declarative computer programming languages, and wherein the generating further comprises:
interpreting by the code generation tool, a declarative statement in the first computer programming language in which the API specification is written; and
outputting, by the code generation tool, a plurality of snippets of code corresponding to the declarative statement, wherein each output snippet of code is expressed in one of the plurality of different computer programming languages, and each output snippet of code is in a compliable or near compliable form for a computer programming language to which the output snippet of code belongs.
10. The non-transitory computer readable medium of claim 9 , further comprising:
when an output snippet of code is in a near compilable form, generating a notification for a developer comprising the output snippet of code and the status of the code;
receiving an update to the output snippet of code from the developer, the updated output snippet in compilable form; and
replacing the near compilable form of the output snippet of code with the received updated output snippet in compilable form.
11. The non-transitory computer readable medium of claim 9 , wherein processing the API specification in the first computer programming language with the code generation tool, further comprises:
generating, by the code generation tool, an abstract syntax tree from a plurality of declarative statements in the API specification, the abstract syntax tree modeling source code of the application programming interface (API) specification written in the first computer programming language;
accessing, by one or more printers of the code generation tool, the outputted plurality of snippets of code corresponding to each declarative statement in the API specification; and
transforming, by the one or more printers of the code generation tool, the outputted plurality of snippets of code corresponding to each declarative statement in the API specification into the code in each of a plurality of different computer programming languages different from the first computer programming language.
12. The non-transitory computer readable medium of claim 11 , further comprising:
embedding the code in each of a plurality of different computer programming languages in a different API client library associated with the programming language to which the API client library applies.
13. The non-transitory computer readable medium of claim 9 , further comprising:
outputting, by the code generation tool, one of the plurality of snippets of code, commenting associated with the one of the plurality of snippets of code, or a combination thereof to a predefined location within documentation for an API library to which the snipped of code belongs.
14. The non-transitory computer readable medium of claim 9 , wherein the declarative statement comprises a declarative statement of a function, component, construct, or operation of the API specification written in the first computer programming language.
15. The non-transitory computer readable medium of claim 9 , wherein the first computer programming language comprises REACT, and the different programming languages comprises two or more of JAVA, JAVASCRIPT, PHP, RUBY, .NET, NODE, and GO.
16. The system of claim 8 , wherein the processor is further configured to perform operations, comprising:
when an output snippet of code is in a near compilable form, generating a notification for a developer comprising the output snippet of code and the status of the code;
receiving an update to the output snippet of code from the developer, the updated output snippet in compilable form; and
replacing the near compilable form of the output snippet of code with the received updated output snippet in compilable form.
17. The system of claim 8 , wherein the processor processing the API specification in the first computer programming language with the code generation tool, further comprises the processor:
generating, by the code generation tool, an abstract syntax tree from a plurality of declarative statements in the API specification, the abstract syntax tree modeling source code of the application programming interface (API) specification written in the first computer programming language;
accessing, by one or more printers of the code generation tool, the outputted plurality of snippets of code corresponding to each declarative statement in the API specification; and
transforming, by the one or more printers of the code generation tool, the outputted plurality of snippets of code corresponding to each declarative statement in the API specification into the code in each of a plurality of different computer programming languages different from the first computer programming language.
18. The system of claim 17 , wherein the processor is further configured to perform operations, comprising:
embedding the code in each of a plurality of different computer programming languages in a different API client library associated with the programming language to which the API client library applies.
19. The system of claim 8 , wherein the processor is further configured to perform operations, comprising:
outputting, by the code generation tool, one of the plurality of snippets of code, commenting associated with the one of the plurality of snippets of code, or a combination thereof to a predefined location within documentation for an API library to which the snipped of code belongs.
20. The system of claim 8 , wherein the declarative statement comprises a declarative statement of a function, component, construct, or operation of the API specification written in the first computer programming language.
21. The system of claim 8 , wherein the first computer programming language comprises REACT, and the different programming languages comprises two or more of JAVA, JAVASCRIPT, PHP, RUBY, .NET, NODE, and GO.