Skip to content
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

Issue generating client with not complete url params #478

Closed
thompson-tomo opened this issue Nov 20, 2024 · 2 comments
Closed

Issue generating client with not complete url params #478

thompson-tomo opened this issue Nov 20, 2024 · 2 comments
Labels
Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question

Comments

@thompson-tomo
Copy link
Contributor

When i try and generate the client with just the base url

    "swagger": "2.0",
    "info": {
        "version": "4.10.0",
        "title": "Dependency-Track API"
    },
    "basePath": "/api",
    "tags": []

it fails with the below error.

1>    kiota client generate
1>    crit: Kiota.Builder.KiotaBuilder[0]
1>          error adding the client: The baseUrl must be a valid URL and end in a slash. (Parameter 'ApiDeploymentBaseUrl')
1>    D:\OSS\wemicroit\Dependency-Track-Dotnet-Plugin\src\DependencyTrack.Dotnet.Plugin\DependencyTrack.Dotnet.Plugin.csproj(23,5): error MSB3073: The command "kiota client generate" exited with code 1.
1>  Done executing task "Exec" -- FAILED.

When i add in the scheme such as below

    "swagger": "2.0",
    "info": {
        "version": "4.10.0",
        "title": "Dependency-Track API"
    },
    "schemes": [http],
    "basePath": "/api",
    "tags": []

it also fails with the below error which is more helpful.

EXEC : OpenAPI warning : #/ - A servers entry (v3) or host + basePath + schemes properties (v2) was not present in the OpenAPI description. The root URL will need to be set manually with the request adapter.
1>D:\OSS\wemicroit\Dependency-Track-Dotnet-Plugin\src\DependencyTrack.Dotnet.Plugin\DependencyTrack.Dotnet.Plugin.csproj(23,5): error MSB3073: The command "kiota client generate" exited with code 1.
1>    1 Warning(s)
1>    1 Error(s)

This error should not have happened

When i fully correct it so that it appears as below:

    "swagger": "2.0",
    "info": {
        "version": "4.10.0",
        "title": "Dependency-Track API"
    },
    "schemes": [http],
    "host": "localhost",
    "basePath": "/api",
    "tags": []

It works and my client is generated, my problem is this api spec is for a local webservice hence wanting to force the client to specify base url.

Note i have migrated to kiota workspace files.

@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Nov 20, 2024
@baywet
Copy link
Member

baywet commented Nov 25, 2024

Hi @thompson-tomo
Thank you for using kiota and for reaching out.

What version of kiota are you using?

this should already be a warning instead of a full stop error

Please upgrade to the latest version of kiota and try again.

@baywet baywet added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question labels Nov 25, 2024
@baywet baywet moved this from Needs Triage 🔍 to Waits for author 🔁 in Kiota Nov 25, 2024

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@github-project-automation github-project-automation bot moved this from Waits for author 🔁 to Done ✔️ in Kiota Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: No Recent Activity status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:question An issue that's a question
Projects
Archived in project
Development

No branches or pull requests

2 participants