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

feat(typegen): banner comment option #179

Merged
merged 6 commits into from Feb 29, 2024

Conversation

pas-mike
Copy link
Contributor

@pas-mike pas-mike commented Feb 15, 2024

This PR allows for a banner to be added at the top of the generated file.

I required this for disabling eslint.

@anttiviljami
Copy link
Member

Love this idea 😍

@@ -69,7 +76,8 @@ export async function main() {

opts.disableOptionalPathParameters = argv.disableOptionalPathParameters ?? true;

const [imports, schemaTypes, operationTypings] = await generateTypesForDocument(argv._[0] as string, opts);
const [imports, schemaTypes, operationTypings, banner] = await generateTypesForDocument(argv._[0] as string, opts);
console.log(banner, '\n');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably not log anything to stdout when the -b option is not supplied

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I've made the changes.

@anttiviljami anttiviljami merged commit a437efe into openapistack:main Feb 29, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants