-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve readme "Get started" and fix credential policy issue. #1976
Conversation
…`autorest --typescript` The previous stated approach did not work and you need to use the `--input-file=<swagger file>` flag to set the input file.
`credential` that was referrered to previously is undefined.
Thank you for your contribution @lukben2000! We will review the pull request and get back to you soon. |
@microsoft-github-policy-service agree |
@@ -710,7 +710,7 @@ function getTrack2DefaultContent( | |||
}); | |||
this.pipeline.addPolicy( | |||
coreRestPipeline.bearerTokenAuthenticationPolicy({ | |||
credential: credentials, | |||
credential: options.credential, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add more descriptions for this fix?
My understanding is that we enable this policy only when there is a required parameter credentials
so we should not go to optional one options.credential
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do a search-and-replace temp fix for my project, when using this package. In the previous implementation credentials
are not defined. So it might be a matter of exposing this variable then, but let me just have a second look when I get off work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am running autorest with the following command:
autorest --typescript --package-name=api-client --input-file=api-specs.json --package-version=1.0.0 --add-credentials=true --generate-metadata=true --generate-client-as-impl=true --generate-client-interfaces --output-folder=api-client-package
Maybe I am missing something in regards to the credentials?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what kind of issue you met, if you enable the option add-credentials
it's better to define your credential details in OpenAPI(refer link), otherwise we will met the known issue and I was trying to fix in this pr.
Please file a new one if your case is different https://github.com/Azure/autorest.typescript/issues.
@lukben2000 Could you try wiht our latest version https://www.npmjs.com/package/@autorest/typescript/v/6.0.9? I believe this should be fixed in our latest. I will close this pr considering it's fixed and feel free to re-open it if still existing. |
No description provided.