openapi-codegen icon indicating copy to clipboard operation
openapi-codegen copied to clipboard

securitySchemes are ignored

Open Karnak19 opened this issue 11 months ago • 0 comments

Hello, I have an openapi spec which use the securitySchemes, which seems to not be parsed:

    /site-config:
        get:
            summary: Retrieve the configuration of a site
            operationId: getSiteConfig
            responses:
                '200':
                    description: "successful operation"
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/SiteConfig'
                '500':
                    description: Site not found
            security:
                -   minisite_domain_header: [ ]
    securitySchemes:
        minisite_domain_header:
            type: apiKey
            in: header
            name: X-MINISITE-DOMAIN

Which in the end generate:

export const getSiteConfig = (signal?: AbortSignal) =>
  awakenFetch<Schemas.SiteConfig, GetSiteConfigError, undefined, {}, {}, {}>({
    url: "/site-config",
    method: "get",
    signal,
  });

Shouldn't this header be added as variable here ?

Karnak19 avatar Feb 27 '25 15:02 Karnak19