Skip to content

Enable adding custom extensions in the swagger's info section #2073

@themakarrony

Description

@themakarrony

Problem

Currently, Swaggo only supports adding custom extensions (x-*) at the root of the generated Swagger JSON.
However, the Swagger 2.0 / OpenAPI specification explicitly allows vendor extensions under the info object.

Expected behavior

It should be possible to add custom extensions in the info section (e.g., x-example, x-company-metadata, etc.).

Example

Given this Swagger definition:

"info": {
    "title": "My API",
    "version": "1.0",
    "description": "Demo API",
    "x-example": "custom metadata"
}

Actual behavior

Swaggo does not allow passing custom extensions to the info section.

Use case

We need to comply with internal standards (e.g., Spectral rules, company policies) that require specific metadata in the info section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions