Support non-security cookie parameters in @effect/openapi-generator HttpClient output
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- api
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
localecookie in the example.
- Lenguaje dominante
- TypeScript
- Estrellas
- 16.7k
- Forks
- 808
- Merge medio
- 11 h 3 min
- PR fusionados (30 d)
- 840
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Effect-TS/effect
-
PgClient: withTransaction dies instead of failing with SqlError when the server ends the sessionPosiblemente ocupada @effect-bot la tomó hoy. Abierto
Effect-TS/effect#10290 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
shorthand for mapping over tagged union schemaPosiblemente ocupada @effect-bot la tomó hoy. Abiertoenhancement
Effect-TS/effect#10286 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Cluster: A way to remove processed requests from storagePosiblemente ocupada @effect-bot la tomó hace 2 días. Abiertoenhancement
Effect-TS/effect#10239 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
cluster: a runner that lost its shard lock can still write replies and messages for that shardAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 47/100
Los mantenedores suelen responder en 1 día
Todos los issues de Effect-TS/effect
Issues similares
-
Remove unused dependenciesPosiblemente ocupada @alastair-smith la tomó hoy. Abiertochore other
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
alastair-smith/card-games#384 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
code-yeongyu/senpi#5571 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nexu-io/open-design#9262 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
friction
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kentcdodds/kody#4753 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
lingdojo/kana-dojo#33508 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día