Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to the generated READMEs #1

Open
ms14981 opened this issue Jan 10, 2023 · 0 comments
Open

Improvements to the generated READMEs #1

ms14981 opened this issue Jan 10, 2023 · 0 comments

Comments

@ms14981
Copy link
Contributor

ms14981 commented Jan 10, 2023

Taking the openapi-forge-typescript generator as an example, it creates a README.md with this:

import ApiPet from "./api";
import Configuration from "./configuration";
import { transport } from "./nodeFetch";
// import any model types you need
import { Order } from "./api/model";

const config = new Configuration(transport);
// set the base path for your endpoint
config.basePath = "https://example.com";
// set any environment specific configuration here
const api = new ApiPet(config);

api.findPetsByStatus(...).then((data) => {
   // log the result
   console.log(data);
});
  1. It sets the basePath to "https://example.com". One of our CLI arguments is https://petstore3.swagger.io/api/v3/openapi.json and the base path is https://petstore3.swagger.io. Is it possible to include this in the README.md template to save the user having to manually switch it out?
  2. Can we include an example status to put into api.findPetsByStatus?
  3. Can we generate an example command to run? e.g. generate an index.ts as well as a README.md and tell the user that they can run it with ts-node?

It's possible that all of this is overkill, and given that the user will need to edit the code anyway, perhaps this isn't worth it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant