Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support non-security cookie parameters in @effect/openapi-generator HttpClient output

オープン
#8,845 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
node.js, typescript
領域
api

調査の方向性

Start with the parser in packages/tools/openapi-generator/src/OpenApiGenerator.ts, which the issue identifies as emitting the warning, and trace how in: "cookie" parameters are represented in generated httpclient operations and requests. Use the provided reproduction to verify the generated input and request behavior. Done means ordinary cookie parameters retain their types and requiredness and have a supported server-side sending path without assuming browsers can set a Cookie header.

索引モデルが issue の本文から書いたものです。

説明

What is the problem this feature would solve?

@effect/[email protected] drops ordinary OpenAPI parameters declared with in: "cookie" when generating format: "httpclient" output. It emits cookie-parameter-dropped, but even a required cookie is omitted from both the generated operation input and request construction.

For server-side consumers, this means the generated method does not represent the full request contract, and cookies must be supplied separately through the HTTP client. Ordinary cookies such as a locale preference should not need to be modeled as authentication security schemes.

The warning is intentional in the current parser. This is a request to extend support.

Minimal reproduction

Verified with Node.js v26.10.0 on macOS arm64 and these exact dependencies:

pnpm add [email protected] @effect/[email protected] @effect/[email protected]

Save the following as repro.mjs, then run node repro.mjs:

import { Effect } from 'effect'
import * as OpenApiGenerator from '@effect/openapi-generator/OpenApiGenerator'

const spec = {
  openapi: '3.0.3',
  info: { title: 'Cookie parameter example', version: '1.0.0' },
  paths: {
    '/greeting': {
      get: {
        operationId: 'getGreeting',
        parameters: [
          {
            name: 'locale',
            in: 'cookie',
            required: true,
            schema: { type: 'string' },
          },
        ],
        responses: { '204': { description: 'No content' } },
      },
    },
  },
}

const warnings = []
const generated = await Effect.runPromise(
  Effect.gen(function* () {
    const generator = yield* OpenApiGenerator.OpenApiGenerator
    return yield* generator.generate(spec, {
      format: 'httpclient',
      name: 'ExampleClient',
      onWarning: (warning) => warnings.push(warning),
    })
  }).pipe(Effect.provide(OpenApiGenerator.layerTransformerSchema)),
)

console.log(JSON.stringify(warnings, null, 2))
console.log(generated)

The process exits successfully and reports:

[
  {
    "code": "cookie-parameter-dropped",
    "message": "Cookie parameter \"locale\" was dropped because non-security cookie parameters are not supported.",
    "path": "/greeting",
    "method": "get",
    "operationId": "getGreeting"
  }
]

The generated getGreeting method accepts only the response config option. It has no locale input and does not serialize a cookie into the request, despite required: true in the specification.

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

Preserve ordinary cookie parameter types and requiredness in the generated operation inputs, with a supported way to send those values in server-side HTTP clients.

Please account for browser restrictions: browser cookies are managed by the browser, so explicitly setting a Cookie header is not a portable implementation. A documented runtime-aware option or integration hook would also help.

What alternatives have you considered?
  • Configure cookie headers or a cookie jar on the underlying HTTP client. This can handle transport, but the generated method still loses the per-operation parameter type and requiredness.
  • Use browser-managed cookies where applicable. This does not cover server-side callers.
  • Declare genuine authentication cookies as security schemes. This is not an appropriate model for ordinary parameters such as the locale cookie in the example.
主要言語
TypeScript
スター
16.7k
フォーク
808
平均マージ
11時間 28分
マージ済み PR(30日)
490

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Effect-TS/effect のほかの issue

Effect-TS/effect の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。