datamodel-code-generator
datamodel-code-generator copied to clipboard
Add authentication for remote $ref
I have been trying to generate a pydantic model. One of the schemas has a remote $ref to an api that uses Basicauth. So it keeps failing :/
It would be great if one can pass auth parameters, e.g. like in swagger-codegen to access remote endpoints.
Thanks
@BozhidaraGYG Thank you for creating this issue. That's a great suggestion.
I will implement it!
@BozhidaraGYG
I have released a new verison 0.11.12
The version supports --http-headers option.
You can give HTTP headers to the CLI.
$ datamodel-codegen --input input.json --http-headers 'Authorization: Basic dXNlcjpwYXNz' 'X-API-key: abcefg'
@BozhidaraGYG I have released a new verison
0.11.12The version supports--http-headersoption. You can give HTTP headers to the CLI.$ datamodel-codegen --input input.json --http-headers 'Authorization: Basic dXNlcjpwYXNz' 'X-API-key: abcefg'
Amazing. Can't wait to try