OpenAPITools / OpenAPITools/openapi-generator

Can avoid requirement to supply header parameters at every native API call?

Open
#4,767 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

My API has a number of header parameters that appear in almost every operation.
Generally, these are constant for the client though the use of the API and its convenient to supply them as header parameters for all requests. So,
instead of generating an API that requires I call

operation(headerParam1, headerParam2, headerParam3, ...other params ... )

is it possible to have the generated API have the prototype
operation(...other params ... )

where headerParam1, headerParam2, headerParam3 are, ahead-of-time placed into the client object?

Am interested in this for the Dart language.

I would imagine this would be possible by stripping the header parameters from the openapi specification prior to performing language-specific processing. Could there be a parameter to drop the header parameters?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating Dart client generation and how OpenAPI header parameters are handled, then trace the language-specific processing path; done means repeated header parameters can be stored on the client and omitted from generated operation prototypes without affecting other parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, openapi
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.