A tool for generating well polished and developer friendly API documentation(openAPI spec 3.0.0) directly from source code with LLM
This project represents the practical application of our extensive research studies. It is essential to emphasize that this is a research project and is expressly NOT intended for use in production environments. The focus of this endeavor is to explore, experiment, and advance knowledge within a controlled research context. We appreciate your understanding and cooperation in this regard.
-
Create a
.env
file in project root directory and add your openAI key gotten from openai. Should be in the format:OPENAI_API_KEY=your_key_here
-
Setup
lana.config.ts
file in root directory(N/A for now) with the follwing config. this is basic information about your api servers etc
// lana.config.ts
const lanaConfig = {
info: {
title: 'Geek Quote API', // Name of the API
version: '1.0.0', // API version
description: 'My API Description', // API description
termsOfService: 'https://example.com/terms', // Terms of service URL
contact: {
name: 'John Doe', // Contact name
email: '[email protected]', // Contact email
url: 'https://example.com/contact', // Contact URL
},
license: {
name: 'Apache 2.0', // License name
url: 'https://www.apache.org/licenses/LICENSE-2.0', // License URL
},
},
servers: [
{
url: 'https://geek-quote-api.vercel.app/', // Server URL
description: 'Production server', // Server description
},
{
url: 'https://localhost:3000', // Server URL
description: 'Developement server', // Server description
},
],
};
export default lanaConfig;
- Install extention from here
- Run extention with command '
F5
' on windows/linux and '⇧⌘P
' on MacOS - Will prompt to select file with endpoints declarations(interface) select file and hit
Enter
- OpenAPI specification file(
openapi-spec.yaml
) will be created inroot
directory of your workspace with the file containing the api docs in.yaml
format(this will then be rendered to html page later down the line)
An example output from gpt-3.5-turbo-instruct model can be found here
- Max token for response is at:
max_tokens: 2097
- Hallucinations: should train model on openAPI 3.0.0 spacifications for better results
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
For example if there is an image subfolder under your extension project workspace:
![feature X](images/feature-x.png)
Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
Include if your extension adds any VS Code settings through the contributes.configuration
extension point.
For example:
This extension contributes the following settings:
myExtension.enable
: Enable/disable this extension.myExtension.thing
: Set toblah
to do something.
Calling out known issues can help limit users opening duplicate issues against your extension.
Users appreciate release notes as you update your extension.
Initial release of ...
Fixed issue #.
Added features X, Y, and Z.
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
- Split the editor (
Cmd+\
on macOS orCtrl+\
on Windows and Linux). - Toggle preview (
Shift+Cmd+V
on macOS orShift+Ctrl+V
on Windows and Linux). - Press
Ctrl+Space
(Windows, Linux, macOS) to see a list of Markdown snippets.
Enjoy!
Note: This project is to be a concrate application of my research studies. this is a reasearch project and is NOT to be used in production environments.