OpenAPITools / OpenAPITools/openapi-generator
[BUG] property auth not working in batch via config.yaml
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
https://openapi-generator.tech/docs/usage/#batch
my yaml config is
validateSpec: "false"
auth: "authorization:Basic%20token"
inputSpec: http://127.0.0.1:1111/api/swagger/generated/swagger.yaml
generatorName: typescript-axios
outputDir: test
then i do:
npm run openapi-generator-cli batch ./shared/common.yaml and gets 401. Also this command ( npm run openapi-generator-cli batch ./shared/common.yaml) does not work on @openapitools/openapi-generator-cli latest 2.3.5 and higher
my current versions:
- "@openapitools/openapi-generator-cli": "2.2.8"
- version: 5.1.1
headers from my server
{"accept":"application/json, application/yaml, */*","user-agent":"Apache-HttpClient/Swagger","host":"127.0.0.1:1111","connection":"keep-alive"}
but when i use openapi-generator-cli generate --skip-validate-spec --auth authorization:Basic%20token -g typescript-axios -i http://127.0.0.1:1111/api/swagger/generated/swagger.yaml -o ./src/types/base" it works.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the batch command in the usage documentation and reproduce it using ./shared/common.yaml and the shown auth value. Compare its request behavior with the working generate command using --auth, then verify that the batch invocation passes authentication and no longer receives a 401 response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, node.js, typescript, yaml
- Domain
- api, cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100