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

provide OpenApi metadata #1508

Closed
nimo23 opened this issue Jan 9, 2025 · 1 comment
Closed

provide OpenApi metadata #1508

nimo23 opened this issue Jan 9, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@nimo23
Copy link

nimo23 commented Jan 9, 2025

What is the problem this feature would solve?

Currently, it is not possible to access OpenApi (meta)data within userland source files with kubb. For example, in orval I can use something like that to make use of the openapi metadata:

// write a jsdoc with OpenAPI metadata in each generated file
header: (info: InfoObject): string[] => [
    `Generated from orval.`,
    `Do not edit manually.`,
    ...(info.title ? [info.title] : []),
    ...(info.description ? [info.description] : []),
    ...(info.version ? [`OpenAPI spec version: ${info.version}`] : []),
],

which returns:

/**
 * Generated by orval.
 * Do not edit manually.
 * TaskApp API
 * OpenAPI spec version: 1.0.0
 */

An equivalent in Kubb could be achived with the help of https://github.com/readmeio/oas:

pluginClient({
    output: {
         // access openapi metadata to add it to the banner
         banner: ...
}}

See also: #1503.

External documents/projects?

No response

What is the feature you are proposing to solve the problem?

No response

What alternatives have you considered?

No response

@nimo23 nimo23 added the enhancement New feature or request label Jan 9, 2025
@stijnvanhulle
Copy link
Collaborator

This has been added in v3.5.0

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

No branches or pull requests

2 participants