Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

securitySchemes are ignored

Đang mở
#305 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
openapi, typescript
Lĩnh vực
api, devtools

Hướng nghiên cứu

Start by running the code generator with the provided OpenAPI path and securitySchemes examples, then trace how the generated getSiteConfig function handles operation-level security. Done means the minisite_domain_header security scheme is represented in the generated request so X-MINISITE-DOMAIN can be supplied.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 ?

Ngôn ngữ chính
TypeScript
Star
634
Fork
83
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fabien0102/openapi-codegen

Tất cả issue của fabien0102/openapi-codegen

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.